2014-01-23 14:34:54 +08:00
|
|
|
|
<!-- added by bai -->
|
2013-11-08 11:25:33 +08:00
|
|
|
|
<div class="autoscroll">
|
|
|
|
|
<% for user in @users -%>
|
2014-01-23 14:34:54 +08:00
|
|
|
|
<!-- added by bai -->
|
|
|
|
|
<% messages_count = user.messages.count %>
|
|
|
|
|
<% messages_score = messages_count * 0.05%>
|
|
|
|
|
<% finall_messages_score = messages_score %>
|
|
|
|
|
|
|
|
|
|
<% journals_count = user.journals.count %>
|
|
|
|
|
<% journals_score = journals_count * 0.1 %>
|
|
|
|
|
<% user_changesets_count = user.changesets.count %>
|
|
|
|
|
<% user_changesets_score = user_changesets_count * 0.3 %>
|
|
|
|
|
<% finall_user_project_score = journals_score + user_changesets_score %>
|
|
|
|
|
|
2014-04-11 10:53:51 +08:00
|
|
|
|
<% journals_for_messages_count = user.journals_messages.count %>
|
2014-01-23 14:34:54 +08:00
|
|
|
|
<% activities_count = user.activities.count %>
|
|
|
|
|
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
|
|
|
|
|
<% activities_score = activities_count * 0.2 %>
|
|
|
|
|
<% finall_activity_score = journals_for_messages_score + activities_score %>
|
|
|
|
|
|
|
|
|
|
<% news_count = user.news.count %>
|
|
|
|
|
<% news_score = news_count * 0.1 %>
|
|
|
|
|
<% wiki_contents_count = user.wiki_contents.count %>
|
|
|
|
|
<% wiki_contents_score = wiki_contents_count * 0.1 %>
|
|
|
|
|
<% comments_count = user.comments.count %>
|
|
|
|
|
<% comments_score = comments_count * 0.1 %>
|
|
|
|
|
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
|
|
|
|
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
|
|
|
|
<!-- end -->
|
2013-11-08 11:25:33 +08:00
|
|
|
|
<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>
|
2014-07-14 11:46:52 +08:00
|
|
|
|
<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)%>
|
|
|
|
|
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="user-bottom">
|
2014-05-23 11:50:36 +08:00
|
|
|
|
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
<% memberships = user.memberships.all(:conditions => cond) %>
|
|
|
|
|
<%= l(:label_x_contribute_to, :count => memberships.count) %>
|
|
|
|
|
<% for member in memberships %>
|
2014-07-18 09:46:11 +08:00
|
|
|
|
<%= link_to member.project.name, {:controller => 'projects', :action => 'show',id: member.project.id, host: Setting.project_domain } %><%= (memberships.last == member) ? '' : ',' %>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<p>
|
2014-07-04 11:26:37 +08:00
|
|
|
|
<%# unless user.memberships.empty? %>
|
|
|
|
|
<%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
|
|
|
|
|
<%# memberships = user.memberships.all(:conditions => cond) %>
|
2014-07-18 10:01:54 +08:00
|
|
|
|
<% user_courses = user_courses_list(user) %>
|
2014-07-04 11:26:37 +08:00
|
|
|
|
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
|
|
|
|
|
<% for course in user_courses %>
|
|
|
|
|
<%# if course.name != nil %>
|
2014-07-18 09:46:11 +08:00
|
|
|
|
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : ',' %>
|
2014-07-04 11:26:37 +08:00
|
|
|
|
<%# end %>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
<% end %>
|
2014-07-04 11:26:37 +08:00
|
|
|
|
<%# end %>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
2014-07-04 13:59:08 +08:00
|
|
|
|
<%= l(:label_x_total_commit, :count => user.changesets.count) %>
|
2013-11-08 11:25:33 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end -%>
|
|
|
|
|
</div>
|