source: Klonkt/src/views/pages/blocks.ejs@ cbe4f4e

main
Last change on this file since cbe4f4e was f5c3870, checked in by Robin Genis <roboburr@…>, 3 months ago

feat(fediverse-client): block/defederate accounts & domains

Block an @handle or a whole domain (/blokkeren + 🚫 on timeline items): their
inbound activities are silently dropped (202) and their stored content is purged.
New ap_blocks table + isBlockedAny gate in the inbox. Top-bar bell now points to
the fediverse /meldingen (gated to site managers via canManageFedi) instead of the
dead native notifications.

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

  • Property mode set to 100644
File size: 2.5 KB
Line 
1<div class="bl-wrap">
2 <h1 class="bl-title"><%= t('blk.title') %></h1>
3 <p class="bl-lead"><%= t('blk.lead') %></p>
4 <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
5 <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
6
7 <form method="post" action="/blokkeren/add" class="bl-form">
8 <input type="text" name="target" placeholder="@naam@server.social • server.social" autocomplete="off" spellcheck="false" required>
9 <button type="submit" class="btn btn-primary"><%= t('blk.block_btn') %></button>
10 </form>
11
12 <% if (!blocks || !blocks.length) { %>
13 <p class="bl-empty"><%= t('blk.empty') %></p>
14 <% } else { %>
15 <ul class="bl-list">
16 <% blocks.forEach(function(b){ %>
17 <li class="bl-item">
18 <span class="bl-kind"><%= b.kind === 'domain' ? '🌐' : '👤' %></span>
19 <span class="bl-label"><%= b.label || b.target %></span>
20 <form method="post" action="/blokkeren/remove"><input type="hidden" name="target" value="<%= b.target %>"><button type="submit" class="bl-unblock"><%= t('blk.unblock') %></button></form>
21 </li>
22 <% }); %>
23 </ul>
24 <% } %>
25</div>
26
27<style>
28 .bl-wrap { max-width: 560px; margin: 2rem auto; padding: 0 1rem; }
29 .bl-title { margin: 0 0 .25rem; }
30 .bl-lead { color: var(--ink-soft, #888); margin: 0 0 1.25rem; }
31 .bl-form { display: flex; gap: .5rem; margin: 0 0 1.25rem; flex-wrap: wrap; }
32 .bl-form input { flex: 1; min-width: 220px; height: 2.4rem; padding: 0 .9rem; border-radius: 999px; font: inherit;
33 border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); background: color-mix(in srgb, var(--ink, #000) 4%, transparent); color: var(--ink, #000); }
34 .bl-empty { color: var(--ink-soft, #888); }
35 .bl-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
36 .bl-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 8%, transparent); }
37 .bl-kind { font-size: 1.05rem; }
38 .bl-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
39 .bl-unblock { background: none; border: 1px solid color-mix(in srgb, var(--ink, #000) 18%, transparent); border-radius: 8px; padding: .25rem .6rem; font-size: .8rem; color: var(--ink-soft, #888); cursor: pointer; }
40 .bl-unblock:hover { color: var(--ink, #000); }
41</style>
Note: See TracBrowser for help on using the repository browser.