46 lines
1.8 KiB
Plaintext
46 lines
1.8 KiB
Plaintext
<% @page_title = "Notifications" %>
|
|
|
|
<% content_for :header do %>
|
|
<nav class="align-start">
|
|
<%= link_to root_path, class: "btn flex-item-justify-start", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %>
|
|
<%= image_tag "home.svg", aria: { hidden: true }, size: 24 %>
|
|
<span class="for-screen-reader">Home</span>
|
|
<% end %>
|
|
|
|
<h1 class="txt-x-large"><%= @page_title %></h1>
|
|
|
|
<%= link_to notifications_settings_path, class: "btn 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 %>
|