2024-07-04 16:20:12 -04:00
|
|
|
<% content_for :title, "Notifications" %>
|
2024-07-04 17:00:07 -04:00
|
|
|
<div class="flex flex-col items-center w-full">
|
|
|
|
|
<div class="text-center mb-6">
|
|
|
|
|
<h1 class="font-bold text-4xl mb-4">Notifications</h1>
|
|
|
|
|
<div class="flex items-center justify-center mb-4">
|
2024-09-08 10:52:35 -04:00
|
|
|
<% if @notifications.unread.any? %>
|
2024-12-15 11:28:59 -05:00
|
|
|
<%= link_to "Mark all as read", mark_notifications_as_read_path, method: :post, data: { turbo_method: :post }, class: "btn btn-sm btn-primary" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if @notifications.any? %>
|
2024-12-20 09:26:25 -05:00
|
|
|
<%= link_to "Delete all", delete_all_notifications_path, method: :post, data: { turbo_method: :post, turbo_confirm: 'Are you sure you want to delete all notifications?' }, class: "btn btn-sm btn-warning" %>
|
2024-09-08 10:52:35 -04:00
|
|
|
<% end %>
|
2024-07-04 17:00:07 -04:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-4">
|
2024-07-24 14:25:16 -04:00
|
|
|
<%= paginate @notifications %>
|
2024-07-04 17:00:07 -04:00
|
|
|
</div>
|
2024-07-04 16:20:12 -04:00
|
|
|
</div>
|
2024-07-04 17:00:07 -04:00
|
|
|
<div id="notifications" class="w-full max-w-2xl">
|
2024-07-04 16:20:12 -04:00
|
|
|
<% @notifications.each do |notification| %>
|
|
|
|
|
<%= render notification %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|