Changeset 837fc9c in Klonkt for src/views/partials


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.

Location:
src/views/partials
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/post-card.ejs

    raa45208 r837fc9c  
    4646
    4747  <% if (_hasCover) { %>
    48     <a class="post-list-cover" href="<%= _href %>"
     48    <a class="post-list-cover<%= post.nsfw ? ' nsfw-media' : '' %>" href="<%= _href %>"
    4949       <% if (_ext) { %>target="_blank" rel="noopener"<% } else { %>hx-get="<%= _href %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _href %>" hx-indicator="#pcms-loading"<% } %>
    5050       aria-label="<%= post.title || '(zonder titel)' %>" tabindex="-1">
    5151      <img src="<%= post.cover_image_url %>" alt="" loading="lazy" decoding="async">
     52      <% if (post.nsfw) { %><span class="nsfw-veil"><span class="nsfw-veil-label">🔞 <%= t('post.nsfw_warning') %></span><span class="nsfw-veil-btn"><%= t('post.nsfw_show') %></span></span><% } %>
    5253    </a>
    5354  <% } %>
  • src/views/partials/post-tile.ejs

    raa45208 r837fc9c  
    1414const _ext = !!_external;
    1515%>
    16 <a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %>"
     16<a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %><%= post.nsfw ? ' nsfw-media' : '' %>"
    1717   href="<%= _href %>"
    1818   <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
     
    3737    <% if (_src) { %><span class="grid-tile-gradient-src">van <%= _src %></span><% } %>
    3838  <% } %>
     39  <% if (post.nsfw) { %><div class="nsfw-veil"><span class="nsfw-veil-label">🔞 <%= t('post.nsfw_warning') %></span><span class="nsfw-veil-btn"><%= t('post.nsfw_show') %></span></div><% } %>
    3940</a>
Note: See TracChangeset for help on using the changeset viewer.