Skip to content
Snippets Groups Projects
Commit a521e88f authored by Nicolas Koenig's avatar Nicolas Koenig
Browse files

Fix consistency issue in sidebars of Project and Group Settings.

Fixes #2277.
parent c465af09
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
- page_title "Settings"
.panel.panel-default
.panel-heading
%strong= @group.name
Loading
Loading
- 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"
Loading
Loading
@@ -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')
Loading
Loading
@@ -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')
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment