From 34fd8a933a624de98533e43b48cfbc1f762ff9cb Mon Sep 17 00:00:00 2001 From: xianbo Date: Fri, 21 Mar 2014 20:25:41 +0800 Subject: [PATCH] fix the show of domain and project page --- app/helpers/application_helper.rb | 4 ++-- app/helpers/welcome_helper.rb | 2 +- app/views/layouts/_base_header.html.erb | 4 ++-- app/views/layouts/base.html.erb | 6 +++++- app/views/welcome/course.html.erb | 2 +- app/views/welcome/index.html.erb | 8 ++++---- config/settings.yml | 8 ++++---- lib/redmine.rb | 24 ++++++++++++------------ 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ab45d8e9a..f8acafc1f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -65,7 +65,7 @@ module ApplicationHelper if user.is_a?(User) name = h(user.name(options[:format])) if user.active? || (User.current.admin? && user.logged?) - link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.forge_domain}, :class => user.css_classes + link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes else name end @@ -1513,7 +1513,7 @@ module ApplicationHelper #@nav_dispaly_project_label nav_list = Array.new - nav_list.push(home_link) + nav_list.push(home_link) nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index a446631d7..ed90dd24f 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -214,7 +214,7 @@ module WelcomeHelper "show_news" => true, "show_bids" => true } - activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' } + activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' } activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'}) end diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 2cb5fafa0..7bdd8a728 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -15,11 +15,11 @@
  • <%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
  • <% end -%>
  • <%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
  • -
  • <%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.forge_domain}%>
  • +
  • <%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
  • - <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.forge_domain }, {:class => 'my-message'} if User.current.logged?%> + <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged?%>
  • diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 421e76050..fcf7d2195 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -13,7 +13,7 @@ @nav_dispaly_bid_label = 1 elsif (realUrl.match(/forums/)) @nav_dispaly_forum_label = 1 - elsif (realUrl.match(/[^projects]\/course[^\.]/)) + elsif (realUrl.match(/[^forge]\/course[^\.]/)) @nav_dispaly_course_label = 1 @nav_dispaly_project_label = 1 @nav_dispaly_contest_label = 1 @@ -21,6 +21,10 @@ @nav_dispaly_course_all_label = 1 @nav_dispaly_teacher_all_label = 1 @nav_dispaly_forum_label = 1 + elsif (realUrl.match(/user\.trustie\.net/)) + @nav_dispaly_project_label = 1 + @nav_dispaly_user_label = 1 + @nav_dispaly_forum_label = 1 elsif (realUrl.match(/forge\.trustie\.net/)) @nav_dispaly_project_label = 1 @nav_dispaly_user_label = 1 diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 517e81f30..734568c7d 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -95,7 +95,7 @@ <%= l(:label_welcome_trustie) %> , <%= l(:label_welcome_trustie_description) %>
    diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index fd539b12f..c9fad6757 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -140,8 +140,8 @@
    -
    +
      -
      +

      贴吧动态

      <%= link_to "更多>>", forums_path %>
      diff --git a/config/settings.yml b/config/settings.yml index 2a50e6cb4..d43d3699b 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -236,11 +236,11 @@ tags_max_length: tags_show_search_results: format: int default: 5 -forge_domain: - default: forge.trustie.net +user_domain: + default: user.trustie.net project_domain: default: forge.trustie.net contest_domain: - default: forge.trustie.net + default: contest.trustie.net course_domain: - default: forge.trustie.net + default: course.trustie.net diff --git a/lib/redmine.rb b/lib/redmine.rb index e5fb39446..3990d10d3 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -203,7 +203,7 @@ Redmine::AccessControl.map do |map| end #by young Redmine::MenuManager.map :top_menu do |menu| - menu.push :home, {:host => Setting.forge_domain} + menu.push :home, {:host => Setting.user_domain} menu.push :course_practice, {:controller => 'projects', :action => 'course', :project_type => 1} menu.push :project_deposit, { :controller => 'projects', :action => 'index', :project_type => 0}, :caption => :label_project_deposit menu.push :software_user, {:controller => 'users', :action => 'index'} @@ -264,7 +264,7 @@ end # end Redmine::MenuManager.map :account_menu do |menu| - menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.forge_domain}, :if => Proc.new { !User.current.logged? } + menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.project_domain}, :if => Proc.new { !User.current.logged? } menu.push :register, {:controller => 'account', :action => 'register'}, :if => Proc.new { !User.current.logged? && Setting.self_registration? } # menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } menu.push :logout, {:controller => 'account', :action => 'logout'}, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? } @@ -341,29 +341,29 @@ Redmine::MenuManager.map :course_menu do |menu| end Redmine::MenuManager.map :user_menu do |menu| - menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain } + menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain } menu.push :user_course, {:controller => 'users', :action => 'user_courses', :host => Setting.course_domain} #menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} # menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang - menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain} + menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain} end Redmine::MenuManager.map :user_enterprise_menu do |menu| - menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain } + menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain } menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain} - menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain} + menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain} + menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain} end Redmine::MenuManager.map :user_menu_self do |menu| - menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain } - menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.forge_domain} - menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.forge_domain} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain} - menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain} + menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.project_domain } + menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.user_domain} + menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} + menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain} + menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain} end #end