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 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_current_hot_contest)%>

+

+ + <%=l(:label_current_hot_contest)%> + +

<% if User.current.logged? %> <% unless User.current.user_extensions.identity == 1 %> @@ -171,15 +175,26 @@
<%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> - (<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>) + ( + + <%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %> + ) + <% else %> - (<%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>) + ( + + <%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %> + ) + <% end %>
- <%=contest.description.truncate(100, omission: '...')%> -

+ + <%=contest.description.truncate(100, omission: '...')%> + +
+
<%=l(:label_release_time)%>: <%=format_time contest.created_on %> @@ -193,7 +208,9 @@

- <%=l(:label_notification)%> + + <%=l(:label_notification)%> +

- <%= link_to_user(notification.author) %> + + <%= link_to_user(notification.author) %> + <%= l(:label_project_notice) %> <%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
-
<%= notification.description.truncate(30, omission: '...') %>
-
<%=l(:label_release_time)%>: <%=format_time notification.created_at %>
+
+ <%= notification.description.truncate(30, omission: '...') %>
+
+ <%=l(:label_release_time)%>:  + <%=format_time notification.created_at %> +
<% end %> @@ -239,10 +262,14 @@ <%=l(:label_question_sponsor)%>: <%= 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?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> + <% 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 %> - <%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>) + <%=l(:label_reply)%> + (<%= link_to topic.try(:replies_count), topic.event_url %>)
@@ -265,17 +292,21 @@
<%= image_tag('/images/app1.png')%>
-
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
- ><%=softapplication.description.to_s.truncate(50, omission: '...')%> + > + <%=softapplication.description.to_s.truncate(50, omission: '...')%> +

- <%=l(:label_release_time)%>: <%=format_time softapplication.created_at %> + + <%=l(:label_release_time)%>:  + <%=format_time softapplication.created_at %> +
@@ -283,8 +314,9 @@ <% else %> -

<%= 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 %>