add diff url in navigation

This commit is contained in:
xianbo 2014-03-20 10:10:22 +08:00
parent 0b016e7c11
commit 3f55e78f49
3 changed files with 30 additions and 30 deletions

View File

@ -65,7 +65,7 @@ module ApplicationHelper
if user.is_a?(User) if user.is_a?(User)
name = h(user.name(options[:format])) name = h(user.name(options[:format]))
if user.active? || (User.current.admin? && user.logged?) 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 else
name name
end end
@ -1500,16 +1500,16 @@ module ApplicationHelper
end end
def render_dynamic_nav def render_dynamic_nav
home_link = link_to l(:field_homepage), home_path 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_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'} 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} 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} 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'} 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'} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_project_module_forums), forums_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), stores_path stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index', :host => Setting.forge_domain}
#@nav_dispaly_project_label #@nav_dispaly_project_label
nav_list = Array.new nav_list = Array.new

View File

@ -12,14 +12,14 @@
<%=link_to_user(User.current)%> <%=link_to_user(User.current)%>
<ul class="sub_menu"> <ul class="sub_menu">
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%> <% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<li><%=link_to l(:label_my_course), user_courses_user_path(User.current) %></li> <li><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %></li>
<% end -%> <% end -%>
<li><%=link_to l(:label_my_projects), user_projects_user_path(User.current) %></li> <li><%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %></li>
<li><%=link_to l(:label_user_edit), my_account_path %></li> <li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.forge_domain}%></li>
</ul> </ul>
</li> </li>
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;"> <li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
<%=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?%>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -203,7 +203,7 @@ Redmine::AccessControl.map do |map|
end end
#by young #by young
Redmine::MenuManager.map :top_menu do |menu| 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 :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 :project_deposit, { :controller => 'projects', :action => 'index', :project_type => 0}, :caption => :label_project_deposit
menu.push :software_user, {:controller => 'users', :action => 'index'} menu.push :software_user, {:controller => 'users', :action => 'index'}
@ -264,15 +264,15 @@ end
# end # end
Redmine::MenuManager.map :account_menu do |menu| Redmine::MenuManager.map :account_menu do |menu|
menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.forge_domain}, :if => Proc.new { !User.current.logged? }
menu.push :register, :register_path, :if => Proc.new { !User.current.logged? && Setting.self_registration? } 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 :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 end
########fq ########fq
Redmine::MenuManager.map :bid_menu do |menu| Redmine::MenuManager.map :bid_menu do |menu|
menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response 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' }, # menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p } # :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
end end
@ -341,29 +341,29 @@ Redmine::MenuManager.map :course_menu do |menu|
end end
Redmine::MenuManager.map :user_menu do |menu| Redmine::MenuManager.map :user_menu do |menu|
menu.push :activity, {:controller => 'users', :action => 'show' } menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain }
menu.push :user_course, {:controller => 'users', :action => 'user_courses'} 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_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 :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 end
Redmine::MenuManager.map :user_enterprise_menu do |menu| 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 :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain}
end end
Redmine::MenuManager.map :user_menu_self do |menu| Redmine::MenuManager.map :user_menu_self do |menu|
menu.push :activity, {:controller => 'users', :action => 'show' } menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain }
menu.push :user_information, {:controller => 'users', :action => 'info'} menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.forge_domain}
menu.push :user_project, {:controller => 'users', :action => 'user_projects'} menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.forge_domain}
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain}
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain}
end end
#end #end