Skip to content

Commit 784866a

Browse files
committed
Enhance event action buttons with icons for better user experience
1 parent 3de8454 commit 784866a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

app/views/better_together/events/show.html.erb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
destroy_path: policy(@resource).destroy? ? event_path(@resource) : nil,
3636
destroy_confirm: t('globals.confirm_delete'),
3737
destroy_aria_label: 'Delete Record' do %>
38-
<%= link_to t('better_together.events.add_to_calendar', default: 'Add to calendar (.ics)'), ics_event_path(@event), class: 'btn btn-outline-secondary btn-sm' if policy(@event).ics? %>
38+
<% if policy(@event).ics? %>
39+
<%= link_to ics_event_path(@event), class: 'btn btn-outline-secondary btn-sm' do %>
40+
<i class="fas fa-calendar-plus me-2" aria-hidden="true"></i><%= t('better_together.events.add_to_calendar', default: 'Add to calendar (.ics)') %>
41+
<% end %>
42+
<% end %>
3943
<% end %>
4044
</div>
4145
</div>
@@ -50,10 +54,16 @@
5054
<% attendance = BetterTogether::EventAttendance.find_by(event: @event, person: current_person) %>
5155
<div class="container my-3">
5256
<div class="d-flex gap-2">
53-
<%= button_to t('better_together.events.rsvp_interested', default: 'Interested'), rsvp_interested_event_path(@event), method: :post, class: "btn btn-outline-primary #{'active' if attendance&.status == 'interested'}" %>
54-
<%= button_to t('better_together.events.rsvp_going', default: 'Going'), rsvp_going_event_path(@event), method: :post, class: "btn btn-primary #{'active' if attendance&.status == 'going'}" %>
57+
<%= button_to rsvp_interested_event_path(@event), method: :post, class: "btn btn-outline-primary #{'active' if attendance&.status == 'interested'}" do %>
58+
<i class="fas fa-heart me-2" aria-hidden="true"></i><%= t('better_together.events.rsvp_interested', default: 'Interested') %>
59+
<% end %>
60+
<%= button_to rsvp_going_event_path(@event), method: :post, class: "btn btn-primary #{'active' if attendance&.status == 'going'}" do %>
61+
<i class="fas fa-check me-2" aria-hidden="true"></i><%= t('better_together.events.rsvp_going', default: 'Going') %>
62+
<% end %>
5563
<% if attendance %>
56-
<%= button_to t('better_together.events.rsvp_cancel', default: 'Cancel RSVP'), rsvp_cancel_event_path(@event), method: :delete, class: 'btn btn-outline-danger' %>
64+
<%= button_to rsvp_cancel_event_path(@event), method: :delete, class: 'btn btn-outline-danger' do %>
65+
<i class="fas fa-times me-2" aria-hidden="true"></i><%= t('better_together.events.rsvp_cancel', default: 'Cancel RSVP') %>
66+
<% end %>
5767
<% end %>
5868
</div>
5969
<div class="text-muted mt-2">

0 commit comments

Comments
 (0)