From fced7dcb911ca34da3afa9a6060489b2d534aa6c Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 4 Nov 2014 15:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=B8=8D=E8=AE=A9=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_attach_helper.rb | 17 +++++++++++++---- app/views/homework_attach/_history.erb | 4 ++-- app/views/homework_attach/_show_star.html.erb | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index d8d418da5..750a71f6a 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -96,13 +96,22 @@ module HomeworkAttachHelper if array.nil? || array.count == 0 return "()" end - array.each do |member| - if member == array.last - ary += member.id.to_s + ")" + array.length.times do |i| + if i == array.length - 1 + ary += array[i].id.to_s + ")" else - ary += member.id.to_s + "," + if !(array[i].nil? || array[i].id.nil? || array[i].id.to_s == "") + ary += array[i].id.to_s + "," + end end end + #array.each do |member| + # if member == array.last + # ary += member.id.to_s + ")" + # else + # ary += member.id.to_s + "," + # end + #end ary end end \ No newline at end of file diff --git a/app/views/homework_attach/_history.erb b/app/views/homework_attach/_history.erb index 3376d696f..53de7d33f 100644 --- a/app/views/homework_attach/_history.erb +++ b/app/views/homework_attach/_history.erb @@ -49,12 +49,12 @@ <% ids = 'project_respond_form_'+ journal.id.to_s%> <% if reply_allow %>
- <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> + <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
<% end %>
- <%= render :partial => "words/journal_reply", :locals => {:journal => journal } %> + <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
diff --git a/app/views/homework_attach/_show_star.html.erb b/app/views/homework_attach/_show_star.html.erb index e21b3bc24..6dc82e238 100644 --- a/app/views/homework_attach/_show_star.html.erb +++ b/app/views/homework_attach/_show_star.html.erb @@ -1,4 +1,4 @@ -<% if is_comprehensive_evaluation == 3 %> +<% if is_comprehensive_evaluation == 3 || User.current == homework.user%> <%= l(:label_work_rating) %>: <%= render :partial => 'show_score', locals: {:stars => totle_score} %> <% elsif is_comprehensive_evaluation == 2 %>