| 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 | <small>
|
|---|
| 61 | <% if (l.status === 'active') { %>
|
|---|
| 62 | <span class="circ-badge ok">✓ actief</span>
|
|---|
| 63 | <%= counts[l.id] || 0 %> posts
|
|---|
| 64 | <% if (l.last_synced) { %>· laatst: <%= l.last_synced %><% } %>
|
|---|
| 65 | <% } else if (l.status === 'outdated') { %>
|
|---|
| 66 | <span class="circ-badge err">↻ versie-mismatch</span>
|
|---|
| 67 | <%= l.last_error || 'Deze site draait een andere Klonkt-protocolversie — bijwerken nodig om te federeren.' %>
|
|---|
| 68 | <% } else if (l.status === 'error') { %>
|
|---|
| 69 | <span class="circ-badge err">⚠ fout</span>
|
|---|
| 70 | <%= l.last_error || '' %>
|
|---|
| 71 | <% } else if (l.status === 'paused') { %>
|
|---|
| 72 | <span class="circ-badge">⏸ gepauzeerd</span>
|
|---|
| 73 | <% } else { %>
|
|---|
| 74 | <%# Onbekende status: toon 'm rauw + eventuele reden i.p.v. stil "gepauzeerd". %>
|
|---|
| 75 | <span class="circ-badge"><%= l.status %></span>
|
|---|
| 76 | <%= l.last_error || '' %>
|
|---|
| 77 | <% } %>
|
|---|
| 78 | </small>
|
|---|
| 79 | </div>
|
|---|
| 80 | <div class="circ-actions">
|
|---|
| 81 | <form method="post" action="/admin/circle/<%= l.id %>/sync" style="display:inline">
|
|---|
| 82 | <button type="submit" class="btn">Verversen</button>
|
|---|
| 83 | </form>
|
|---|
| 84 | <form method="post" action="/admin/circle/<%= l.id %>/remove" style="display:inline"
|
|---|
| 85 | onsubmit="return confirm('Verwijderen uit je cirkel?')">
|
|---|
| 86 | <button type="submit" class="btn btn-danger">Verwijder</button>
|
|---|
| 87 | </form>
|
|---|
| 88 | </div>
|
|---|
| 89 | </li>
|
|---|
| 90 | <% }); %>
|
|---|
| 91 | </ul>
|
|---|
| 92 | <% } %>
|
|---|
| 93 | </section>
|
|---|
| 94 | </div>
|
|---|
| 95 |
|
|---|
| 96 | <style>
|
|---|
| 97 | .admin-page { max-width: 760px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 98 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 .25rem; }
|
|---|
| 99 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| 100 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 .5rem; }
|
|---|
| 101 | .set-help { color: var(--ink-muted); font-size: .9rem; margin: 0 0 1rem; }
|
|---|
| 102 | .set-form { display: flex; flex-direction: column; gap: 1rem; }
|
|---|
| 103 | .set-opt { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
|
|---|
| 104 | .set-field { display: flex; flex-direction: column; gap: .3rem; }
|
|---|
| 105 | .set-field > span { font-size: .8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 106 | .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; }
|
|---|
| 107 | .set-form .btn, .circ-actions .btn { align-self: flex-start; }
|
|---|
| 108 | .circ-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
|
|---|
| 109 | .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; }
|
|---|
| 110 | .circ-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
|
|---|
| 111 | .circ-main small { color: var(--ink-muted); font-size: .78rem; word-break: break-all; }
|
|---|
| 112 | .circ-actions { display: flex; gap: .4rem; flex-shrink: 0; }
|
|---|
| 113 | .circ-badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 20px; background: var(--rule); }
|
|---|
| 114 | .circ-badge.ok { background: #d1fae5; color: #065f46; }
|
|---|
| 115 | .circ-badge.err { background: #fee2e2; color: #991b1b; }
|
|---|
| 116 | .btn-danger { color: #991b1b; border-color: #fca5a5; }
|
|---|
| 117 | .alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 118 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| 119 | .alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
|
|---|
| 120 | </style>
|
|---|