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 @@
<% projects = find_miracle_project(10, 3) %>
<% projects.map do |project| %>
- <% cache "welcome_index_hotProject_ul_#{project}_li" do %>
+ <% cache "welcome_index_hotProject_ul_project_#{project.id}_li" do %>
-
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
@@ -88,7 +88,7 @@
<%activities = find_all_activities%>
<% activities.each do |event| %>
- <% cache "welcome_index_userActivity_ul_#{event}_li" do %>
+ <% cache "welcome_index_userActivity_ul_event_#{event.class}_#{event.id}_li" do %>
-
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
@@ -118,8 +118,8 @@
<% end %>
<% topics = find_new_forum_topics(7) %>
- <% topics.each do |topic|%>
- <% cache "welcome_index_memosActivity_ul_#{topic}_li" do %>
+ <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
+ <% cache "welcome_index_memosActivity_ul_topic_#{topic.id}_li" do %>
-
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
diff --git a/config/configuration.yml b/config/configuration.yml
index e7138b587..a98ea3391 100644
--- a/config/configuration.yml
+++ b/config/configuration.yml
@@ -173,7 +173,7 @@ default:
# Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
- imagemagick_convert_command: '/home/pdl/redmine-2.3.1-1/common/bin/convert'
+ imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert'
# Configuration of RMagcik font.
#
diff --git a/config/routes.rb b/config/routes.rb
index b84885e29..03b437eeb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -671,6 +671,7 @@ RedmineApp::Application.routes.draw do
get 'school/search_school/', :to => 'school#search_school'
post 'school/upload', :to => 'school#upload'
+ get 'school/upload_logo', :to => 'school#upload_logo'
######added by nie
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
|