|
49 | 49 | <%= content_tag :div, id: 'communityTabs', class: 'nav nav-tabs card-header-tabs', role: 'tablist', aria_label: 'Community Sections' do %> |
50 | 50 | <%= link_to t('globals.tabs.about'), '#about', class: 'nav-link active', id: 'about-tab', data: { bs_toggle: 'tab', bs_target: '#about', bs_parent: '#profileSections' }, role: 'tab', aria_controls: 'about', aria_selected: 'true', tabindex: '0' %> |
51 | 51 | <%= link_to t('globals.tabs.members'), '#members', class: 'nav-link', id: 'members-tab', data: { bs_toggle: 'tab', bs_target: '#members', bs_parent: '#communitySections' }, role: 'tab', aria_controls: 'members', aria_selected: 'false', tabindex: '-1' %> |
| 52 | + <%= link_to t('globals.tabs.events'), '#events', class: 'nav-link', id: 'events-tab', data: { bs_toggle: 'tab', bs_target: '#events', bs_parent: '#profileSections' }, role: 'tab', aria_controls: 'events', aria_selected: 'true', tabindex: '0' %> |
52 | 53 | <% end %> |
53 | 54 | </div> |
54 | 55 |
|
55 | 56 | <%# Accordion content with accessible attributes and flexbox layout %> |
56 | 57 | <div class="card-body" id="communitySections" role="tabpanel"> |
57 | 58 | <!-- Person About Section --> |
58 | | - <section id="about" class="row collapse show" aria-labelledby="about-tab" aria-expanded="true" data-bs-parent="#platformTabs"> |
| 59 | + <section id="about" class="row collapse show" aria-labelledby="about-tab" aria-expanded="true" data-bs-parent="#communityTabs"> |
59 | 60 | <div class="col-md-12"> |
60 | 61 | <!-- Name Section --> |
61 | 62 | <h2 class="card-title profile-name text-center mb-3"> |
|
121 | 122 | <%= render partial: 'better_together/person_community_memberships/person_community_membership_member', collection: @resource.person_community_memberships, as: :membership %> |
122 | 123 | </div> |
123 | 124 | </div> |
| 125 | + |
| 126 | + <div id="events" class="collapse" aria-labelledby="events-tab" aria-expanded="true" data-bs-parent="#communityTabs"> |
| 127 | + <% if policy(@resource).create_events? %> |
| 128 | + <%= link_to t('.create_event', default: 'Create an Event'), new_event_path(host_id: @resource.id, host_type: resource_class), class: 'btn btn-primary' %> |
| 129 | + <% end %> |
| 130 | + <div id="events_list" class="mt-3 row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4"> |
| 131 | + <%= render(policy_scope(@resource.hosted_events)) || render('better_together/events/none') %> |
| 132 | + </div> |
| 133 | + </div> |
124 | 134 | </div> |
125 | 135 | </section> |
126 | 136 | </div> |
|
0 commit comments