diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c234eb17b..0b2ae02b3 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -60,7 +60,7 @@ class AttachmentsController < ApplicationController :disposition => (@attachment.image? ? 'inline' : 'attachment') end rescue => e - redirect_to "http://forge.trustie.net/file_not_found.html" + redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html" end #更新资源文件类型 diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index a013facbc..f3578e713 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -57,7 +57,7 @@ diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 80cd7df9d..ef8f37566 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -17,9 +17,9 @@ <% @admin = @course.course_infos%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> - <%# unless @course.course_extra.school.nil? %> - <%= @course.teacher.user_extensions.school.try(:name) %> - <%# end %> + <% unless @course.teacher.user_extensions.school.nil? %> + <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %> + <% end %> <% end %>

diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index c29903d78..ecc4306f7 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -24,7 +24,7 @@ - <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index', :course_type => 1 %> + <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index', :course_type => 1 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index', :course_type => 1 %> diff --git a/app/views/courses/search.html.erb b/app/views/courses/search.html.erb index 96f8c227d..25b45e0db 100644 --- a/app/views/courses/search.html.erb +++ b/app/views/courses/search.html.erb @@ -22,7 +22,7 @@ - <%= link_to "forge.trustie.net/courses", :controller => 'courses', :action => 'index'%> + <%= link_to request.host() + "/courses", :controller => 'courses', :action => 'index'%> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> diff --git a/app/views/git_usage/ch_usage.html.erb b/app/views/git_usage/ch_usage.html.erb index 5fca6b156..330ab9b5e 100644 --- a/app/views/git_usage/ch_usage.html.erb +++ b/app/views/git_usage/ch_usage.html.erb @@ -143,7 +143,7 @@ body table tr td span6 {

在桌面上点击鼠标右键,选择TortoiseGit的Settings进行设置

- Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, 其中的name和email要和forge.trustie.net上的登陆名和邮箱保持一致 + Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, 其中的name和email要和<%= Setting.host_name %>上的登陆名和邮箱保持一致 ,方便代码贡献统计 )。 @@ -313,7 +313,7 @@ body table tr td span6 {

$git config --global user.name “your_name”

$git config --global user.email “your_email” 

Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, - 其中的name和email要和forge.trustie.net上的登陆名和密码保持一致 + 其中的name和email要和<%= Setting.host_name %>上的登陆名和密码保持一致 ,方便代码贡献统计 )。

diff --git a/app/views/git_usage/en_usage.html.erb b/app/views/git_usage/en_usage.html.erb index ce202c792..237895d23 100644 --- a/app/views/git_usage/en_usage.html.erb +++ b/app/views/git_usage/en_usage.html.erb @@ -143,7 +143,7 @@ body table tr td span6 {

Right-click on the desktop and select the "Settings" in the "TortoiseGit"

-

User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, the name and email must be the same with login name and email you registed in the forge.trustie.net +

User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, the name and email must be the same with login name and email you registed in the <%= Setting.host_name %> ).

Then you can customize the "Context Menu":

Please check the "Clone","Sync" and "Commit" options in the "Context Menu",

@@ -306,7 +306,7 @@ body table tr td span6 {

$git config --global user.name “your_name”M

$git config --global user.email “your_email” 

User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, - the name and email must be the same with login name and email you registed in the forge.trustie.net + the name and email must be the same with login name and email you registed in the <%= Setting.host_name %> ).

diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index ec7516689..2fc383440 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -12,7 +12,7 @@ <%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%> <%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %> <%=l(:label_copyright)%>@2007~2014 - <%= link_to l(:label_contact_us),"http://forge.trustie.net/projects/2/member", :target=>"_blank" %> + <%= link_to l(:label_contact_us),"http://" + Setting.host_name + "/projects/2/member", :target=>"_blank" %> <%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %>

diff --git a/app/views/layouts/_bootstrap_base_footer.html.erb b/app/views/layouts/_bootstrap_base_footer.html.erb index 2bda28bdd..a2fdd6208 100644 --- a/app/views/layouts/_bootstrap_base_footer.html.erb +++ b/app/views/layouts/_bootstrap_base_footer.html.erb @@ -5,7 +5,7 @@ 主办单位: <%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47"%> <%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41"%> - <%= link_to "联系我们","http://forge.trustie.net/projects/2/member"%> + <%= link_to "联系我们","http://" + Setting.host_name + "/projects/2/member"%> <%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%>
diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb index 43c5b9ae8..1aa8e45f8 100644 --- a/app/views/mailer/journals_for_message_add.html.erb +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -1,5 +1,5 @@ 尊敬的用户,<%= @user %>给你留言了:
<%= @message %>

点击链接查看最新回复<%= link_to(@url, @url) %>

-         

<%= link_to(l(:lable_not_receive_mail),"http://forge.trustie.net/my/account")%>

+         

<%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb index b1bd3d41e..36117e0bb 100644 --- a/app/views/projects/search.html.erb +++ b/app/views/projects/search.html.erb @@ -24,7 +24,7 @@ - <%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> + <%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %> diff --git a/app/views/welcome/_link_to_another.html.erb b/app/views/welcome/_link_to_another.html.erb index bda48e753..14640897c 100644 --- a/app/views/welcome/_link_to_another.html.erb +++ b/app/views/welcome/_link_to_another.html.erb @@ -1,6 +1,6 @@
- <%=l(:label_projects_management_platform)%> - <%=l(:label_courses_management_platform)%> - <%=l(:label_contests_management_platform)%> + <%=l(:label_projects_management_platform)%> + <%=l(:label_courses_management_platform)%> + <%=l(:label_contests_management_platform)%>
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 8318a239a..f9dd53cf3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -700,7 +700,7 @@ RedmineApp::Application.routes.draw do #######confusing######## get 'welcome/search', to: 'welcome#search' get 'school/index', to: 'school#index' - get 'course/:school_id', to: 'welcome#course', :as => 'school_course_list' + get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list' #get 'course/:school_id', to: 'welcome#course' post 'school/get_options/:province', :to => 'school#get_options' get 'school/get_options/:province', :to => 'school#get_options' diff --git a/config/settings.yml b/config/settings.yml index f2c64a97c..268198d4f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -71,6 +71,10 @@ default_language: default: zh host_name: default: forge.trustie.net +host_course: + default: course.trustie.net +host_contest: + default: contest.trustie.net protocol: default: http feeds_limit: diff --git a/lib/redmine/info.rb b/lib/redmine/info.rb index 63c066da8..f41e576d3 100644 --- a/lib/redmine/info.rb +++ b/lib/redmine/info.rb @@ -2,8 +2,8 @@ module Redmine module Info class << self def app_name; 'Trustie' end - def url; 'http://forge.trustie.net/' end - def help_url; 'http://forge.trustie.net/forums' end + def url; 'http://'+ Setting.host_name + '/' end + def help_url; 'http://'+ Setting.host_name + '/forums' end def versioned_name; "#{app_name} #{Redmine::VERSION}" end def environment