| 1 | <div class="bl-wrap">
|
|---|
| 2 | <%- include('../partials/fedi-tabs', { active: 'blokkeren' }) %>
|
|---|
| 3 | <h1 class="bl-title"><%= t('blk.title') %></h1>
|
|---|
| 4 | <p class="bl-lead"><%= t('blk.lead') %></p>
|
|---|
| 5 | <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 6 | <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 7 |
|
|---|
| 8 | <form method="post" action="/blokkeren/add" class="bl-form">
|
|---|
| 9 | <input type="text" name="target" placeholder="@naam@server.social • server.social" autocomplete="off" spellcheck="false" required>
|
|---|
| 10 | <button type="submit" class="btn btn-primary"><%= t('blk.block_btn') %></button>
|
|---|
| 11 | </form>
|
|---|
| 12 |
|
|---|
| 13 | <% if (!blocks || !blocks.length) { %>
|
|---|
| 14 | <p class="bl-empty"><%= t('blk.empty') %></p>
|
|---|
| 15 | <% } else { %>
|
|---|
| 16 | <ul class="bl-list">
|
|---|
| 17 | <% blocks.forEach(function(b){ %>
|
|---|
| 18 | <li class="bl-item">
|
|---|
| 19 | <span class="bl-kind"><%= b.kind === 'domain' ? '🌐' : '👤' %></span>
|
|---|
| 20 | <span class="bl-label"><%= b.label || b.target %></span>
|
|---|
| 21 | <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>
|
|---|
| 22 | </li>
|
|---|
| 23 | <% }); %>
|
|---|
| 24 | </ul>
|
|---|
| 25 | <% } %>
|
|---|
| 26 | </div>
|
|---|
| 27 |
|
|---|
| 28 | <style>
|
|---|
| 29 | .bl-wrap { max-width: 560px; margin: 2rem auto; padding: 0 1rem; }
|
|---|
| 30 | .bl-title { margin: 0 0 .25rem; }
|
|---|
| 31 | .bl-lead { color: var(--ink-soft, #888); margin: 0 0 1.25rem; }
|
|---|
| 32 | .bl-form { display: flex; gap: .5rem; margin: 0 0 1.25rem; flex-wrap: wrap; }
|
|---|
| 33 | .bl-form input { flex: 1; min-width: 220px; height: 2.4rem; padding: 0 .9rem; border-radius: 999px; font: inherit;
|
|---|
| 34 | 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); }
|
|---|
| 35 | .bl-empty { color: var(--ink-soft, #888); }
|
|---|
| 36 | .bl-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
|
|---|
| 37 | .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); }
|
|---|
| 38 | .bl-kind { font-size: 1.05rem; }
|
|---|
| 39 | .bl-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|---|
| 40 | .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; }
|
|---|
| 41 | .bl-unblock:hover { color: var(--ink, #000); }
|
|---|
| 42 | </style>
|
|---|