From ce9b941a4cb9d97ff7a10b23b4764f33a6afa071 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Fri, 27 Sep 2019 01:18:42 +0300 Subject: [PATCH] wip --- app/views/layouts/base.html.erb | 81 ++++++++++++------ lib/redmine/menu_manager.rb | 10 ++- public/javascripts/application.js | 4 +- public/stylesheets/application.css | 127 +++++++++++++++++++++-------- 4 files changed, 156 insertions(+), 66 deletions(-) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 42819c1fb..56b42aa28 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -60,46 +60,75 @@
-
-
- <%= render_menu :account_menu -%> -
- <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> +
+ + + diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index eb40141c1..ac83b2b2c 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -110,12 +110,14 @@ module Redmine menu_name.present? && Redmine::MenuManager.items(menu_name).children.present? end - def render_menu(menu, project=nil) + def render_menu(menu, project=nil, options={}) links = [] menu_items_for(menu, project) do |node| links << render_menu_node(node, project) end - links.empty? ? nil : content_tag('ul', links.join.html_safe) + default_options = {:class => 'nav-list'} + options = default_options.merge(options) + links.empty? ? nil : content_tag('ul', links.join.html_safe, options) end def render_menu_node(node, project=nil) @@ -124,7 +126,7 @@ module Redmine else caption, url, selected = extract_node_details(node, project) return content_tag('li', - render_single_menu_node(node, caption, url, selected)) + render_single_menu_node(node, caption, url, selected), :class => 'nav-item') end end @@ -132,7 +134,7 @@ module Redmine caption, url, selected = extract_node_details(node, project) html = [].tap do |html| - html << '
  • ' + html << '