Files
fizzy/app/views/notifications/index.html.erb
T
2025-04-03 12:53:19 +02:00

43 lines
1.5 KiB
Plaintext

<% @page_title = "Notifications" %>
<% content_for :header do %>
<nav class="align-start">
<%= link_to_home class: "flex-item-justify-start" %>
<h1 class="txt-x-large"><%= @page_title %></h1>
<%= link_to notifications_settings_path, class: "btn flex-item-justify-end" do %>
<%= icon_tag "settings" %>
<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); --border-radius: 0.2em;">
<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 %>