| 1 | <div class="container admin-page">
|
|---|
| 2 | <h1>Beheer</h1>
|
|---|
| 3 | <% if (tenancy === 'hub') { %>
|
|---|
| 4 | <p class="admin-tagline">Hub-modus — bedrijfssite met gebruikers, elk hun eigen Klonkt Hub.</p>
|
|---|
| 5 | <% } else { %>
|
|---|
| 6 | <p class="admin-tagline">Solo-modus — jouw site.</p>
|
|---|
| 7 | <% } %>
|
|---|
| 8 |
|
|---|
| 9 | <nav class="admin-quick-links" aria-label="Beheer-snelkoppelingen">
|
|---|
| 10 | <% if (tenancy === 'hub') { %>
|
|---|
| 11 | <a href="/admin/sites" class="btn">🌐 Sites</a>
|
|---|
| 12 | <a href="/admin/users" class="btn">👥 Gebruikers</a>
|
|---|
| 13 | <a href="/admin/audio" class="btn">🎵 Audio</a>
|
|---|
| 14 | <a href="/admin/playlists" class="btn">📃 Playlists</a>
|
|---|
| 15 | <a href="/admin/comments" class="btn">💬 Reacties</a>
|
|---|
| 16 | <a href="/admin/settings" class="btn">⚙️ Instellingen</a>
|
|---|
| 17 | <% } else { %>
|
|---|
| 18 | <a href="/posts/new" class="btn">✍️ Nieuwe post</a>
|
|---|
| 19 | <a href="/admin/audio" class="btn">🎵 Audio</a>
|
|---|
| 20 | <a href="/admin/comments" class="btn">💬 Reacties</a>
|
|---|
| 21 | <% if (primarySite) { %>
|
|---|
| 22 | <a href="/admin/sites/<%= primarySite.slug %>/edit" class="btn">🎨 Uiterlijk</a>
|
|---|
| 23 | <% } %>
|
|---|
| 24 | <% if (tenancy === 'circle') { %>
|
|---|
| 25 | <a href="/admin/circle" class="btn">🔗 Cirkel</a>
|
|---|
| 26 | <% } %>
|
|---|
| 27 | <a href="/admin/settings" class="btn">⚙️ Instellingen</a>
|
|---|
| 28 | <% } %>
|
|---|
| 29 | <a href="/admin/updates" class="btn">🔄 Updates</a>
|
|---|
| 30 | </nav>
|
|---|
| 31 |
|
|---|
| 32 | <div class="admin-stats">
|
|---|
| 33 | <% if (tenancy === 'hub') { %>
|
|---|
| 34 | <div class="stat-card"><div class="stat-num"><%= stats.users %></div><div class="stat-label">Gebruikers</div></div>
|
|---|
| 35 | <div class="stat-card"><div class="stat-num"><%= stats.sites %></div><div class="stat-label">Sites</div></div>
|
|---|
| 36 | <% } %>
|
|---|
| 37 | <div class="stat-card"><div class="stat-num"><%= stats.posts %></div><div class="stat-label">Posts</div></div>
|
|---|
| 38 | <div class="stat-card"><div class="stat-num"><%= stats.published %></div><div class="stat-label">Gepubliceerd</div></div>
|
|---|
| 39 | </div>
|
|---|
| 40 |
|
|---|
| 41 | <% if (typeof posts !== 'undefined' && posts && posts.length) { %>
|
|---|
| 42 | <% var _drafts = posts.filter(function(p){ return p.isDraft; }).length; %>
|
|---|
| 43 | <h2>Posts<% if (_drafts) { %> <span class="pl-draftcount"><%= _drafts %> concept<%= _drafts === 1 ? '' : 'en' %></span><% } %></h2>
|
|---|
| 44 | <ul class="post-admin-list">
|
|---|
| 45 | <% posts.forEach(function(p) { %>
|
|---|
| 46 | <li class="pal-row<%= p.isDraft ? ' is-draft' : '' %>">
|
|---|
| 47 | <a class="pal-title" href="<%= p.editUrl %>">
|
|---|
| 48 | <% if (p.isDraft) { %><span class="pal-badge">Concept</span><% } %>
|
|---|
| 49 | <span class="pal-name"><%= p.title || '(zonder titel)' %></span>
|
|---|
| 50 | </a>
|
|---|
| 51 | <span class="pal-actions">
|
|---|
| 52 | <a class="pal-link" href="<%= p.editUrl %>">Bewerken</a>
|
|---|
| 53 | <% if (!p.isDraft) { %><a class="pal-link" href="<%= p.viewUrl %>">Bekijk</a><% } %>
|
|---|
| 54 | </span>
|
|---|
| 55 | </li>
|
|---|
| 56 | <% }); %>
|
|---|
| 57 | </ul>
|
|---|
| 58 | <% } %>
|
|---|
| 59 |
|
|---|
| 60 | <% if (sites && sites.length) { %>
|
|---|
| 61 | <h2>Sites</h2>
|
|---|
| 62 | <table class="admin-table">
|
|---|
| 63 | <thead>
|
|---|
| 64 | <tr><th>Slug</th><th>Title</th><th>Owner</th><th>Created</th></tr>
|
|---|
| 65 | </thead>
|
|---|
| 66 | <tbody>
|
|---|
| 67 | <% sites.forEach(function(s) { %>
|
|---|
| 68 | <tr>
|
|---|
| 69 | <td><code><%= s.slug %></code></td>
|
|---|
| 70 | <td><%= s.title %></td>
|
|---|
| 71 | <td><%= s.owner_username || '—' %></td>
|
|---|
| 72 | <td><%= formatDate(s.created_at) %></td>
|
|---|
| 73 | </tr>
|
|---|
| 74 | <% }); %>
|
|---|
| 75 | </tbody>
|
|---|
| 76 | </table>
|
|---|
| 77 | <% } %>
|
|---|
| 78 |
|
|---|
| 79 | <% if (users && users.length) { %>
|
|---|
| 80 | <h2>Users</h2>
|
|---|
| 81 | <table class="admin-table">
|
|---|
| 82 | <thead>
|
|---|
| 83 | <tr><th>Username</th><th>Email</th><th>Role</th><th>Joined</th></tr>
|
|---|
| 84 | </thead>
|
|---|
| 85 | <tbody>
|
|---|
| 86 | <% users.forEach(function(u) { %>
|
|---|
| 87 | <tr>
|
|---|
| 88 | <td><%= u.username %></td>
|
|---|
| 89 | <td><%= u.email %></td>
|
|---|
| 90 | <td><span class="role-pill role-<%= u.role %>"><%= u.role %></span></td>
|
|---|
| 91 | <td><%= formatDate(u.created_at) %></td>
|
|---|
| 92 | </tr>
|
|---|
| 93 | <% }); %>
|
|---|
| 94 | </tbody>
|
|---|
| 95 | </table>
|
|---|
| 96 | <% } %>
|
|---|
| 97 |
|
|---|
| 98 | </div>
|
|---|
| 99 |
|
|---|
| 100 | <style>
|
|---|
| 101 | .admin-page { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 102 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
|
|---|
| 103 | .admin-page h2 { font-family: var(--font-display, serif); font-size: 1.4rem; margin: 2rem 0 0.75rem; }
|
|---|
| 104 | .admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
|
|---|
| 105 | .admin-tagline em { font-style: normal; opacity: 0.7; }
|
|---|
| 106 |
|
|---|
| 107 | /* Posts/concepten-lijst */
|
|---|
| 108 | .pl-draftcount { font-family: var(--font-ui, system-ui); font-size: 0.8rem; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 0.1rem 0.55rem; border-radius: 99px; vertical-align: middle; }
|
|---|
| 109 | .post-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
|
|---|
| 110 | .pal-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.9rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); transition: border-color 120ms; }
|
|---|
| 111 | .pal-row:hover { border-color: var(--accent); }
|
|---|
| 112 | .pal-row.is-draft { border-left: 3px solid var(--accent); }
|
|---|
| 113 | .pal-title { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
|
|---|
| 114 | .pal-title:hover { color: var(--accent); }
|
|---|
| 115 | .pal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|---|
| 116 | .pal-badge { flex-shrink: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 0.1rem 0.5rem; border-radius: 99px; }
|
|---|
| 117 | .pal-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
|
|---|
| 118 | .pal-link { color: var(--ink-muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
|
|---|
| 119 | .pal-link:hover { color: var(--accent); text-decoration: underline; }
|
|---|
| 120 |
|
|---|
| 121 | /* Quick-links grid — mobile-first.
|
|---|
| 122 | auto-fit + minmax means: as many equal columns as fit, each at least 140px.
|
|---|
| 123 | Mobile (~360-440px): 2 per row.
|
|---|
| 124 | Tablet (~480-700px): 3 per row.
|
|---|
| 125 | Desktop (≥ ~720px): all 5 in a single row. */
|
|---|
| 126 | .admin-quick-links {
|
|---|
| 127 | display: grid;
|
|---|
| 128 | grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|---|
| 129 | gap: 0.5rem;
|
|---|
| 130 | margin: 0 0 1.5rem;
|
|---|
| 131 | padding: 0;
|
|---|
| 132 | }
|
|---|
| 133 | .admin-quick-links .btn {
|
|---|
| 134 | justify-content: center;
|
|---|
| 135 | padding: 0.7rem 0.9rem;
|
|---|
| 136 | font-weight: 600;
|
|---|
| 137 | text-align: center;
|
|---|
| 138 | }
|
|---|
| 139 | .admin-quick-links .btn:hover {
|
|---|
| 140 | background: color-mix(in srgb, var(--accent) 8%, var(--paper-2));
|
|---|
| 141 | border-color: var(--accent);
|
|---|
| 142 | }
|
|---|
| 143 |
|
|---|
| 144 | .admin-stats {
|
|---|
| 145 | display: grid;
|
|---|
| 146 | grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|---|
| 147 | gap: 0.75rem;
|
|---|
| 148 | margin-bottom: 1rem;
|
|---|
| 149 | }
|
|---|
| 150 | .stat-card {
|
|---|
| 151 | background: var(--paper-2);
|
|---|
| 152 | border: 1px solid var(--rule);
|
|---|
| 153 | border-radius: 8px;
|
|---|
| 154 | padding: 1rem 1.25rem;
|
|---|
| 155 | text-align: center;
|
|---|
| 156 | }
|
|---|
| 157 | .stat-num {
|
|---|
| 158 | font-size: 2rem;
|
|---|
| 159 | font-weight: 700;
|
|---|
| 160 | color: var(--accent);
|
|---|
| 161 | line-height: 1;
|
|---|
| 162 | font-family: var(--font-display, serif);
|
|---|
| 163 | }
|
|---|
| 164 | .stat-label {
|
|---|
| 165 | color: var(--ink-muted);
|
|---|
| 166 | font-size: 0.85rem;
|
|---|
| 167 | text-transform: uppercase;
|
|---|
| 168 | letter-spacing: 0.05em;
|
|---|
| 169 | margin-top: 0.25rem;
|
|---|
| 170 | }
|
|---|
| 171 |
|
|---|
| 172 | .admin-table {
|
|---|
| 173 | width: 100%;
|
|---|
| 174 | border-collapse: collapse;
|
|---|
| 175 | background: var(--paper-2);
|
|---|
| 176 | border: 1px solid var(--rule);
|
|---|
| 177 | border-radius: 8px;
|
|---|
| 178 | overflow: hidden;
|
|---|
| 179 | }
|
|---|
| 180 | .admin-table th, .admin-table td {
|
|---|
| 181 | padding: 0.6rem 0.9rem;
|
|---|
| 182 | text-align: left;
|
|---|
| 183 | border-bottom: 1px solid var(--rule);
|
|---|
| 184 | }
|
|---|
| 185 | .admin-table th {
|
|---|
| 186 | background: var(--paper);
|
|---|
| 187 | font-weight: 600;
|
|---|
| 188 | font-size: 0.85rem;
|
|---|
| 189 | text-transform: uppercase;
|
|---|
| 190 | letter-spacing: 0.05em;
|
|---|
| 191 | color: var(--ink-muted);
|
|---|
| 192 | }
|
|---|
| 193 | .admin-table tr:last-child td { border-bottom: 0; }
|
|---|
| 194 | .admin-table code { background: var(--paper); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.85rem; }
|
|---|
| 195 |
|
|---|
| 196 | .role-pill {
|
|---|
| 197 | display: inline-block;
|
|---|
| 198 | padding: 0.1rem 0.5rem;
|
|---|
| 199 | border-radius: 10px;
|
|---|
| 200 | font-size: 0.75rem;
|
|---|
| 201 | text-transform: uppercase;
|
|---|
| 202 | letter-spacing: 0.05em;
|
|---|
| 203 | background: var(--paper);
|
|---|
| 204 | color: var(--ink-muted);
|
|---|
| 205 | }
|
|---|
| 206 | .role-pill.role-god { background: var(--accent); color: white; }
|
|---|
| 207 | .role-pill.role-admin { background: var(--paper); color: var(--accent); border: 1px solid var(--accent); }
|
|---|
| 208 |
|
|---|
| 209 | .admin-todo {
|
|---|
| 210 | margin: 2rem 0 0;
|
|---|
| 211 | padding: 0.75rem 1rem;
|
|---|
| 212 | background: var(--paper-2);
|
|---|
| 213 | border-left: 3px solid var(--accent);
|
|---|
| 214 | border-radius: 4px;
|
|---|
| 215 | font-size: 0.9rem;
|
|---|
| 216 | color: var(--ink-muted);
|
|---|
| 217 | }
|
|---|
| 218 |
|
|---|
| 219 | @media (max-width: 600px) {
|
|---|
| 220 | .admin-table { font-size: 0.85rem; }
|
|---|
| 221 | .admin-table th, .admin-table td { padding: 0.45rem 0.6rem; }
|
|---|
| 222 | }
|
|---|
| 223 | </style>
|
|---|