From 6789693fc761f0db4d9509924e8d38b8cc9cf5a1 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 10:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E8=AF=84=E5=88=86=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E8=B6=85=E8=BF=875=E4=B8=AA=E6=97=B6=EF=BC=8C=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E4=BC=98=E7=A7=80=E4=BD=9C=E5=93=81=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E2=80=9C=E6=9B=B4=E5=A4=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 4 +++- app/views/users/_course_homework.html.erb | 5 +++-- app/views/users/_user_homework_detail.html.erb | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index ffee90ede..88170dc2d 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -155,7 +155,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works.count > 5 %> + <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
<% end %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 651a284e4..e6ed73036 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -134,7 +134,6 @@ <% if activity.student_works.count != 0 %> <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> <% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> - <%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %> <% unless student_work_scores.empty? %> <% last_score = student_work_scores.first %>
@@ -155,7 +154,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works.count > 5 %> + <%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
<% end %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index b3e14d174..bf24ea3b2 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -156,7 +156,9 @@ <% break %> <% end %> <% end %> - <%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% if student_works > 5%> + <%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> + <% end %>
<% end %>