source: Klonkt/src/views/pages/admin.ejs@ 9f81a09

main
Last change on this file since 9f81a09 was 6e9a95b, checked in by roboburr <roboburr@…>, 3 months ago

Circles: Circle admin button on the Admin page (circle mode)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

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