From c5d998528fedb6652074c06132cabd9435a4d5be Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 12 Feb 2008 17:58:46 +0000 Subject: [PATCH] The following menus can now be extended by plugins: top_menu, account_menu, application_menu (empty by default). Sligth layout change: links in the top menu are now li elements. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1137 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 8 ------- app/views/layouts/base.rhtml | 16 +++---------- config/routes.rb | 4 +++- lib/redmine.rb | 32 ++++++++++++++++++++------ lib/redmine/menu_manager.rb | 36 +++++++++++++++++++++--------- public/stylesheets/application.css | 10 +++++++++ 6 files changed, 66 insertions(+), 40 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 791c6d806..abe76c797 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,14 +31,6 @@ module ApplicationHelper def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference) link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action]) end - - def link_to_signin - link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => 'signin' - end - - def link_to_signout - link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => 'logout' - end # Display a link to user's account page def link_to_user(user) diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 1f7472006..820a8e700 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -21,20 +21,10 @@
- <% if User.current.logged? %> - <%=l(:label_logged_as)%> <%= User.current.login %> - - <%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => 'myaccount' %> - <%= link_to_signout %> - <% else %> - <%= link_to_signin %> - <%= link_to(l(:label_register), { :controller => 'account',:action => 'register' }, :class => 'register') if Setting.self_registration? %> - <% end %> + <%= render_menu :account_menu -%>
- <%= link_to l(:label_home), home_url, :class => 'home' %> - <%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => 'mypage' if User.current.logged? %> - <%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => 'projects' %> - <%= link_to l(:label_administration), { :controller => 'admin' }, :class => 'admin' if User.current.admin? %> - <%= link_to l(:label_help), Redmine::Info.help_url, :class => 'help' %> + <%= content_tag('div', "#{l(:label_logged_as)} #{User.current.login}", :id => 'loggedas') if User.current.logged? %> + <%= render_menu :top_menu -%>