Changeset b7d4458 in Klonkt for src/views


Ignore:
Timestamp:
06/27/2026 08:10:43 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
c21197a
Parents:
92f6976
Message:

feat(nsfw): custom content-warning text + blur in the Cirkel

  • Per-post content-warning text (like Mastodon): editor field; used as the on-site veil/banner label and the fediverse Note summary (falls back to 'Gevoelige inhoud').
  • Cirkel feed now blurs remote sensitive posts: ap_timeline gets nsfw+cw (captured from the incoming Note's sensitive/summary), getCirkelPosts returns them, circle.js maps them so post-card/tile show the veil.
Location:
src/views
Files:
4 edited

Legend:

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

    r92f6976 rb7d4458  
    242242          <span>🔞 <%= t('pedit.nsfw_label') %></span>
    243243        </label>
     244        <input type="text" name="content_warning" value="<%= post.content_warning || '' %>" maxlength="200"
     245               placeholder="<%= t('pedit.nsfw_cw_ph') %>"
     246               style="width:100%;box-sizing:border-box;margin:6px 0 2px;font-size:13px;padding:7px 9px">
    244247        <% if (typeof premiumUnlocked === 'undefined' || premiumUnlocked) { %>
    245248          <label class="pe-checkbox">
  • src/views/pages/post.ejs

    r92f6976 rb7d4458  
    1313    <div class="nsfw-banner">
    1414      <span class="nsfw-banner-icon">🔞</span>
    15       <span class="nsfw-banner-text"><%= t('post.nsfw_warning') %></span>
     15      <span class="nsfw-banner-text"><%= post.content_warning || t('post.nsfw_warning') %></span>
    1616      <button type="button" class="nsfw-banner-btn nsfw-reveal"><%= t('post.nsfw_show') %></button>
    1717    </div>
  • src/views/partials/post-card.ejs

    r92f6976 rb7d4458  
    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><% } %>
     52      <% if (post.nsfw) { %><span class="nsfw-veil"><span class="nsfw-veil-label">🔞 <%= post.content_warning || t('post.nsfw_warning') %></span><span class="nsfw-veil-btn"><%= t('post.nsfw_show') %></span></span><% } %>
    5353    </a>
    5454  <% } %>
  • src/views/partials/post-tile.ejs

    r92f6976 rb7d4458  
    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><% } %>
     39  <% if (post.nsfw) { %><div class="nsfw-veil"><span class="nsfw-veil-label">🔞 <%= post.content_warning || t('post.nsfw_warning') %></span><span class="nsfw-veil-btn"><%= t('post.nsfw_show') %></span></div><% } %>
    4040</a>
Note: See TracChangeset for help on using the changeset viewer.