From ca094a13b51fb83b3324c406aa970a71366c7c7d Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 8 Mar 2016 10:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E7=A7=80=E4=BD=9C=E5=93=81=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=EF=BC=8C=E4=B8=8D=E5=85=81=E8=AE=B8=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E7=9A=84=EF=BC=8C=E5=B0=B1=E5=8F=96=E6=B6=88=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E3=80=82=E8=80=81=E5=B8=88=E8=AE=BE=E7=BD=AE=E4=BA=86?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E5=85=AC=E5=BC=80=E7=9A=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=EF=BC=8C=E5=B0=B1=E6=9C=89=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_course_homework.html.erb | 14 ++++++++++++-- app/views/users/_course_homework.html.erb | 14 ++++++++++++-- app/views/users/_user_homework_detail.html.erb | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 0e056c972..2cf1810ad 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -154,8 +154,18 @@ <% end %> <% student_works.each_with_index do |sw, i| %>
- <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %> - + + <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> + <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %> + + <% else %> + <%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %> + + <% end %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index d42dc152d..9dd5eaa7a 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -153,8 +153,18 @@ <% end %> <% student_works.each_with_index do |sw, i| %>
- <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %> - + + <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> + <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %> + + <% else %> + <%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %> + + <% end %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>

分数:<%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分

diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 0c2856c89..9f3847735 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -157,8 +157,18 @@ <% end %> <% student_works.each_with_index do |sw, i| %>