Files
fizzy/app/views/notifications/index.html.erb
T
2025-02-21 17:25:44 -06:00

48 lines
1.8 KiB
Plaintext

<% @page_title = "Notifications" %>
<% content_for :header do %>
<nav class="align-start">
<div class="btn btn--placeholder flex-item-justify-start"></div>
<header class="flex flex-column center margin-block-end">
<div class="flex align-center gap-half justify-center">
<%= link_to "Collections", root_path %>
<%= link_to "Activity", events_path %>
</div>
<h1 class="txt-x-large"><%= @page_title %></h1>
</header>
<%= link_to notifications_settings_path, class: "btn borderless flex-item-justify-end" do %>
<%= image_tag "settings.svg", size: 20 %>
<span class="for-screen-reader">Notification settings</span>
<% end %>
</nav>
<% end %>
<section class="panel center borderless unpad flex flex-column gap-half">
<%= turbo_frame_tag "notifications_list" do %>
<% if @unread.any? %>
<div class="flex align-center justify-space-between margin-block-start margin-block-end-half">
<h2 class="txt-medium txt-uppercase txt-alert">New for you</h2>
<%= button_to notifications_mark_all_read_path, class: "btn txt-small" do %>
Mark all as read
<% end %>
</div>
<%= render @unread %>
<% else %>
<div class="pad border-radius border translucent" style="--border-style: dashed; --border-color: var(--color-ink);">
<strong>Nothing new for you.</strong>
</div>
<% end %>
<% end %>
</section>
<% if @page.records.any? %>
<section id="notifications_list_read" class="notificiations-list--read panel center borderless unpad flex flex-column gap-half margin-block-start">
<h2 class="txt-medium margin-block-start-double margin-block-end-half txt-uppercase translucent">Previously seen</h2>
<%= render @page.records %>
</section>
<%= notifications_next_page_link(@page) %>
<% end %>