Changeset 515cf1a in Klonkt for src/views/partials/post-card.ejs


Ignore:
Timestamp:
06/28/2026 10:39:11 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
73cffc3
Parents:
0596945
Message:

fix(nsfw): warn on cover-less NSFW posts everywhere (related, list, news)

A sensitive post with no cover image showed no warning in the related-posts grid, the list
view, or the News feed (text-only). Now they all get the click-to-reveal veil over a
placeholder (cards) or over the content (text-only News post), matching the grid tile.

  • views/pages/post.ejs — veil on the empty related-cover placeholder
  • views/partials/post-card.ejs — placeholder cover + veil when nsfw and no cover
  • views/pages/news.ejs — blur the content for a text-only sensitive post
File:
1 edited

Legend:

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

    r0596945 r515cf1a  
    4343}
    4444%>
    45 <li class="post-list-item<%= _hasCover ? ' has-cover' : '' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %>">
     45<li class="post-list-item<%= (_hasCover || post.nsfw) ? ' has-cover' : '' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %>">
    4646
    4747  <% if (_hasCover) { %>
     
    5151      <img src="<%= post.cover_image_url %>" alt="" loading="lazy" decoding="async">
    5252      <% 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><% } %>
     53    </a>
     54  <% } else if (post.nsfw) { %>
     55    <a class="post-list-cover nsfw-media" href="<%= _href %>"
     56       <% 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"<% } %>
     57       aria-label="<%= post.title || '(zonder titel)' %>" tabindex="-1">
     58      <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>
    5359    </a>
    5460  <% } %>
Note: See TracChangeset for help on using the changeset viewer.