diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index c20dfa36d..6105b22b2 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -95,6 +95,7 @@ class WelcomeController < ApplicationController def entry_select url = request.original_url if url.include?("course.trustie.net") + course render :course return 0 elsif url.include?("contest.trustie.net") diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1623e00e3..e62339249 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -193,9 +193,8 @@ module ApplicationHelper end def thumbnail_tag(attachment) - imagepath = named_attachment_path(attachment, attachment.filename) - link_to image_tag(imagepath), - imagepath , + link_to image_tag(thumbnail_path(attachment)), + named_attachment_path(attachment, attachment.filename), :title => attachment.filename end diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index f73df8fb4..c135ee214 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -33,7 +33,7 @@ <% if images.any? %>
<% images.each do |attachment| %> -
<%= thumbnail_small_tag(attachment) %>
+
<%= thumbnail_tag(attachment) %>
<% end %>
<% end %> diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 8a567bd53..d919baffe 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -298,8 +298,9 @@
+ <% score = c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> <%= l(:label_final_scores) %> - :<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %> + :<%= format("%.2f" , score) %> 分 diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index e41ecb842..b5e3e951c 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -79,9 +79,10 @@ <% end %>
-
-
<%=l(:label_final_scores)%>
-
<%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分
+
+
<%=l(:label_final_scores)%>
+ <% score = @softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> +
<%= format("%.2f" , score) %>分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index a9d7e994a..08d7d13d4 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -54,7 +54,7 @@