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

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

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

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

Loading…
Cancel
Save