BigW Consortium Gitlab

_group_settings.html.haml 1.14 KB
Newer Older
1
- if current_user
Phil Hughes committed
2
  - can_admin_group = can?(current_user, :admin_group, @group)
3
  - can_edit = can?(current_user, :admin_group, @group)
4
  - member = @group.members.find_by(user_id: current_user.id)
5 6
  - can_leave = member && can?(current_user, :destroy_group_member, member)

Phil Hughes committed
7
  - if can_admin_group || can_edit || can_leave
8 9 10 11 12 13
    .controls
      .dropdown.group-settings-dropdown
        %a.dropdown-new.btn.btn-default#group-settings-button{href: '#', 'data-toggle' => 'dropdown'}
          = icon('cog')
          = icon('caret-down')
        %ul.dropdown-menu.dropdown-menu-align-right
Phil Hughes committed
14
          - if can_admin_group
15 16 17 18 19 20 21 22 23 24 25 26
            = nav_link(path: 'groups#projects') do
              = link_to 'Projects', projects_group_path(@group), title: 'Projects'
          - if can_edit || can_leave
            %li.divider
          - if can_edit
            %li
              = link_to 'Edit Group', edit_group_path(@group)
          - if can_leave
            %li
              = link_to polymorphic_path([:leave, @group, :members]),
                data: { confirm: leave_confirmation_message(@group) }, method: :delete, title: 'Leave group' do
                Leave Group