From b456bc0e62f45cd5f37dcecd60952ec1de67570e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 6 May 2015 16:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E5=88=86=E6=94=AF=E6=8C=81=E6=89=930?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 3 ++- app/views/homework_attach/_homework.html.erb | 2 +- app/views/homework_attach/_review.html.erb | 2 +- app/views/homework_attach/_show_star.html.erb | 1 + public/stylesheets/css.css | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 4982a4b6b..523e430fb 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -445,7 +445,8 @@ class HomeworkAttachController < ApplicationController is_teacher = @is_teacher ? 1 : 0 #保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0)) @is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言 - if @m_score && (@is_teacher || @is_anonymous_comments) + if @is_teacher || @is_anonymous_comments + @m_score ||= 0 rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first if rate rate.stars = @m_score diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 466444528..973dbc51a 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -32,7 +32,7 @@ <% unless is_student_batch_homework %> <%= l(:label_teacher_score)%>: - <%= (homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)%> + <%= (homework.t_score.nil?) ? l(:label_without_score) : format("%.2f",homework.t_score)%>    <% end %> diff --git a/app/views/homework_attach/_review.html.erb b/app/views/homework_attach/_review.html.erb index 876980168..15203e8fc 100644 --- a/app/views/homework_attach/_review.html.erb +++ b/app/views/homework_attach/_review.html.erb @@ -26,7 +26,7 @@ <%= format_time(review.created_at) %> - <% if review.stars && review.stars.to_i > 0%> + <% if review.stars%> <%= l(:label_work_rating) %>: diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index 80f9d7f54..6cb901875 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -1,3 +1,4 @@ +零分 diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 3ef981910..fa5465dba 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -86,7 +86,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; } .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p span a{ color:#777777;} -.ping_star{ width:165px; color:#333; font-weight:bold; margin-bottom:5px;} +.ping_star{ width:185px; color:#333; font-weight:bold; margin-bottom:5px;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}