| 1 | <div class="container admin-page">
|
|---|
| 2 | <h1>Cirkel</h1>
|
|---|
| 3 | <p><a href="/admin/settings" class="btn">← Instellingen</a></p>
|
|---|
| 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">
|
|---|
| 10 | <p class="set-help">De modus staat niet op <strong>Cirkels</strong>. Zet 'm aan bij
|
|---|
| 11 | <a href="/admin/settings">Instellingen</a> om je cirkel-feed te tonen op <code>/cirkel</code>.
|
|---|
| 12 | Je kunt hieronder al wel bronnen klaarzetten.</p>
|
|---|
| 13 | </section>
|
|---|
| 14 | <% } %>
|
|---|
| 15 |
|
|---|
| 16 | <section class="set-card" style="margin-top:1rem">
|
|---|
| 17 | <h2>Mijn zichtbaarheid</h2>
|
|---|
| 18 | <p class="set-help">Doe je mee aan cirkels? Dit maakt je <strong>al-publieke</strong> posts
|
|---|
| 19 | ophaalbaar voor andere Klonkt-sites via een ondertekende feed
|
|---|
| 20 | (<code>/.klonkt/outbox.json</code>). Het is een deelname-keuze, geen privacy-slot:
|
|---|
| 21 | je posts blijven sowieso openbaar op je site, ook als dit uit staat. Wil je iets
|
|---|
| 22 | afschermen, maak die post dan niet-publiek.</p>
|
|---|
| 23 | <form method="post" action="/admin/circle/allow" class="set-form">
|
|---|
| 24 | <label class="set-opt" style="align-items:center">
|
|---|
| 25 | <input type="checkbox" name="allow_circle" value="on" <%= allowCircle ? 'checked' : '' %>>
|
|---|
| 26 | <span><strong>Toon mijn site in cirkels van anderen</strong></span>
|
|---|
| 27 | </label>
|
|---|
| 28 | <button type="submit" class="btn btn-primary">Opslaan</button>
|
|---|
| 29 | </form>
|
|---|
| 30 | </section>
|
|---|
| 31 |
|
|---|
| 32 | <section class="set-card" style="margin-top:1rem">
|
|---|
| 33 | <h2>Klonkt-site toevoegen</h2>
|
|---|
| 34 | <p class="set-help">Plak de basis-URL van een andere Klonkt-site. Asymmetrisch: jij toont
|
|---|
| 35 | hen, los van of zij jou tonen.</p>
|
|---|
| 36 | <form method="post" action="/admin/circle/add" class="set-form">
|
|---|
| 37 | <label class="set-field">
|
|---|
| 38 | <span>URL</span>
|
|---|
| 39 | <input type="url" name="remote_url" placeholder="https://artiest.klonkt.com" required>
|
|---|
| 40 | </label>
|
|---|
| 41 | <label class="set-field">
|
|---|
| 42 | <span>Label <small style="font-weight:400">— optioneel</small></span>
|
|---|
| 43 | <input type="text" name="label" maxlength="80" placeholder="bijv. Joost Klein">
|
|---|
| 44 | </label>
|
|---|
| 45 | <button type="submit" class="btn btn-primary">Toevoegen</button>
|
|---|
| 46 | </form>
|
|---|
| 47 | </section>
|
|---|
| 48 |
|
|---|
| 49 | <section class="set-card" style="margin-top:1rem">
|
|---|
| 50 | <h2>In mijn cirkel (<%= links.length %>)</h2>
|
|---|
| 51 | <% if (!links.length) { %>
|
|---|
| 52 | <p class="set-help">Nog geen bronnen. Voeg er hierboven een toe.</p>
|
|---|
| 53 | <% } else { %>
|
|---|
| 54 | <ul class="circ-list">
|
|---|
| 55 | <% links.forEach(function(l){ %>
|
|---|
| 56 | <li class="circ-item">
|
|---|
| 57 | <div class="circ-main">
|
|---|
| 58 | <strong><%= l.label || l.remote_url %></strong>
|
|---|
| 59 | <small><%= l.remote_url %></small>
|
|---|
| 60 | <div class="circ-status">
|
|---|
| 61 | <% if (l.status === 'active') { %>
|
|---|
| 62 | <span class="circ-badge ok">✓ actief</span>
|
|---|
| 63 | <span class="circ-meta"><%= counts[l.id] || 0 %> posts<% if (l.last_synced) { %> · laatst: <%= l.last_synced %><% } %></span>
|
|---|
| 64 | <% } else if (l.status === 'outdated') { %>
|
|---|
| 65 | <span class="circ-badge err">↻ versie-mismatch</span>
|
|---|
| 66 | <div class="circ-reason"><%= l.last_error || 'Deze site draait een andere Klonkt-protocolversie — bijwerken nodig om te federeren.' %></div>
|
|---|
| 67 | <% } else if (l.status === 'error') { %>
|
|---|
| 68 | <span class="circ-badge err">⚠ fout</span>
|
|---|
| 69 | <% if (l.last_error) { %><div class="circ-reason"><%= l.last_error %></div><% } %>
|
|---|
| 70 | <% } else if (l.status === 'paused') { %>
|
|---|
| 71 | <span class="circ-badge">⏸ gepauzeerd</span>
|
|---|
| 72 | <% } else { %>
|
|---|
| 73 | <%# Onbekende status: toon 'm rauw + eventuele reden i.p.v. stil "gepauzeerd". %>
|
|---|
| 74 | <span class="circ-badge"><%= l.status %></span>
|
|---|
| 75 | <% if (l.last_error) { %><div class="circ-reason"><%= l.last_error %></div><% } %>
|
|---|
| 76 | <% } %>
|
|---|
| 77 | </div>
|
|---|
| 78 | </div>
|
|---|
| 79 | <div class="circ-actions">
|
|---|
| 80 | <form method="post" action="/admin/circle/<%= l.id %>/sync" style="display:inline">
|
|---|
| 81 | <button type="submit" class="btn">Verversen</button>
|
|---|
| 82 | </form>
|
|---|
| 83 | <form method="post" action="/admin/circle/<%= l.id %>/remove" style="display:inline"
|
|---|
| 84 | onsubmit="return confirm('Verwijderen uit je cirkel?')">
|
|---|
| 85 | <button type="submit" class="btn btn-danger">Verwijder</button>
|
|---|
| 86 | </form>
|
|---|
| 87 | </div>
|
|---|
| 88 | </li>
|
|---|
| 89 | <% }); %>
|
|---|
| 90 | </ul>
|
|---|
| 91 | <% } %>
|
|---|
| 92 | </section>
|
|---|
| 93 | </div>
|
|---|
| 94 |
|
|---|
| 95 | <style>
|
|---|
| 96 | .admin-page { max-width: 760px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 97 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 .25rem; }
|
|---|
| 98 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| 99 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 .5rem; }
|
|---|
| 100 | .set-help { color: var(--ink-muted); font-size: .9rem; margin: 0 0 1rem; }
|
|---|
| 101 | .set-form { display: flex; flex-direction: column; gap: 1rem; }
|
|---|
| 102 | .set-opt { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
|
|---|
| 103 | .set-field { display: flex; flex-direction: column; gap: .3rem; }
|
|---|
| 104 | .set-field > span { font-size: .8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 105 | .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; }
|
|---|
| 106 | .set-form .btn, .circ-actions .btn { align-self: flex-start; }
|
|---|
| 107 | .circ-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
|
|---|
| 108 | .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; }
|
|---|
| 109 | .circ-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
|
|---|
| 110 | .circ-main small { color: var(--ink-muted); font-size: .78rem; word-break: break-all; }
|
|---|
| 111 | .circ-actions { display: flex; gap: .4rem; flex-shrink: 0; }
|
|---|
| 112 | .circ-badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 20px; background: var(--rule); white-space: nowrap; }
|
|---|
| 113 | .circ-badge.ok { background: #d1fae5; color: #065f46; }
|
|---|
| 114 | .circ-badge.err { background: #fee2e2; color: #991b1b; }
|
|---|
| 115 | .circ-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .25rem; font-size: .78rem; color: var(--ink-muted); }
|
|---|
| 116 | .circ-meta { color: var(--ink-muted); }
|
|---|
| 117 | /* Reden op een eigen regel onder de badge; normale woordafbreking (geen break-all
|
|---|
| 118 | die hele zinnen midden in woorden knipt — dat zit op de URL-small, niet hier). */
|
|---|
| 119 | .circ-reason { flex-basis: 100%; line-height: 1.4; color: var(--ink-muted); word-break: normal; overflow-wrap: anywhere; }
|
|---|
| 120 | .btn-danger { color: #991b1b; border-color: #fca5a5; }
|
|---|
| 121 | .alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 122 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| 123 | .alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
|
|---|
| 124 | </style>
|
|---|