81 lines
3.6 KiB
Plaintext
81 lines
3.6 KiB
Plaintext
<!-- added by bai -->
|
||
<div class="autoscroll">
|
||
<% for user in @applicants -%>
|
||
<% unless user.id == 1%>
|
||
<!-- 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 %>
|
||
|
||
<% journals_for_messages_count = user.journals_for_messages.count %>
|
||
<% 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 -->
|
||
<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>
|
||
<%= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
||
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
|
||
|
||
<!-- modified by bai -->
|
||
<div style="position:relative;float:left;margin-top:-2px;margin-left: 160px">
|
||
<%= l(:label_user_grade) %>: <span style="color:#ec6300"> <%= render :partial => 'users/user_score', :locals => {:user => user}%></span>
|
||
</div>
|
||
<!-- end -->
|
||
</div>
|
||
|
||
<div style="margin-top: 20px;margin-left:66px">
|
||
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%>
|
||
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
||
|
||
</div>
|
||
<div class="user-bottom">
|
||
<% unless user.memberships.empty? %>
|
||
<% 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_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||
<% end %>
|
||
<% end %>
|
||
|
||
<p>
|
||
<% unless user.memberships.empty? %>
|
||
<% cond = Project.visible_condition(User.current) + "AND projects.project_type = 1" %>
|
||
<% memberships = user.memberships.all(:conditions => cond) %>
|
||
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
|
||
<%= ":" unless user_courses.empty? %>
|
||
<% for member in memberships %>
|
||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||
<% end %>
|
||
<% end %>
|
||
</p>
|
||
|
||
<%= user.changesets.count == 0 ? '' : "#{l(:label_x_total_commit, :count => user.changesets.count)}" %>
|
||
<%= link_to "同意申请", {:controller => 'open_source_projects', :action => 'accept_master_apply', :id => @open_source_project.id, :user_id => user.id}%>
|
||
<%= link_to "拒绝申请", {:controller => 'open_source_projects', :action => 'refuse_master_apply', :id => @open_source_project.id, :user_id => user.id}%>
|
||
</div>
|
||
</div>
|
||
<% end -%>
|
||
<% end -%>
|
||
</div> |