Commit 690aafeb authored by Douwe Maan's avatar Douwe Maan

Merge branch 'group_settings_nav' into 'master'

Fix consistency issue in sidebars of Project and Group Settings.

Fixes #2277

![before_after_group_settings_nav](https://dev.gitlab.org/gitlab/gitlabhq/uploads/370c701d0eff8f1f8e44cf954c75f2bf/before_after_group_settings_nav.png)

See merge request !1871
parents b096374d a521e88f
......@@ -121,6 +121,8 @@ class GroupsController < Groups::ApplicationController
def determine_layout
if [:new, :create].include?(action_name.to_sym)
'application'
elsif [:edit, :update, :projects].include?(action_name.to_sym)
'group_settings'
else
'group'
end
......
......@@ -19,14 +19,6 @@ module GroupsHelper
end
end
def group_settings_page?
if current_controller?('groups')
current_action?('edit') || current_action?('projects')
else
false
end
end
def group_icon(group)
if group.is_a?(String)
group = Group.find_by(path: group)
......
- page_title "Settings"
.panel.panel-default
.panel-heading
%strong= @group.name
......
- page_title @group.name
- header_title @group.name, group_path(@group)
- sidebar "group"
- sidebar "group" unless sidebar
= render template: "layouts/application"
- page_title "Settings"
- sidebar "group_settings"
= render template: "layouts/group"
......@@ -29,25 +29,9 @@
= icon('users fw')
%span
Members
- if can?(current_user, :admin_group, @group)
= nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
= link_to edit_group_path(@group), title: 'Settings', class: 'tab no-highlight', data: {placement: 'right'} do
= nav_link(html_options: { class: "separate-item" }) do
= link_to edit_group_path(@group), title: 'Settings', data: {placement: 'right'} do
= icon ('cogs fw')
%span
Settings
= icon ('angle-down fw')
- if group_settings_page?
%ul.sidebar-subnav
= nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group), title: 'Group', data: {placement: 'right'} do
= icon('pencil-square-o')
%span
Group Settings
= nav_link(path: 'groups#projects') do
= link_to projects_group_path(@group), title: 'Projects', data: {placement: 'right'} do
= icon('folder')
%span
Projects
%ul.nav.nav-sidebar
= nav_link do
= link_to group_path(@group), title: 'Back to group', data: {placement: 'right'} do
= icon('caret-square-o-left fw')
%span
Back to group
%li.separate-item
%ul.sidebar-subnav
= nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group), title: 'Group Settings', data: {placement: 'right'} do
= icon ('pencil-square-o fw')
%span
Group Settings
= nav_link(path: 'groups#projects') do
= link_to projects_group_path(@group), title: 'Projects', data: {placement: 'right'} do
= icon('folder fw')
%span
Projects
%ul.project-navigation.nav.nav-sidebar
%ul.nav.nav-sidebar
= nav_link(path: 'projects#show', html_options: {class: 'home'}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project', data: {placement: 'right'} do
= icon('dashboard fw')
......@@ -86,7 +86,7 @@
- if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
= link_to edit_project_path(@project), title: 'Settings', class: 'stat-tab tab no-highlight', data: {placement: 'right'} do
= link_to edit_project_path(@project), title: 'Settings', data: {placement: 'right'} do
= icon('cogs fw')
%span
Settings
%ul.project-navigation.nav.nav-sidebar
%ul.nav.nav-sidebar
= nav_link do
= link_to project_path(@project), title: 'Back to project', data: {placement: 'right'} do
= icon('caret-square-o-left fw')
......@@ -7,9 +7,9 @@
%li.separate-item
%ul.project-settings-nav.sidebar-subnav
%ul.sidebar-subnav
= nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do
= link_to edit_project_path(@project), title: 'Project Settings', data: {placement: 'right'} do
= icon('pencil-square-o fw')
%span
Project Settings
......@@ -32,5 +32,5 @@
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do
= icon('lock fw')
%span
Protected branches
Protected Branches
......@@ -20,8 +20,8 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
end
step 'I click the "Edit" tab' do
page.within '.project-settings-nav' do
click_link('Project')
page.within '.sidebar-subnav' do
click_link('Project Settings')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment