You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/views/users/_user_show.html.erb

73 lines
3.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!-- added by bai -->
<div class="autoscroll">
<% for user in @users -%>
<div class="well">
<%= content_tag "p", "#{format_date(user.created_on)} #{l(:label_member_since)}", :class => "float_right member_since" %>
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
<div>
<table style="width: 100%;table-layout: fixed">
<tr>
<td rowspan="2" style="width: 60px;">
<%= image_tag(url_to_avatar(user), :class => 'avatar') %>
</td>
<td style="width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= user.name %>">
<span style="position: relative;font-size: 16px;display:block; "><%= link_to_user(user) %></span>
</td>
<td>
<span style="color:#ec6300">
<%= render :partial => 'users/user_score', :locals => {:user => user}%>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<%= l(:label_x_has_fans,:count=>user.watcher_users.count, :remote => true)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count, :remote => true) %>
<% if User.current.logged?%>
<% if User.current == user%>
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<%if(user.watched_by?(User.current))%>
<a id="user_watch_id" href="javascript:void(0);">
<%=link_to "取消关注", watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr qx_btn mr10", :method => "delete", :title => "取消关注" %>
</a>
<% else %>
<a id="user_watch_id" href="javascript:void(0);">
<%= link_to "添加关注", watch_path(:object_type=>'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr gz_btn mr10", :method => "post", :title => "添加关注" %>
</a>
<% end %>
<% end%>
<% end %>
</td>
</tr>
</table>
</div>
<div class="user-bottom">
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to member.project.name, {:controller => 'projects', :action => 'show',id: member.project.id, host: Setting.host_name } %><%= (memberships.last == member) ? '' : '' %>
<% end %>
<p>
<%# unless user.memberships.empty? %>
<%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
<%# memberships = user.memberships.all(:conditions => cond) %>
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<%#= "" unless user_courses.empty? %>
<% for course in user_courses %>
<%# if course.name != nil %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : '' %>
<%# end %>
<% end %>
<%# end %>
</p>
<%= l(:label_x_total_commit, :count => user.changesets.count) %>
</div>
</div>
<% end -%>
</div>