From b7b1a81a5466e1f0e303817c8096a1a5f4bdc997 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 12 Dec 2014 09:46:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=BC=A0=E5=85=A5=E5=8F=82=E6=95=B0=E6=9C=89?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 2be4e78bb..3612bf7a4 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -44,7 +44,7 @@ class ZipdownController < ApplicationController if homework != nil unless homework.attachments.empty? zipfile = zip_homework_by_user homework - send_file zipfile, :filename => (homework.user.user_extensions.nil? ? "" : homework.user.user_extensions.student_id) + + send_file zipfile, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) + "_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) + "_" + homework.name + ".zip", :type => detect_content_type(zipfile) if(zipfile) else @@ -80,7 +80,7 @@ class ZipdownController < ApplicationController homeattach.attachments.each do |attach| homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) end - zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{(homework.user.user_extensions.nil? ? "" : homework.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) + zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) end From 560a4ebaccf79d73e2fc4c1717a82eeab8ffb3b9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 12 Dec 2014 14:45:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E7=AB=9E=E8=B5=9B=E4=B8=BB=E9=A1=B5=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=A6=82=E6=B2=A1=E5=9B=9E=E5=A4=8D=E8=80=85?= =?UTF-8?q?=E5=B0=B1=E5=8F=96=E6=B6=88=E6=98=BE=E7=A4=BA=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/contest.html.erb | 64 ++++++++++++++++++++++-------- app/views/welcome/course.html.erb | 2 +- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 40be02464..07696386f 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -153,7 +153,11 @@
<%= l(:label_no_ftapplication) %>
- ++ <%= l(:label_no_ftapplication) %> +
<% end %> diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index f1b09cf54..5886f0525 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -153,8 +153,8 @@ <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> - <%= l(:label_final_reply)%>: <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %> + <%= l(:label_final_reply)%>: <%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%> <% end %>