Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/views/admin/chapters/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@

.card.border-info.my-4.my-md-0.my-lg-4.ms-md-4.ms-lg-0
.card-body
%ul.nav.flex-column.ms-0.mb-0
%ul.nav.flex-column.ms-0.mb-2
- @groups.each do |group|
%li.nav-item
= link_to [ :admin, group ], class: 'nav-link' do
#{group.name} (#{group.eligible_members.count} eligible, #{group.members.count} total)
%li.nav-item
= link_to admin_chapter_members_path(@chapter, type: group.name.downcase), class: 'nav-link' do
View #{group.name} emails
%ul.nav.flex-column.ms-0.mb-0
%li.nav-item
= link_to 'View all sponsors', admin_sponsors_path, class: 'nav-link'
%li.nav-item
= link_to 'View all workshops', admin_chapter_workshops_path(@chapter), class: 'nav-link'
.alert.alert-info.mt-2.mb-0
%strong= t('admin.groups.eligible_title')
= simple_format(t('admin.groups.eligible_help'))

- if @how_you_found_us.data_present?
.card.border-info.my-4.my-md-0.my-lg-4.ms-md-4.ms-lg-0
Expand Down
7 changes: 6 additions & 1 deletion app/views/admin/groups/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

.row
.col
%h3.mb-3 Members (#{@eligible_count} eligible, #{@total_count} total)
%h3.mb-3
Members
%small (#{@eligible_count} eligible, #{@total_count} total)
.alert.alert-info.mt-2
%strong= t('admin.groups.eligible_title')
= simple_format(t('admin.groups.eligible_help'))

.row.mb-4
.col-12.col-md-6
Expand Down
9 changes: 9 additions & 0 deletions config/locales/admin.en.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
en:
admin:
groups:
eligible_title: "What is \"eligible\"?"
eligible_help: |
Eligible members are those who:
1. Have accepted the codebar Terms & Conditions
2. Are not banned from the platform

Members who haven't accepted T&C or are banned do not receive invitations and cannot RSVP to workshops.

shared:
workshops: Workshops
events: Events
Expand Down
15 changes: 15 additions & 0 deletions spec/features/admin/chapters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,19 @@
expect(page).not_to have_content('How members found this chapter')
end
end

context 'eligible members tooltip' do
let(:chapter) { Fabricate(:chapter_with_groups) }

before do
login_as_admin(member)
end

scenario 'shows explanation for eligible members' do
visit admin_chapter_path(chapter)

expect(page).to have_content('What is "eligible"?')
expect(page).to have_content(/Are not banned/i)
end
end
end
17 changes: 17 additions & 0 deletions spec/features/admin/groups_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,21 @@
expect(page).to have_content('Group Students for chapter Brighton has been successfully created')
end
end

context '#show page' do
let(:member) { Fabricate(:member) }
let(:chapter) { Fabricate(:chapter, name: 'Brighton') }
let(:group) { Fabricate(:group, chapter: chapter, name: 'Students') }

before do
login_as_admin(member)
end

scenario 'shows explanation for eligible members' do
visit admin_group_path(group)

expect(page).to have_content('What is "eligible"?')
expect(page).to have_content(/Are not banned/i)
end
end
end