Merge pull request #5239 from opf/fix/style-improvements-main-navigation

Style improvements for new main navigation
pull/5226/merge
Henriette Dinger 8 years ago committed by GitHub
commit 8273f3fe93
  1. 8
      app/views/layouts/base.html.erb
  2. 2
      config/initializers/menus.rb
  3. 1
      config/locales/en.yml
  4. 4
      features/projects/visibility.feature
  5. 2
      lib/redmine/menu_manager/top_menu/projects_menu.rb
  6. 2
      lib/redmine/menu_manager/top_menu_helper.rb
  7. 4
      spec/views/layouts/base.html.erb_spec.rb

@ -80,15 +80,15 @@ See doc/COPYRIGHT.rdoc for more details.
<%= l(:label_top_menu) %>
</h1>
<%= render_top_menu_left %>
<div id="logo" class="hidden-for-mobile">
<%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
</div>
<%= call_hook :view_layouts_base_top_menu %>
<div class="top-menu-items-right">
<%= render partial: 'search/mini_form' %>
<%= render_top_menu_right %>
</div>
</div>
<div id="logo">
<%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
</div>
<%= call_hook :view_layouts_base_top_menu %>
</div>
</div>
<% end %>

@ -213,7 +213,7 @@ end
Redmine::MenuManager.map :project_menu do |menu|
menu.push :overview,
{ controller: '/projects', action: 'show' },
html: { class: 'icon2 icon-show-all-projects' }
html: { class: 'icon2 icon-info1' }
menu.push :activity,
{ controller: '/activities', action: 'index' },

@ -991,6 +991,7 @@ en:
label_category: "Category"
label_wiki_menu_item: Wiki menu item
label_select_main_menu_item: Select new main menu item
label_select_project: "Select a project"
label_required_disk_storage: "Required disk storage"
label_resend_invitation: Resend invitation
label_change_plural: "Changes"

@ -35,11 +35,11 @@ Feature: Project Visibility
Scenario: A Project is visible on the landing page if it is set to public
Given I am on the login page
Then I should see "Projects" within "#top-menu-items"
Then I should see "Select a project" within "#top-menu-items"
When I go to the overall Projects page
Then I should see "Bob's Accounting" within "#content"
Scenario: Project is not visible on the landing page if it is not set to public
Given the project "Bob's Accounting" is not public
And I am on the login page
Then I should not see "Projects" within "#top-menu-items"
Then I should not see "Select a project" within "#top-menu-items"

@ -47,7 +47,7 @@ module Redmine::MenuManager::TopMenu::ProjectsMenu
end
def render_projects_dropdown
label = @project ? @project.name : t(:label_project_plural)
label = @project ? @project.name : t(:label_select_project)
render_menu_dropdown_with_items(
label: label,
label_options: { id: 'projects-menu' },

@ -33,7 +33,7 @@ module Redmine::MenuManager::TopMenuHelper
include Redmine::MenuManager::TopMenu::ProjectsMenu
def render_top_menu_left
content_tag :ul, id: 'account-nav-left', class: 'menu_root account-nav hidden-for-mobile' do
content_tag :ul, id: 'account-nav-left', class: 'menu_root account-nav' do
[render_main_top_menu_nodes,
render_projects_top_menu_node].join.html_safe
end

@ -56,7 +56,7 @@ describe 'layouts/base', type: :view do
end
it 'the projects menu should not be displayed' do
expect(rendered).not_to have_text('Projects')
expect(rendered).not_to have_text('Select a project')
end
end
@ -68,7 +68,7 @@ describe 'layouts/base', type: :view do
end
it 'the projects menu should be displayed' do
expect(rendered).to have_text('Projects')
expect(rendered).to have_text('Select a project')
end
end
end

Loading…
Cancel
Save