From 2395ee4b1d6e02e298d1c29824780f770a060f68 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 4 Jul 2014 15:41:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 9 ++++++--- db/schema.rb | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 81ef95c8..09db4de9 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -46,6 +46,8 @@ class Mailer < ActionMailer::Base when :Project return -1 if journals_for_message.jour.project_type == Project::ProjectType_project project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") + when :Course + course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") when :Contest show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") when :User @@ -54,9 +56,10 @@ class Mailer < ActionMailer::Base Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}" return -1 end - #如果是直接留言并且留言对象是Project并且Project类型是课程 - if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Project && journals_for_message.jour.project_type == 1 - project = journals_for_message.jour + # modify by nwb + #如果是直接留言并且留言对象是课程 + if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Course + course = journals_for_message.jour @author = journals_for_message.user #课程的教师 @teachers = searchTeacherAndAssistant journals_for_message.jour diff --git a/db/schema.rb b/db/schema.rb index 32a903aa..fd5c9741 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -796,18 +796,18 @@ ActiveRecord::Schema.define(:version => 20140704034832) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false + t.string "subject", :null => false + t.text "content", :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" From c709545809bdac8a170453042a442b8464fbde5f Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 4 Jul 2014 16:55:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=90=8E=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=89=88=E6=9C=AC=E5=BA=93=E6=89=8D=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=A7=AF=E5=88=86=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E5=B0=9A=E9=9C=80=E6=B5=8B=E8=AF=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b357ac44..92186710 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -42,7 +42,7 @@ class ProjectsController < ApplicationController before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] before_filter :file, :statistics, :watcherlist - + before_filter :find_project_repository, :only => [:show] # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 before_filter :memberAccess, only: :member @@ -78,6 +78,14 @@ class ProjectsController < ApplicationController ### added by william include ActsAsTaggableOn::TagsHelper + def find_project_repository + unless @project.repositories.nil? + @project.repositories.each do |repository| + repository.fetch_changesets if Setting.autofetch_changesets? + end + end + end + def enterprise_course session[:enterprise_college] = 2 respond_to do |format| From c927bb6fd67521f54ecc957452856308a7930e05 Mon Sep 17 00:00:00 2001 From: nwb Date: Sat, 5 Jul 2014 09:33:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 9 ++++----- app/views/welcome/course.html.erb | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 1004a49a..4ff5a48e 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -141,27 +141,26 @@ module WelcomeHelper Course.active.visible. joins(:memberships). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum - + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else if school_id.nil? Course.active.visible. joins(:memberships). where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else if school_id == "0" Course.active.visible. joins(:memberships). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum else Course.active.visible. joins(:memberships). where("#{Course.table_name}.school_id = ?", school_id). group('members.course_id'). - reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum + reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum end end end diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index e79cc12c..624bd01d 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -73,7 +73,7 @@

新开课程

<% if @school_id %> - <% school_course = find_miracle_course(10, 7, @school_id) %> + <% school_course = find_miracle_course(10,7, @school_id) %> <% else %> <%school_course=[]%> <% end %> @@ -138,6 +138,7 @@
    <% school_course.map do |course| %> + <% if course.school%>
  • >
    <%= image_tag(get_course_avatar(course), :class => "avatar-4") %> @@ -167,6 +168,7 @@ <% end %>
  • + <%end%> <% end; reset_cycle %> <% if school_course.count < 9 %>
  • From 2fa9a4855ccaec49721ae0f3cc101c3a4ae93cc0 Mon Sep 17 00:00:00 2001 From: yanxd Date: Sat, 5 Jul 2014 09:39:58 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9C=80=E5=90=8E=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF=E7=9A=84=E6=AD=A3=E7=A1=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=88+=E5=8E=BB=E6=8E=89=E4=BA=86=E4=B9=B178?= =?UTF-8?q?=E7=B3=9F=E7=9A=84table=E5=A5=97table=EF=BC=89=20div-class?= =?UTF-8?q?=E5=86=85=E6=A0=87=E6=98=8Eactivity-title=E7=AD=89=EF=BC=8C?= =?UTF-8?q?=E5=86=85=E5=B5=8Ccss=E5=B1=9E=E6=80=A7=E7=AD=89=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=E5=86=8D=E7=A7=BB=E5=8A=A8=E5=87=BA?= =?UTF-8?q?html=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/show.html.erb | 138 ++++++++++++++----------------- 1 file changed, 62 insertions(+), 76 deletions(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index b4f767a5..04fb4eb7 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -1,91 +1,77 @@ <% if @events_by_day.size >0 %> -
    - -

    - <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> -

    - - <% @events_by_day.keys.sort.reverse.each do |day| %> -
    - <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%> -
    - - - - - -
    <%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> - - - - - - - - - - <% if e.event_type == "issue" %> - - <% end %> - -
    - <%= h(e.project) if @project.nil? || @project.id != e.project.id %> - - <% if @canShowRealName %> - <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>) - <% else %> - <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> - <% end %> +
    +

    + <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> +

    - <%= l(:label_new_activity) %> - - <%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %> -
    -

    - <%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %> -

    <%= l :label_activity_time %>:  <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> <%= link_to l(:label_find_all_comments), issue_path(e) %> <%= l(:label_comments_count, :count => e.journals.count)%>
    -
    - - <% end %> -
    + <% @events_by_day.keys.sort.reverse.each do |day| %> + <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%> +
    +
    + <%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> +
    +
    + <%= h(e.project) if @project.nil? || @project.id != e.project.id %> + + <% if @canShowRealName %> + <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>) + <% else %> + <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> + <% end %> - <% end -%> - + <%= l(:label_new_activity) %> + + <%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %> - -
    - <%end%> +
    + <%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %> +
    +
    + <%= l :label_activity_time %>:  <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> + <% if e.event_type == "issue" %> +
    + <%= link_to l(:label_find_all_comments), issue_path(e) %> <%= l(:label_comments_count, :count => e.journals.count)%> +
    + <% end %> +
    +
    +
    -
    - - - - - -
    <%= image_tag(url_to_avatar(@user), :class => "avatar") %> - - - - - -
    - <% - #判断是否显示真名 - if @canShowRealName - %> - <%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>) - <% else %> - <%= link_to (h @user.try(:name)), user_path(@user) if @user %> - <% end %> - <%= l(:label_user_create_project) %> <%= link_to @project.name %> !
    <%= l :label_update_time %>: <%= format_time(@project.created_on) %> -
    + <% end %> + <% end -%> + <% if(@events_pages.page == @events_pages.last_page) %> +
    +
    + <%= image_tag(url_to_avatar(@user), :class => "avatar") %> +
    +
    + + <% if @canShowRealName %> + <%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>) + <% else %> + <%= link_to (h @user.try(:name)), user_path(@user) if @user %> + <% end %> + <%#= l(:label_new_activity) %> + + <%= l(:label_user_create_project) %> <%= link_to @project.name %> ! +
    +
    +
    + <%= l :label_activity_time %>: <%= format_time(@project.created_on) %> +
    +
    +
    + <% end %>
    +<%end%> + From 470f40db82eb5ae76aeb36b945649590238e421e Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 5 Jul 2014 11:00:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E7=BD=91=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/views/bids/_homework.html.erb | 2 +- app/views/courses/_course.html.erb | 6 +++--- app/views/courses/index.html.erb | 2 +- app/views/courses/search.html.erb | 2 +- app/views/git_usage/ch_usage.html.erb | 4 ++-- app/views/git_usage/en_usage.html.erb | 4 ++-- app/views/layouts/_base_footer.html.erb | 2 +- app/views/layouts/_bootstrap_base_footer.html.erb | 2 +- app/views/mailer/journals_for_message_add.html.erb | 2 +- app/views/projects/search.html.erb | 2 +- app/views/welcome/_link_to_another.html.erb | 6 +++--- config/routes.rb | 2 +- config/settings.yml | 4 ++++ lib/redmine/info.rb | 4 ++-- 15 files changed, 25 insertions(+), 21 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c234eb17..0b2ae02b 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 a013facb..f3578e71 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 80cd7df9..ef8f3756 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 c29903d7..ecc4306f 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 96f8c227..25b45e0d 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 5fca6b15..330ab9b5 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 ce202c79..237895d2 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 ec751668..2fc38344 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 2bda28bd..a2fdd620 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 43c5b9ae..1aa8e45f 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 b1bd3d41..36117e0b 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 bda48e75..14640897 100644 --- a/app/views/welcome/_link_to_another.html.erb +++ b/app/views/welcome/_link_to_another.html.erb @@ -1,6 +1,6 @@
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 8318a239..f9dd53cf 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 f2c64a97..268198d4 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 63c066da..f41e576d 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