英雄榜

This commit is contained in:
huang 2016-03-05 10:38:21 +08:00
parent 0a18f365ab
commit 4f2937e1a2
2 changed files with 26 additions and 18 deletions

View File

@ -144,14 +144,14 @@
<ul class="rankList"> <ul class="rankList">
<h4>课程活跃度<a style="float: right; color: #7f7f7f; font-size: 12px;" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))">积分规则</a></h4> <h4>课程活跃度<a style="float: right; color: #7f7f7f; font-size: 12px;" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))">积分规则</a></h4>
<div style="display: none" class="numIntro"> <div style="display: none" class="numIntro">
<div style="padding-left: 35px; font-size: 14px;color: #3b3b3b">积分规则</div> <div style="font-size: 14px;color: #3b3b3b">积分规则</div>
资源得分:资源数 x 5 </br> 资源发布:资源数 x 5 </br>
发帖得分:发帖数 x 2 </br> 问答发布:发帖数 x 2 </br>
回帖得分:回复数 x 1 </br> 通知发布:通知数 x 1 </br>
通知得分:通知数 x 1 </br> 问答回复:回复数 x 1 </br>
课程留言得分:留言数 x 1 </br> 作业留言:留言数 x 1 </br>
作业留言得分:留言数 x 1 </br> 通知留言:留言数 x 1 </br>
通知回复得分:回复数 x 1 </br> 课程留言:留言数 x 1 </br>
总得分为以上得分之和 总得分为以上得分之和
</div> </div>
@ -176,23 +176,26 @@
<!--</div>--> <!--</div>-->
<div style="padding-left: 65px; font-size: 14px;color: #3b3b3b">积分计算</div> <div style="padding-left: 65px; font-size: 14px;color: #3b3b3b">积分计算</div>
<%# unless contributor_score.resource_num.to_i == 0 %> <%# unless contributor_score.resource_num.to_i == 0 %>
课程资源:资源数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br> 资源发布数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br>
<%# end %> <%# end %>
<%# unless contributor_score.message_num.to_i == 0 %> <%# 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 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 %> <%# end %>
<%# unless contributor_score.message_reply_num.to_i == 0 %> <%# 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.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 %> <%# end %>
<%# unless contributor_score.journal_num.to_i == 0 %> <%# 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> 课程留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
<%# end %> <%# end %>
<%# unless contributor_score.homework_journal_num.to_i == 0 %> <%# unless contributor_score.homework_journal_num.to_i == 0 %>
作业留言:留言数 x 1 = <%= contributor_score.homework_journal_num.to_i %> x 1 = <%= contributor_score.homework_journal_num.to_i %></br>
<%# end %> <%# end %>
<%# unless contributor_score.news_reply_num.to_i == 0 %> <%# unless contributor_score.news_reply_num.to_i == 0 %>
发布通知:通知数 x 1 = <%= contributor_score.news_num.to_i %> x 1 = <%= contributor_score.news_num.to_i %></br>
通知回复:回复数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
<%# end %> <%# end %>
总得分:<%=total_score %> 总得分:<%=total_score %>
</div> </div>
@ -206,12 +209,17 @@
<% hero_homework_scores = hero_homework_score(@course, "desc") %> <% hero_homework_scores = hero_homework_score(@course, "desc") %>
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %> <% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
<ul class="rankList"> <ul class="rankList">
<h4><span>课程英雄榜</span><a style="float: right; color: #7f7f7f; font-size: 12px;" title="英雄榜的得分是每个同学作业的得分总和">积分规则</a></h4> <h4><span>课程英雄榜</span>
<a style="float: right; color: #7f7f7f; font-size: 12px;" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))">积分规则</a></h4>
<div style="display: none" class="numIntro">
<div style="font-size: 13px;color: #3b3b3b">积分规则</div>
英雄榜的得分是每个同学作业的得分总和
</div>
<% hero_homework_scores.each do |student_score| %> <% hero_homework_scores.each do |student_score| %>
<% if student_score.score.to_i != 0 %> <% if student_score.score.to_i != 0 %>
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a> <li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p> <p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
<p><span class="c_red" style="cursor:pointer" title="英雄榜的得分是每个同学作业的得分总和"><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p> <p><span class="c_red" style="cursor:pointer" ><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160304200639) do ActiveRecord::Schema.define(:version => 20160304234903) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false