Changeset 837fc9c in Klonkt for src/views/pages/post.ejs


Ignore:
Timestamp:
06/27/2026 07:51:44 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
92f6976
Parents:
aa45208
Message:

feat(posts): NSFW / sensitive content

Mark a post NSFW (checkbox in the editor, available to all). On-site the cover blurs in
feed/grid and the whole post blurs behind a 'Gevoelige inhoud' banner until clicked. In the
fediverse the Note gets sensitive:true + a content-warning summary (Mastodon CW). i18n NL/EN/DE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/post.ejs

    raa45208 r837fc9c  
    55const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
    66%>
    7 <article class="container post-page">
     7<article class="container post-page<%= post.nsfw ? ' nsfw-gate' : '' %>">
    88
    99  <%# Navigation across ALL posts — ABOVE the post (shared partial). %>
    1010  <%- include('../partials/post-nav', { newerPost: newerPost, olderPost: olderPost }) %>
     11
     12  <% if (post.nsfw) { %>
     13    <div class="nsfw-banner">
     14      <span class="nsfw-banner-icon">🔞</span>
     15      <span class="nsfw-banner-text"><%= t('post.nsfw_warning') %></span>
     16      <button type="button" class="nsfw-banner-btn nsfw-reveal"><%= t('post.nsfw_show') %></button>
     17    </div>
     18  <% } %>
    1119
    1220  <% if (post.cover_image_url) { %>
Note: See TracChangeset for help on using the changeset viewer.