From 3f55e78f4914b1951e2aea95a36bfd74dd4c93b5 Mon Sep 17 00:00:00 2001 From: xianbo Date: Thu, 20 Mar 2014 10:10:22 +0800 Subject: [PATCH] add diff url in navigation --- app/helpers/application_helper.rb | 16 +++++------ app/views/layouts/_base_header.html.erb | 8 +++--- lib/redmine.rb | 36 ++++++++++++------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bbd2ea015..7863ead1e 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, user_path(user), :class => user.css_classes + link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.forge_domain}, :class => user.css_classes else name end @@ -1500,16 +1500,16 @@ module ApplicationHelper end def render_dynamic_nav - home_link = link_to l(:field_homepage), home_path - course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1} + home_link = link_to l(:field_homepage), "http://"+Setting.forge_domain+":3000" + course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1,} course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher'} - courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1} - projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0} + courses_link = link_to l(:label_course_practice), {:host=>Setting.course_domain} + projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain} users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index'} - contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1} + contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1, :host=>Setting.contest_domain} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} - forum_link = link_to l(:label_project_module_forums), forums_path - stores_link = link_to l(:label_stores_index), stores_path + forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index", :host => Setting.forge_domain} + stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index', :host => Setting.forge_domain} #@nav_dispaly_project_label nav_list = Array.new diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index d8287a59d..2cb5fafa0 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -12,14 +12,14 @@ <%=link_to_user(User.current)%>
  • - <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id }, {: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.forge_domain }, {:class => 'my-message'} if User.current.logged?%>
  • diff --git a/lib/redmine.rb b/lib/redmine.rb index da4c436ec..7f437d5cb 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, :home_path + menu.push :home, {:hsot => Setting.forge_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,15 +264,15 @@ end # end Redmine::MenuManager.map :account_menu do |menu| - menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } - menu.push :register, :register_path, :if => Proc.new { !User.current.logged? && Setting.self_registration? } + menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.forge_domain}, :if => Proc.new { !User.current.logged? } + menu.push :register, {:controller => 'account', :action => 'register', :host => Setting.forge_domain}, :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, :signout_path, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? } + menu.push :logout, {:controller => 'account', :action => 'logout', :host => Setting.forge_domain}, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? } end ########fq Redmine::MenuManager.map :bid_menu do |menu| menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response - menu.push :project, { :controller => 'bids', :action => 'show_project' }, :caption => :label_bidding_project + menu.push :project, { :controller => 'bids', :action => 'show_project', :host => Setting.project_domain }, :caption => :label_bidding_project # menu.push :result, { :controller => 'bids', :action => 'show_results' }, # :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p } end @@ -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' } - menu.push :user_course, {:controller => 'users', :action => 'user_courses'} + menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_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'} + 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'} + menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain} end Redmine::MenuManager.map :user_enterprise_menu do |menu| - menu.push :activity, {:controller => 'users', :action => 'show' } + menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain } - menu.push :user_project, {:controller => 'users', :action => 'user_projects'} + menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} - menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} + 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} end Redmine::MenuManager.map :user_menu_self do |menu| - menu.push :activity, {:controller => 'users', :action => 'show' } - menu.push :user_information, {:controller => 'users', :action => 'info'} - menu.push :user_project, {:controller => 'users', :action => 'user_projects'} - menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} - menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} + 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} end #end