Changeset 8ad1784 in Klonkt for src/views


Ignore:
Timestamp:
06/25/2026 09:08:20 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
7c62efb
Parents:
4c12783
Message:

feat(ap): authorize_interaction handles actor URIs as a Follow

The fediverse interaction page only did reply/like — it always tried to
resolve the URI as a post. A profile/actor URL fell through to the reply
composer, so 'following' produced a reply. Now: if the URI isn't a post,
resolve it as an actor and show a Follow action (followActor, which now
accepts a profile URL as well as an @handle). Adds fedi.follow_* i18n (nl/en/de).

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

File:
1 edited

Legend:

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

    r4c12783 r8ad1784  
    2727      <a class="btn btn-primary" href="/"><%= t('fedi.remote_back') %></a>
    2828    </p>
     29  <% } else if (typeof followed !== 'undefined' && followed) { %>
     30    <h1 class="auth-interact-title"><%= t('fedi.followed_title') %></h1>
     31    <p class="auth-interact-note"><%= t('fedi.followed_done') %></p>
     32    <p class="auth-interact-actions">
     33      <% if (uri) { %><a class="btn" href="<%= uri %>" rel="nofollow noopener"><%= t('fedi.view_profile') %></a><% } %>
     34      <a class="btn btn-primary" href="/"><%= t('fedi.remote_back') %></a>
     35    </p>
    2936  <% } else if (typeof sent !== 'undefined' && sent) { %>
    3037    <h1 class="auth-interact-title"><%= t('fedi.remote_sent_title') %></h1>
     
    3441      <a class="btn btn-primary" href="/"><%= t('fedi.remote_back') %></a>
    3542    </p>
     43  <% } else if (typeof followTarget !== 'undefined' && followTarget) { %>
     44  <h1 class="auth-interact-title"><%= t('fedi.follow_heading') %></h1>
     45  <p class="auth-interact-meta">
     46    <%= t('fedi.follow_intro') %>
     47    <a href="<%= followTarget.actor_url %>" rel="nofollow noopener" target="_blank"><strong><%= followTarget.actor_name %></strong></a>
     48    <span class="fedi-handle"><%= followTarget.actor_handle %></span>
     49  </p>
     50  <form method="post" action="/authorize_interaction/follow" class="auth-interact-form">
     51    <input type="hidden" name="uri" value="<%= followTarget.actor_uri %>">
     52    <div class="auth-interact-actions">
     53      <button type="submit" class="btn btn-primary"><%= t('fedi.follow_btn') %></button>
     54      <a href="/" class="btn"><%= t('comments.cancel') %></a>
     55    </div>
     56  </form>
     57  <p class="auth-interact-note"><%= t('fedi.remote_as', { site: siteTitle }) %></p>
    3658  <% } else { %>
    3759  <h1 class="auth-interact-title"><%= t('fedi.remote_title') %></h1>
Note: See TracChangeset for help on using the changeset viewer.