Changeset c9c6a2d in Klonkt for src/views/partials


Ignore:
Timestamp:
06/21/2026 06:38:24 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9a34d31
Parents:
d41f4be
Message:

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@…>

Location:
src/views/partials
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/bottom-tab.ejs

    rd41f4be rc9c6a2d  
    107107      <% } %>
    108108      <span class="bottom-tab-label"><%= t('tab.profile') %></span>
     109      <% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %>
     110        <span class="bottom-tab-badge" aria-label="<%= notifUnread %> ongelezen meldingen"><%= notifUnread > 99 ? '99+' : notifUnread %></span>
     111      <% } %>
    109112    </button>
    110113  <% } else { %>
  • src/views/partials/profile-sheet.ejs

    rd41f4be rc9c6a2d  
    5353          <svg class="psi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
    5454          <span class="psi-label">Account</span>
     55          <svg class="psi-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
     56        </a>
     57      </li>
     58      <li role="none">
     59        <a href="/notifications" class="profile-sheet-item" role="menuitem" data-close-sheet>
     60          <svg class="psi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
     61          <span class="psi-label"><%= t('nav.notifications') %><% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %> (<%= notifUnread %>)<% } %></span>
    5562          <svg class="psi-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
    5663        </a>
  • src/views/partials/topnav.ejs

    rd41f4be rc9c6a2d  
    103103        <a class="nav-btn" href="<%= _siteUrlBase %>/prutter" aria-label="Prutter (DMs)" title="Prutter">
    104104          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
     105        </a>
     106      <% } %>
     107
     108      <% if (user) { %>
     109        <a class="nav-btn nav-notif" href="/notifications" aria-label="<%= t('nav.notifications') %>" title="<%= t('nav.notifications') %>"
     110           hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/notifications" hx-indicator="#pcms-loading">
     111          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
     112          <% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %><span class="notif-badge"><%= notifUnread > 9 ? '9+' : notifUnread %></span><% } %>
    105113        </a>
    106114      <% } %>
     
    137145                <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
    138146                <span><%= t('nav.account') %></span>
     147              </a>
     148              <a href="/notifications" role="menuitem" class="udi"
     149                 hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
     150                 hx-push-url="/notifications" hx-indicator="#pcms-loading">
     151                <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
     152                <span><%= t('nav.notifications') %><% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %> (<%= notifUnread %>)<% } %></span>
    139153              </a>
    140154              <a href="/favorieten" role="menuitem" class="udi"
     
    558572.ss-all { display: block; margin-top: .35rem; padding: .55rem .6rem; border-top: 1px solid var(--rule); color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem; }
    559573.ss-all:hover { text-decoration: underline; }
     574/* Meldingen-bel + ongelezen-badge */
     575.nav-notif { position: relative; }
     576.notif-badge {
     577  position: absolute; top: 1px; right: 1px;
     578  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
     579  display: inline-flex; align-items: center; justify-content: center;
     580  background: #e0245e; color: #fff; font-size: 10px; font-weight: 700;
     581  border-radius: 999px; line-height: 1; pointer-events: none;
     582}
    560583</style>
Note: See TracChangeset for help on using the changeset viewer.