Changeset 28f797d in Klonkt for src/views/pages


Ignore:
Timestamp:
06/30/2026 04:31:56 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
ecbfa41
Parents:
28bf7f0
Message:

feat(post): share button at the bottom of posts

A "Share/Deel" button under the post (visible to everyone). Uses the Web Share API (native share
sheet) where available, otherwise copies the post URL to the clipboard with a "Link copied"
confirmation. Wired through the existing delegated click handler (CSP-safe, no inline on*).

  • src/views/pages/post.ejs — share button + feedback span
  • src/views/shell.ejs — data-share delegated handler (navigator.share / clipboard)
  • src/services/i18n.js — post.share, post.share_copied (nl/en/de)

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

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

    r28bf7f0 r28f797d  
    5656    </div>
    5757  <% } %>
     58
     59  <div class="post-share" style="margin:1.25rem 0;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap">
     60    <button type="button" class="btn post-share-btn" data-share data-share-title="<%= post.title %>">🔗 <%= t('post.share') %></button>
     61    <span class="post-share-feedback" id="post-share-feedback" style="color:var(--accent);font-size:.85rem" hidden><%= t('post.share_copied') %></span>
     62  </div>
    5863
    5964  <!-- Inline admin actions: only visible if user has permission -->
Note: See TracChangeset for help on using the changeset viewer.