Show total member count

This commit is contained in:
Stan Hu 2019-05-22 22:34:31 -07:00 committed by George Tsiolis
parent ed29ce3622
commit e26139a756

View file

@ -1,6 +1,8 @@
- page_title "Members" - page_title "Members"
- can_manage_members = can?(current_user, :admin_group_member, @group) - can_manage_members = can?(current_user, :admin_group_member, @group)
- show_invited_members = can_manage_members && @invited_members.exists? - show_invited_members = can_manage_members && @invited_members.exists?
- total_members = @members.total_count
- total_members += @invited_members.total_count if show_invited_members
.project-members-page.prepend-top-default .project-members-page.prepend-top-default
%h4 %h4
@ -19,10 +21,16 @@
%ul.nav-links.mobile-separator.nav.nav-tabs.clearfix %ul.nav-links.mobile-separator.nav.nav-tabs.clearfix
%li.nav-item %li.nav-item
= link_to "Existing members", "#existing_members", class: "nav-link active", 'data-toggle' => 'tab' = link_to "#existing_members", class: "nav-link active", 'data-toggle' => 'tab' do
%span
Existing members
%span.badge.badge-pill= @members.total_count
- if show_invited_members - if show_invited_members
%li.nav-item %li.nav-item
= link_to "Invited members", "#invited_members", class: "nav-link", 'data-toggle' => 'tab' = link_to "#invited_members", class: "nav-link", 'data-toggle' => 'tab' do
%span
Pending
%span.badge.badge-pill= @invited_members.total_count
.tab-content .tab-content
#existing_members.tab-pane.active #existing_members.tab-pane.active
@ -31,7 +39,7 @@
%span.flex-project-title %span.flex-project-title
Members with access to Members with access to
%strong= @group.name %strong= @group.name
%span.badge.badge-pill= @members.total_count %span.badge.badge-pill= total_members
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
.position-relative.append-right-8 .position-relative.append-right-8
@ -50,9 +58,9 @@
.card .card
.card-header.flex-project-members-panel .card-header.flex-project-members-panel
%span.flex-project-title %span.flex-project-title
Pending members to Members with access to
%strong= @group.name %strong= @group.name
%span.badge.badge-pill= @invited_members.total_count %span.badge.badge-pill= total_members
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
.position-relative.append-right-8 .position-relative.append-right-8