| [0091cb7] | 1 | <div class="container admin-page">
|
|---|
| [bbf9d1a] | 2 | <h1><%= t('acir.title') %></h1>
|
|---|
| 3 | <p><a href="/admin/settings" class="btn">← <%= t('acir.back_settings') %></a></p>
|
|---|
| [0091cb7] | 4 |
|
|---|
| 5 | <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 6 | <% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 7 |
|
|---|
| 8 | <% if (tenancy !== 'circle') { %>
|
|---|
| 9 | <section class="set-card">
|
|---|
| [bbf9d1a] | 10 | <p class="set-help"><%= t('acir.mode_off_1') %> <strong><%= t('acir.circles') %></strong>. <%= t('acir.mode_off_2') %>
|
|---|
| 11 | <a href="/admin/settings"><%= t('acir.settings') %></a> <%= t('acir.mode_off_3') %> <code>/cirkel</code>.
|
|---|
| 12 | <%= t('acir.mode_off_4') %></p>
|
|---|
| [0091cb7] | 13 | </section>
|
|---|
| 14 | <% } %>
|
|---|
| 15 |
|
|---|
| 16 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 17 | <h2><%= t('acir.visibility_title') %></h2>
|
|---|
| 18 | <p class="set-help"><%= t('acir.visibility_help_1') %> <strong><%= t('acir.all_public') %></strong> <%= t('acir.visibility_help_2') %>
|
|---|
| 19 | (<code>/.klonkt/outbox.json</code>). <%= t('acir.visibility_help_3') %></p>
|
|---|
| [0091cb7] | 20 | <form method="post" action="/admin/circle/allow" class="set-form">
|
|---|
| 21 | <label class="set-opt" style="align-items:center">
|
|---|
| 22 | <input type="checkbox" name="allow_circle" value="on" <%= allowCircle ? 'checked' : '' %>>
|
|---|
| [bbf9d1a] | 23 | <span><strong><%= t('acir.show_in_circles') %></strong></span>
|
|---|
| [0091cb7] | 24 | </label>
|
|---|
| [bbf9d1a] | 25 | <button type="submit" class="btn btn-primary"><%= t('acir.save') %></button>
|
|---|
| [0091cb7] | 26 | </form>
|
|---|
| 27 | </section>
|
|---|
| 28 |
|
|---|
| 29 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 30 | <h2><%= t('acir.add_title') %></h2>
|
|---|
| 31 | <p class="set-help"><%= t('acir.add_help') %></p>
|
|---|
| [0091cb7] | 32 | <form method="post" action="/admin/circle/add" class="set-form">
|
|---|
| 33 | <label class="set-field">
|
|---|
| [bbf9d1a] | 34 | <span><%= t('acir.url') %></span>
|
|---|
| [2520dcc] | 35 | <input type="text" name="remote_url" inputmode="url" autocapitalize="off" autocorrect="off" spellcheck="false" placeholder="artiest.klonkt.com" required>
|
|---|
| [0091cb7] | 36 | </label>
|
|---|
| [814ad8b] | 37 | <p class="set-help" style="margin:.2rem 0 .6rem"><%= t('acir.name_auto') %></p>
|
|---|
| [bbf9d1a] | 38 | <button type="submit" class="btn btn-primary"><%= t('acir.add') %></button>
|
|---|
| [0091cb7] | 39 | </form>
|
|---|
| 40 | </section>
|
|---|
| 41 |
|
|---|
| 42 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 43 | <h2><%= t('acir.in_circle', { n: links.length }) %></h2>
|
|---|
| [0091cb7] | 44 | <% if (!links.length) { %>
|
|---|
| [bbf9d1a] | 45 | <p class="set-help"><%= t('acir.no_sources') %></p>
|
|---|
| [0091cb7] | 46 | <% } else { %>
|
|---|
| [62b899d] | 47 | <form method="post" action="/admin/circle/sync-all" style="margin:0 0 .9rem">
|
|---|
| [bbf9d1a] | 48 | <button type="submit" class="btn">↻ <%= t('acir.sync_all') %></button>
|
|---|
| [62b899d] | 49 | </form>
|
|---|
| [bbf9d1a] | 50 | <%
|
|---|
| 51 | var _cActive = t('acir.st_active');
|
|---|
| 52 | var _cPosts = t('acir.posts');
|
|---|
| 53 | var _cLast = t('acir.last');
|
|---|
| 54 | var _cMismatch = t('acir.st_mismatch');
|
|---|
| 55 | var _cMismatchReason = t('acir.mismatch_reason');
|
|---|
| 56 | var _cError = t('acir.st_error');
|
|---|
| 57 | var _cPaused = t('acir.st_paused');
|
|---|
| 58 | var _cRefresh = t('acir.refresh');
|
|---|
| 59 | var _cRemove = t('acir.remove');
|
|---|
| 60 | var _cRemoveConfirm = t('acir.remove_confirm');
|
|---|
| 61 | %>
|
|---|
| [0091cb7] | 62 | <ul class="circ-list">
|
|---|
| 63 | <% links.forEach(function(l){ %>
|
|---|
| 64 | <li class="circ-item">
|
|---|
| 65 | <div class="circ-main">
|
|---|
| 66 | <strong><%= l.label || l.remote_url %></strong>
|
|---|
| 67 | <small><%= l.remote_url %></small>
|
|---|
| [151a72c] | 68 | <div class="circ-status">
|
|---|
| [0091cb7] | 69 | <% if (l.status === 'active') { %>
|
|---|
| [bbf9d1a] | 70 | <span class="circ-badge ok">✓ <%= _cActive %></span>
|
|---|
| 71 | <span class="circ-meta"><%= counts[l.id] || 0 %> <%= _cPosts %><% if (l.last_synced) { %> · <%= _cLast %>: <%= l.last_synced %><% } %></span>
|
|---|
| [4fee228] | 72 | <% } else if (l.status === 'outdated') { %>
|
|---|
| [bbf9d1a] | 73 | <span class="circ-badge err">↻ <%= _cMismatch %></span>
|
|---|
| 74 | <div class="circ-reason"><%= l.last_error || _cMismatchReason %></div>
|
|---|
| [0091cb7] | 75 | <% } else if (l.status === 'error') { %>
|
|---|
| [bbf9d1a] | 76 | <span class="circ-badge err">⚠ <%= _cError %></span>
|
|---|
| [151a72c] | 77 | <% if (l.last_error) { %><div class="circ-reason"><%= l.last_error %></div><% } %>
|
|---|
| [4fee228] | 78 | <% } else if (l.status === 'paused') { %>
|
|---|
| [bbf9d1a] | 79 | <span class="circ-badge">⏸ <%= _cPaused %></span>
|
|---|
| [4fee228] | 80 | <% } else { %>
|
|---|
| 81 | <%# Onbekende status: toon 'm rauw + eventuele reden i.p.v. stil "gepauzeerd". %>
|
|---|
| 82 | <span class="circ-badge"><%= l.status %></span>
|
|---|
| [151a72c] | 83 | <% if (l.last_error) { %><div class="circ-reason"><%= l.last_error %></div><% } %>
|
|---|
| [0091cb7] | 84 | <% } %>
|
|---|
| [151a72c] | 85 | </div>
|
|---|
| [0091cb7] | 86 | </div>
|
|---|
| 87 | <div class="circ-actions">
|
|---|
| 88 | <form method="post" action="/admin/circle/<%= l.id %>/sync" style="display:inline">
|
|---|
| [bbf9d1a] | 89 | <button type="submit" class="btn"><%= _cRefresh %></button>
|
|---|
| [0091cb7] | 90 | </form>
|
|---|
| 91 | <form method="post" action="/admin/circle/<%= l.id %>/remove" style="display:inline"
|
|---|
| [bbf9d1a] | 92 | onsubmit="return confirm('<%= _cRemoveConfirm %>')">
|
|---|
| 93 | <button type="submit" class="btn btn-danger"><%= _cRemove %></button>
|
|---|
| [0091cb7] | 94 | </form>
|
|---|
| 95 | </div>
|
|---|
| 96 | </li>
|
|---|
| 97 | <% }); %>
|
|---|
| 98 | </ul>
|
|---|
| 99 | <% } %>
|
|---|
| 100 | </section>
|
|---|
| 101 | </div>
|
|---|
| 102 |
|
|---|
| 103 | <style>
|
|---|
| 104 | .admin-page { max-width: 760px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 105 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 .25rem; }
|
|---|
| 106 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| 107 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 .5rem; }
|
|---|
| 108 | .set-help { color: var(--ink-muted); font-size: .9rem; margin: 0 0 1rem; }
|
|---|
| 109 | .set-form { display: flex; flex-direction: column; gap: 1rem; }
|
|---|
| 110 | .set-opt { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
|
|---|
| 111 | .set-field { display: flex; flex-direction: column; gap: .3rem; }
|
|---|
| 112 | .set-field > span { font-size: .8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 113 | .set-field input { width: 100%; box-sizing: border-box; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
|
|---|
| 114 | .set-form .btn, .circ-actions .btn { align-self: flex-start; }
|
|---|
| 115 | .circ-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
|
|---|
| 116 | .circ-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .75rem 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); flex-wrap: wrap; }
|
|---|
| 117 | .circ-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
|
|---|
| 118 | .circ-main small { color: var(--ink-muted); font-size: .78rem; word-break: break-all; }
|
|---|
| 119 | .circ-actions { display: flex; gap: .4rem; flex-shrink: 0; }
|
|---|
| [151a72c] | 120 | .circ-badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 20px; background: var(--rule); white-space: nowrap; }
|
|---|
| [0091cb7] | 121 | .circ-badge.ok { background: #d1fae5; color: #065f46; }
|
|---|
| 122 | .circ-badge.err { background: #fee2e2; color: #991b1b; }
|
|---|
| [151a72c] | 123 | .circ-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .25rem; font-size: .78rem; color: var(--ink-muted); }
|
|---|
| 124 | .circ-meta { color: var(--ink-muted); }
|
|---|
| 125 | /* Reden op een eigen regel onder de badge; normale woordafbreking (geen break-all
|
|---|
| 126 | die hele zinnen midden in woorden knipt — dat zit op de URL-small, niet hier). */
|
|---|
| 127 | .circ-reason { flex-basis: 100%; line-height: 1.4; color: var(--ink-muted); word-break: normal; overflow-wrap: anywhere; }
|
|---|
| [eef691e] | 128 | .btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
|
|---|
| 129 | .btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
|
|---|
| [0091cb7] | 130 | .alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 131 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| 132 | .alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
|
|---|
| 133 | </style>
|
|---|