当评分为0分时显示为未评分

This commit is contained in:
sw 2014-12-15 09:19:20 +08:00
parent 9ffe32e121
commit 5343ee2cfb
2 changed files with 9 additions and 7 deletions

View File

@ -32,7 +32,7 @@
<% unless is_student_batch_homework %>
<%= l(:label_teacher_score)%>:
<span class="c_red">
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
<%= (homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)%>
</span>
&nbsp;&nbsp;
<% end %>

View File

@ -26,12 +26,14 @@
<%= format_time(review.created_at) %>
</span>
<span style="font-weight:bold; color:#a6a6a6; float: right;">
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<div class="ping_star">
<%= render :partial => 'homework_attach/show_static_star', :locals => {:start_score => review.stars } %>
</div>
<% if review.stars && review.stars.to_i > 0%>
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<div class="ping_star">
<%= render :partial => 'homework_attach/show_static_star', :locals => {:start_score => review.stars } %>
</div>
<% end %>
</span>
<div class="cl"></div>
<p><%= textilizable jour.nil? ? "" : jour.notes%></p>