Commit 27ae0684 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dz-refactor-group-subnav' into 'master'

Move group settings navigation to own partial

A bit of refactoring for !3980
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !4076
parents 50b89cd9 64ef2e08
- if current_user = render 'layouts/nav/group_settings'
- if access = @group.users.find_by(id: current_user.id)
.controls
%span.dropdown.group-settings-dropdown
%a.dropdown-new.btn.btn-gray#group-settings-button{href: '#', 'data-toggle' => 'dropdown'}
= icon('cog')
= icon('caret-down')
%ul.dropdown-menu.dropdown-menu-align-right
- if can?(current_user, :admin_group, @group)
= nav_link(path: 'groups#projects') do
= link_to projects_group_path(@group), title: 'Projects' do
Projects
%li.divider
%li
= link_to edit_group_path(@group) do
Edit Group
%li
= link_to leave_group_group_members_path(@group),
data: { confirm: leave_group_message(@group.name) }, method: :delete, title: 'Leave group' do
Leave Group
%ul.nav-links %ul.nav-links
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
......
%ul.nav.nav-sidebar - if current_user
= nav_link do - if access = @group.users.find_by(id: current_user.id)
= link_to group_path(@group), title: 'Go to group', class: 'back-link' do .controls
= icon('caret-square-o-left fw') %span.dropdown.group-settings-dropdown
%span %a.dropdown-new.btn.btn-gray#group-settings-button{href: '#', 'data-toggle' => 'dropdown'}
Go to group = icon('cog')
= icon('caret-down')
%li.separate-item %ul.dropdown-menu.dropdown-menu-align-right
- if can?(current_user, :admin_group, @group)
%ul.sidebar-subnav = nav_link(path: 'groups#projects') do
= nav_link(path: 'groups#edit') do = link_to projects_group_path(@group), title: 'Projects' do
= link_to edit_group_path(@group), title: 'Group Settings' do Projects
= icon ('pencil-square-o fw') %li.divider
%span %li
Group Settings = link_to edit_group_path(@group) do
= nav_link(path: 'groups#projects') do Edit Group
= link_to projects_group_path(@group), title: 'Projects' do %li
= icon('folder fw') = link_to leave_group_group_members_path(@group),
%span data: { confirm: leave_group_message(@group.name) }, method: :delete, title: 'Leave group' do
Projects Leave Group
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