source: Klonkt/src/views/pages/notifications.ejs@ dd856db

main
Last change on this file since dd856db was c9c6a2d, checked in by roboburr <roboburr@…>, 3 months ago

feat(meldingen): notifications — reply on comment, comment on post, like on post

For every logged-in user (Google visitors/fans and admin). Bell icon in the
header with unread counter + notifications page /notifications (via user menu
desktop + profile sheet mobile; badge also on the mobile Profile tab). Opening =
read. Triggers in comments (reply→comment author, top-level→post author) and
like (→post author); notify() skips notifying yourself. Table notifications
+ NotificationService. NL/EN/DE.

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

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[c9c6a2d]1<div class="container notif-page">
2 <h1><%= t('notif.title') %></h1>
3
4 <% if (!items || !items.length) { %>
5 <p class="notif-empty"><%= t('notif.empty') %></p>
6 <% } else { %>
7 <ul class="notif-list">
8 <% items.forEach(function(n){
9 var key = n.type === 'reply' ? 'notif.reply' : (n.type === 'comment' ? 'notif.comment' : 'notif.like');
10 var actor = n.actor_name || t('notif.someone');
11 %>
12 <li class="notif-item<%= n.read ? '' : ' is-unread' %>">
13 <a class="notif-link" href="<%= n.url || '#' %>">
14 <span class="notif-text"><%= t(key, { actor: actor }) %></span>
15 <% if (n.post_title) { %><span class="notif-post">&ldquo;<%= n.post_title %>&rdquo;</span><% } %>
16 <span class="notif-time"><%= formatDateTime(n.created_at) %></span>
17 </a>
18 </li>
19 <% }); %>
20 </ul>
21 <% } %>
22</div>
23
24<style>
25.notif-page { max-width: 640px; margin: 2.5rem auto; padding: 0 1rem; }
26.notif-page h1 { font-family: var(--font-display, serif); font-size: 1.8rem; margin: 0 0 1.25rem; }
27.notif-empty { color: var(--ink-muted, var(--ink-soft)); }
28.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
29.notif-item { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); }
30.notif-item.is-unread { border-color: var(--accent); }
31.notif-link { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.9rem; color: var(--ink); text-decoration: none; }
32.notif-link:hover { background: var(--paper); }
33.notif-text { font-size: 0.95rem; }
34.notif-post { color: var(--ink-soft, var(--ink-muted)); font-size: 0.9rem; }
35.notif-time { color: var(--ink-soft, var(--ink-muted)); font-size: 0.78rem; }
36</style>
Note: See TracBrowser for help on using the repository browser.