source: Klonkt/src/views/pages/authorize-interaction.ejs@ 62dea30

main
Last change on this file since 62dea30 was 5b47619, checked in by Robin Genis <roboburr@…>, 3 months ago

style(activitypub): tidy the /fediverse manage list into cards

Card-style list (no list numbers), muted recipient+date line, clean danger-style
Delete button, back link.

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

  • Property mode set to 100644
File size: 5.9 KB
Line 
1<div class="auth-interact">
2 <% if (typeof manage !== 'undefined' && manage) { %>
3 <h1 class="auth-interact-title"><%= t('fedi.manage_title') %></h1>
4 <% if (!manage.length) { %>
5 <p class="auth-interact-note"><%= t('fedi.manage_empty') %></p>
6 <% } else { %>
7 <ul class="fedi-manage">
8 <% manage.forEach(function(m){ %>
9 <li class="fedi-manage-item">
10 <div class="fedi-manage-content"><%- m.content %></div>
11 <div class="fedi-manage-foot">
12 <span class="fedi-manage-meta"><% if (m.to_handle) { %>→ <%= m.to_handle %><% } %><% if (m.created_at && typeof formatDateTime === 'function') { %> · <%= formatDateTime(m.created_at) %><% } %></span>
13 <form method="post" action="/fediverse/<%= m.id %>/delete" onsubmit="return confirm('<%= t('fedi.delete_confirm') %>')">
14 <button type="submit" class="fedi-del-btn"><%= t('comments.delete') %></button>
15 </form>
16 </div>
17 </li>
18 <% }); %>
19 </ul>
20 <% } %>
21 <p class="auth-interact-note"><a href="/"><%= t('fedi.remote_back') %></a></p>
22 <% } else if (typeof sent !== 'undefined' && sent) { %>
23 <h1 class="auth-interact-title"><%= t('fedi.remote_sent_title') %></h1>
24 <p class="auth-interact-note"><%= t('fedi.remote_sent') %></p>
25 <p class="auth-interact-actions">
26 <% if (uri) { %><a class="btn" href="<%= uri %>" target="_blank" rel="nofollow noopener"><%= t('fedi.remote_view_original') %></a><% } %>
27 <a class="btn btn-primary" href="/"><%= t('fedi.remote_back') %></a>
28 </p>
29 <% } else { %>
30 <h1 class="auth-interact-title"><%= t('fedi.remote_title') %></h1>
31
32 <% if (!target) { %>
33 <p class="auth-interact-note"><%= t('fedi.remote_notfound') %></p>
34 <form method="get" action="/authorize_interaction" class="auth-interact-form">
35 <input type="url" name="uri" placeholder="https://…/een-post" value="<%= uri || '' %>" required>
36 <button type="submit" class="btn btn-primary"><%= t('fedi.remote_load') %></button>
37 </form>
38 <% } else { %>
39 <p class="auth-interact-meta">
40 <%= t('fedi.remote_replying_to') %>
41 <a href="<%= target.actor_url %>" rel="nofollow noopener" target="_blank"><strong><%= target.actor_name %></strong></a>
42 <span class="fedi-handle"><%= target.actor_handle %></span>
43 </p>
44 <blockquote class="auth-interact-preview">
45 <% if (target.content) { %><div class="auth-interact-content"><%- target.content %></div>
46 <% } else if (target.preview) { %><%= target.preview %><% } %>
47 <% (target.images || []).forEach(function(im){ %>
48 <img class="auth-interact-img" src="<%= im %>" alt="" loading="lazy">
49 <% }); %>
50 <% if (target.url || uri) { %>
51 <p class="auth-interact-orig"><a href="<%= target.url || uri %>" target="_blank" rel="nofollow noopener"><%= t('fedi.remote_view_original') %></a></p>
52 <% } %>
53 </blockquote>
54 <form method="post" action="/authorize_interaction" class="auth-interact-form">
55 <input type="hidden" name="uri" value="<%= uri %>">
56 <textarea name="text" rows="4" required placeholder="<%= t('fedi.reply_ph') %>"></textarea>
57 <div class="auth-interact-actions">
58 <button type="submit" class="btn btn-primary"><%= t('fedi.send') %></button>
59 <a href="<%= uri %>" class="btn"><%= t('comments.cancel') %></a>
60 </div>
61 </form>
62 <p class="auth-interact-note"><%= t('fedi.remote_as', { site: siteTitle }) %></p>
63 <% } %>
64 <% } %>
65</div>
66
67<style>
68 .auth-interact { max-width: 580px; margin: 2rem auto; padding: 0 1rem; }
69 .auth-interact-title { margin: 0 0 1rem; }
70 .auth-interact-meta { color: var(--ink-soft, #888); margin: 0 0 .75rem; }
71 .auth-interact-preview {
72 margin: 0 0 1rem; padding: .75rem 1rem; border-left: 3px solid var(--accent, #888);
73 background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border-radius: 0 12px 12px 0;
74 color: var(--ink, inherit);
75 }
76 .auth-interact-form { display: flex; flex-direction: column; gap: .75rem; }
77 .auth-interact-form textarea, .auth-interact-form input[type=url] {
78 width: 100%; box-sizing: border-box; padding: .6rem .8rem; font: inherit; resize: vertical;
79 border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent);
80 background: var(--paper, #fff); color: var(--ink, #000);
81 }
82 .auth-interact-actions { display: flex; gap: .5rem; align-items: center; }
83 .auth-interact-note { color: var(--ink-soft, #999); font-size: .85rem; margin-top: 1rem; }
84 .auth-interact-content { line-height: 1.55; }
85 .auth-interact-content p { margin: .35rem 0; }
86 .auth-interact-content p:first-child { margin-top: 0; }
87 .auth-interact-img { max-width: 100%; height: auto; border-radius: 10px; margin: .5rem 0 0; display: block; }
88 .auth-interact-orig { margin: .75rem 0 0; font-size: .85rem; }
89 .auth-interact-orig a { color: var(--accent, #06c); }
90 .fedi-manage { list-style: none; padding: 0; margin: 1.25rem 0 1rem; display: flex; flex-direction: column; gap: .7rem; }
91 .fedi-manage-item { padding: .85rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 9%, transparent); }
92 .fedi-manage-content { line-height: 1.5; overflow-wrap: anywhere; }
93 .fedi-manage-content p { margin: .15rem 0; }
94 .fedi-manage-content p:first-child { margin-top: 0; }
95 .fedi-manage-content p:last-child { margin-bottom: 0; }
96 .fedi-manage-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }
97 .fedi-manage-meta { color: var(--ink-soft, #999); font-size: .8rem; }
98 .fedi-del-btn { border: 1px solid color-mix(in srgb, #d9534f 50%, transparent); background: color-mix(in srgb, #d9534f 12%, transparent); color: #e06b66; border-radius: 8px; padding: .3rem .75rem; font-size: .82rem; cursor: pointer; transition: background .15s ease; }
99 .fedi-del-btn:hover { background: color-mix(in srgb, #d9534f 24%, transparent); }
100</style>
Note: See TracBrowser for help on using the repository browser.