socialforge/app/views/courses/_course_activity_users.html...

53 lines
3.4 KiB
Plaintext

<% count = contributor_course_scor(course.id).select{|ccs| ccs.con_score != 0 && !ccs.con_score.nil?}.count %>
<% unless count == 0 %>
<div>
<ul class="rankList">
<h3 style="font-size: 14px; font-weight: normal;">
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "活跃度", course_statistics_course_path(@course), :class => 'fontGrey3' %>
<% else %>
<span class="fontGrey7"> 活跃度 </span>
<% end %>
<div class="cl"></div>
</h3>
<% contributor_course_scor(course.id).each do |contributor_score| %>
<% total_score = contributor_score.con_score %>
<% if !total_score.nil? && total_score !=0 %>
<li>
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %>
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>
<p><span class="sy_corange" style="cursor:pointer">
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="sy_corange">
<%=total_score %></a></span></p>
<div style="display: none" class="numIntro">
<div class="contributor-course-calculate">积分计算</div>
<%# unless contributor_score.resource_num.to_i == 0 %>
<div style="padding-left: 2px;padding-bottom: 2px;padding-right: 2px">
资源发布数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br>
<%# end %>
<%# unless contributor_score.message_num.to_i == 0 %>
问答发布数 x 2 = <%= contributor_score.message_num.to_i %> x 2 = <%= contributor_score.message_num.to_i * 2 %></br>
通知发布数 x 1 = <%= contributor_score.news_num.to_i %> x 1 = <%= contributor_score.news_num.to_i %></br>
<%# end %>
<%# unless contributor_score.message_reply_num.to_i == 0 %>
问答回帖数 x 1 = <%= contributor_score.message_reply_num.to_i %> x 1 = <%= contributor_score.message_reply_num.to_i %></br>
作业留言数 x 1 = <%= contributor_score.homework_journal_num.to_i %> x 1 = <%= contributor_score.homework_journal_num.to_i %></br>
通知留言数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
<%# end %>
<%# unless contributor_score.journal_num.to_i == 0 %>
班级留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
<%# end %>
<%# unless contributor_score.homework_journal_num.to_i == 0 %>
<%# end %>
<%# unless contributor_score.news_reply_num.to_i == 0 %>
<%# end %>
总得分:<%=total_score %>
</div>
</div>
</li>
<% end %>
<% end %>
<div class="cl"></div>
</ul>
</div>
<% end %>