source: Klonkt/src/views/pages/fedi-notifications.ejs@ bf4596d

main
Last change on this file since bf4596d was 00f669b, checked in by Robin Genis <roboburr@…>, 3 months ago

feat(fediverse-client): notifications inbox (/meldingen)

Aggregates new followers + replies/likes/boosts on your posts into one feed
(getNotifications). New pages/fedi-notifications view + Beheer link. The old
native notifications.ejs (dead since comments removed) is left untouched.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<div class="nt-wrap">
2 <h1 class="nt-title"><%= t('notif.title') %></h1>
3 <% if (!items || !items.length) { %>
4 <p class="nt-empty"><%= t('notif.empty') %></p>
5 <% } else { %>
6 <ul class="nt-list">
7 <% items.forEach(function(n){ %>
8 <li class="nt-item">
9 <span class="nt-icon"><%= n.type === 'follow' ? '👤' : (n.type === 'like' ? '⭐' : (n.type === 'announce' ? '🔁' : '💬')) %></span>
10 <div class="nt-body">
11 <div class="nt-line">
12 <a class="nt-who" href="<%= n.url %>" target="_blank" rel="nofollow noopener"><%= n.name || n.handle %></a>
13 <% if (n.handle && n.name) { %><span class="nt-handle"><%= n.handle %></span><% } %>
14 <span class="nt-what">
15 <% if (n.type === 'follow') { %><%= t('notif.followed') %>
16 <% } else if (n.type === 'like') { %><%= t('notif.liked') %>
17 <% } else if (n.type === 'announce') { %><%= t('notif.boosted') %>
18 <% } else { %><%= t('notif.replied') %><% } %>
19 <% if (n.post_slug) { %><a href="/<%= n.post_slug %>"><%= n.post_title || n.post_slug %></a><% } %>
20 </span>
21 <% if (n.created_at) { %><span class="nt-time"><%= formatDateTime(n.created_at) %></span><% } %>
22 </div>
23 <% if (n.type === 'reply' && n.content) { %><div class="nt-content"><%- n.content %></div><% } %>
24 </div>
25 </li>
26 <% }); %>
27 </ul>
28 <% } %>
29</div>
30
31<style>
32 .nt-wrap { max-width: 620px; margin: 2rem auto; padding: 0 1rem; }
33 .nt-title { margin: 0 0 1.25rem; }
34 .nt-empty { color: var(--ink-soft, #888); }
35 .nt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
36 .nt-item { display: flex; gap: .7rem; padding: .7rem .9rem; border-radius: 12px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 8%, transparent); }
37 .nt-icon { font-size: 1.1rem; flex: 0 0 1.4rem; text-align: center; }
38 .nt-body { flex: 1; min-width: 0; }
39 .nt-line { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
40 .nt-who { font-weight: 600; color: var(--ink, inherit); text-decoration: none; }
41 .nt-who:hover { text-decoration: underline; }
42 .nt-handle { color: var(--ink-soft, #888); font-size: .82rem; }
43 .nt-what { color: var(--ink-soft, #aaa); }
44 .nt-what a { color: var(--accent, #06c); }
45 .nt-time { color: var(--ink-soft, #999); font-size: .78rem; margin-left: auto; }
46 .nt-content { margin: .3rem 0 0; line-height: 1.45; color: var(--ink, inherit); overflow-wrap: anywhere; }
47 .nt-content p { margin: .2rem 0; } .nt-content p:first-child { margin-top: 0; }
48</style>
Note: See TracBrowser for help on using the repository browser.