summaryrefslogtreecommitdiff
path: root/app/views/groups/group_members/index.html.haml
blob: 106a7832cc7fcf7399bf3b204b2fac35219745f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
- add_page_specific_style 'page_bundles/members'
- page_title _('Group members')
- can_manage_members = can?(current_user, :admin_group_member, @group)
- show_invited_members = can_manage_members && @invited_members.exists?
- show_access_requests = can_manage_members && @requesters.exists?
- invited_active = params[:search_invited].present? || params[:invited_members_page].present?

.js-remove-member-modal
.row.gl-mt-3
  .col-lg-12
    .gl-display-flex.gl-flex-wrap
      - if can_manage_members
        .gl-w-half.gl-xs-w-full
          %h4
            = _('Group members')
          %p
            = html_escape(_('You can invite a new member to %{strong_start}%{group_name}%{strong_end}.')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
        - if can_invite_members_for_group?(@group)
          .gl-w-half.gl-xs-w-full
            .gl-display-flex.gl-flex-wrap.gl-justify-content-end.gl-mb-3
              .js-invite-group-trigger{ data: { classes: 'gl-mt-3 gl-sm-w-auto gl-w-full', display_text: _('Invite a group') } }
              .js-invite-members-trigger{ data: { variant: 'success', classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite members') } }
          = render 'groups/invite_members_modal', group: @group
    - if can_manage_members && !can_invite_members_for_group?(@group)
      %hr.gl-mt-4
        %ul.nav-links.nav.nav-tabs.gitlab-tabs{ role: 'tablist' }
          %li.nav-tab{ role: 'presentation' }
            %a.nav-link.active{ href: '#invite-member-pane', id: 'invite-member-tab', data: { toggle: 'tab' }, role: 'tab' }= _('Invite member')
            %li.nav-tab{ role: 'presentation' }
              %a.nav-link{ href: '#invite-group-pane', id: 'invite-group-tab', data: { toggle: 'tab', qa_selector: 'invite_group_tab' }, role: 'tab' }= _('Invite group')
        .tab-content.gitlab-tab-content
          .tab-pane.active{ id: 'invite-member-pane', role: 'tabpanel' }
            = render_invite_member_for_group(@group, @group_member.access_level)
          .tab-pane{ id: 'invite-group-pane', role: 'tabpanel' }
            = render 'shared/members/invite_group', submit_url: group_group_links_path(@group), access_levels: GroupMember.access_level_roles, default_access_level: @group_member.access_level, group_link_field: 'shared_with_group_id', group_access_field: 'shared_group_access'

    = render_if_exists 'groups/group_members/ldap_sync'

    %ul.nav-links.mobile-separator.nav.nav-tabs
      %li.nav-item
        = link_to '#tab-members', class: ['nav-link', ('active' unless invited_active)], data: { toggle: 'tab' } do
          %span
            = _('Members')
          %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= @members.total_count
      - if @group.shared_with_group_links.any?
        %li.nav-item
          = link_to '#tab-groups', class: ['nav-link'] , data: { toggle: 'tab', qa_selector: 'groups_list_tab' } do
            %span
              = _('Groups')
            %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= @group.shared_with_group_links.count
      - if show_invited_members
        %li.nav-item
          = link_to '#tab-invited-members', class: ['nav-link', ('active' if invited_active)], data: { toggle: 'tab' } do
            %span
              = _('Invited')
            %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= @invited_members.total_count
      - if show_access_requests
        %li.nav-item
          = link_to '#tab-access-requests', class: 'nav-link', data: { toggle: 'tab' } do
            %span
              = _('Access requests')
            %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= @requesters.count
    .tab-content
      #tab-members.tab-pane{ class: ('active' unless invited_active) }
        .js-group-members-list{ data: group_members_list_data_attributes(@group, @members) }
          .loading
            .spinner.spinner-md
        = paginate @members, theme: 'gitlab', params: { invited_members_page: nil, search_invited: nil }
      - if @group.shared_with_group_links.any?
        #tab-groups.tab-pane
          .js-group-group-links-list{ data: group_group_links_list_data_attributes(@group) }
            .loading
              .spinner.spinner-md
      - if show_invited_members
        #tab-invited-members.tab-pane{ class: ('active' if invited_active) }
          .js-group-invited-members-list{ data: group_members_list_data_attributes(@group, @invited_members) }
            .loading
              .spinner.spinner-md
          = paginate @invited_members, param_name: 'invited_members_page', theme: 'gitlab', params: { page: nil }
      - if show_access_requests
        #tab-access-requests.tab-pane
          .js-group-access-requests-list{ data: group_members_list_data_attributes(@group, @requesters) }
            .loading
              .spinner.spinner-md