Changeset 1c2dcba in Klonkt for src/views/pages


Ignore:
Timestamp:
07/01/2026 07:14:12 PM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
737ea05
Parents:
0688b5f
Message:

feat(fediverse): report a post/account to its home server (AS2 Flag)

From the interact page you can now report a fediverse post to its home server's
moderators. Sends the Mastodon-standard AS2 Flag (object = [reported account,
reported status], content = the reason) to the reported account's inbox.

  • src/services/ActivityPubService.js — sendReport(site, {objectUri, actorUri, reason}) resolves the reported account, builds the Flag and delivers it to their inbox.
  • src/routes/posts.js — POST /authorize_interaction/report (owner-only); GET passes reported and skips re-resolving on the confirmation view.
  • src/views/pages/authorize-interaction.ejs — a "Report this post" disclosure with a reason field, a "reported" confirmation, and scoped styles.
  • src/services/i18n.js — fedi.report_* + fedi.reported_* (nl/en/de).
  • test/activitypub-as2.test.js — allow the AS2 Flag activity type.
  • CHANGELOG(.nl/.de).md — "Report a post to the fediverse" under Unreleased.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/authorize-interaction.ejs

    r0688b5f r1c2dcba  
    9393      <a class="btn" href="/"><%= t('fedi.remote_back') %></a>
    9494    </p>
     95  <% } else if (typeof reported !== 'undefined' && reported) { %>
     96    <h1 class="auth-interact-title">🚩 <%= t('fedi.reported_title') %></h1>
     97    <p class="auth-interact-note"><%= t('fedi.reported_done') %></p>
     98    <p class="auth-interact-actions">
     99      <a class="btn" href="/"><%= t('fedi.remote_back') %></a>
     100    </p>
    95101  <% } else if (typeof voted !== 'undefined' && voted) { %>
    96102    <h1 class="auth-interact-title">📊 <%= t('poll.voted_title') %></h1>
     
    192198    </form>
    193199    <p class="auth-interact-note"><%= t('fedi.remote_as', { site: siteTitle }) %></p>
     200    <details class="auth-report">
     201      <summary>🚩 <%= t('fedi.report_open') %></summary>
     202      <form method="post" action="/authorize_interaction/report" class="auth-interact-form">
     203        <input type="hidden" name="uri" value="<%= uri %>">
     204        <input type="hidden" name="actor_uri" value="<%= target.actor_uri %>">
     205        <p class="auth-report-note"><%= t('fedi.report_where', { handle: target.actor_handle }) %></p>
     206        <textarea name="reason" rows="3" maxlength="3000" placeholder="<%= t('fedi.report_ph') %>"></textarea>
     207        <div class="auth-interact-actions">
     208          <button type="submit" class="btn btn-danger"><%= t('fedi.report_send') %></button>
     209        </div>
     210      </form>
     211    </details>
    194212  <% } %>
    195213  <% } %>
     
    291309  .auth-poll-pct { position: relative; z-index: 1; font-variant-numeric: tabular-nums; font-weight: 500; }
    292310  .auth-poll-foot { font-size: .82rem; color: var(--ink-soft, #888); margin: .1rem 0 0; }
     311  .auth-report { margin: .6rem 0 0; }
     312  .auth-report summary { cursor: pointer; font-size: .85rem; color: var(--ink-soft, #888); }
     313  .auth-report summary:hover, .auth-report[open] summary { color: #c0392b; }
     314  .auth-report[open] summary { margin-bottom: .5rem; }
     315  .auth-report-note { font-size: .82rem; color: var(--ink-muted, #999); margin: 0 0 .5rem; }
    293316</style>
    294317
Note: See TracChangeset for help on using the changeset viewer.