Merge pull request #5218 from opf/epic/24656-rework-structure-of-main-navigation-2

[24656] Rework structure of main navigation (Part 2)
pull/5220/head
Oliver Günther 8 years ago committed by GitHub
commit 5cd1f1452a
  1. 38
      app/assets/stylesheets/layout/_top_menu.sass
  2. 6
      app/views/layouts/base.html.erb
  3. 12
      config/initializers/menus.rb
  4. 5
      lib/redmine/menu_manager/top_menu/projects_menu.rb

@ -27,9 +27,11 @@
//++ //++
#logo #logo
float: left @include varprop(width, main-menu-width)
width: $main-menu-width @include varprop(height, header-height)
height: $header-height position: absolute
left: calc(50% - #{$main-menu-width} / 2)
.home-link .home-link
margin-top: 13px margin-top: 13px
display: block display: block
@ -104,11 +106,6 @@
position: relative position: relative
top: 0 top: 0
z-index: 21 z-index: 21
li.last-child > ul,
ul.drop-down--help,
ul.drop-down--modules
left: auto
right: 0
li.drop-down li.drop-down
select select
@ -126,9 +123,6 @@
@include varprop(background-color, header-item-bg-hover-color) @include varprop(background-color, header-item-bg-hover-color)
color: $header-item-font-hover-color color: $header-item-font-hover-color
&:after &:after
@include icon-font-common
font-size: 10px
padding: 0 0 0 9px
@extend .icon-pulldown-up:before @extend .icon-pulldown-up:before
li li
@ -146,6 +140,12 @@
> a:after > a:after
display: none display: none
li.last-child > ul,
.drop-down--help,
.drop-down--modules
left: auto
right: 0
.drop-down--projects .drop-down--projects
> li > li
&:nth-last-child(2) &:nth-last-child(2)
@ -301,6 +301,22 @@ input.top-menu-search--input
> ul > li > ul > li
max-width: 350px max-width: 350px
#account-nav-left
.drop-down
max-width: 230px
#projects-menu
overflow: hidden
text-overflow: ellipsis
padding-right: 34px
font-size: 16px
font-weight: bold
&:after
position: absolute
right: 15px
top: calc(50% - 10px / 2)
#account-nav-right #account-nav-right
.drop-down.last-child .drop-down.last-child
.avatar .avatar

@ -75,9 +75,6 @@ See doc/COPYRIGHT.rdoc for more details.
<% if show_decoration %> <% if show_decoration %>
<div id="top-menu"> <div id="top-menu">
<div id="header"> <div id="header">
<div id="logo">
<%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
</div>
<div id="top-menu-items"> <div id="top-menu-items">
<h1 class="hidden-for-sighted"> <h1 class="hidden-for-sighted">
<%= l(:label_top_menu) %> <%= l(:label_top_menu) %>
@ -88,6 +85,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= render_top_menu_right %> <%= render_top_menu_right %>
</div> </div>
</div> </div>
<div id="logo">
<%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
</div>
</div> </div>
</div> </div>
<% end %> <% end %>

@ -67,18 +67,18 @@ Redmine::MenuManager.map :top_menu do |menu|
end end
Redmine::MenuManager.map :account_menu do |menu| Redmine::MenuManager.map :account_menu do |menu|
menu.push :administration, menu.push :my_page,
{ controller: '/admin', action: 'projects' }, { controller: '/my', action: 'page' },
html: { class: 'hidden-for-mobile' }, html: { class: 'hidden-for-mobile' },
if: Proc.new { User.current.admin? } if: Proc.new { User.current.logged? }
menu.push :my_account, menu.push :my_account,
{ controller: '/my', action: 'account' }, { controller: '/my', action: 'account' },
html: { class: 'hidden-for-mobile' }, html: { class: 'hidden-for-mobile' },
if: Proc.new { User.current.logged? } if: Proc.new { User.current.logged? }
menu.push :my_page, menu.push :administration,
{ controller: '/my', action: 'page' }, { controller: '/admin', action: 'projects' },
html: { class: 'hidden-for-mobile' }, html: { class: 'hidden-for-mobile' },
if: Proc.new { User.current.logged? } if: Proc.new { User.current.admin? }
menu.push :logout, :signout_path, menu.push :logout, :signout_path,
if: Proc.new { User.current.logged? } if: Proc.new { User.current.logged? }
end end

@ -47,9 +47,10 @@ module Redmine::MenuManager::TopMenu::ProjectsMenu
end end
def render_projects_dropdown def render_projects_dropdown
label = @project ? @project.name : t(:label_project_plural)
render_menu_dropdown_with_items( render_menu_dropdown_with_items(
label: l(:label_project_plural), label: label,
label_options: { id: 'projects-menu', class: 'icon3 icon-projects' }, label_options: { id: 'projects-menu' },
items: project_items, items: project_items,
options: { options: {
drop_down_class: 'drop-down--projects' drop_down_class: 'drop-down--projects'

Loading…
Cancel
Save