source: Klonkt/src/views/pages/admin.ejs@ 3bb8719

main
Last change on this file since 3bb8719 was 2149f5a, checked in by roboburr <roboburr@…>, 3 months ago

feat(i18n): language dropdown (NL/EN/DE) in the header nav instead of footer

  • Compact language select in the topnav action row (desktop), codes NL/EN/DE.
  • Footer select only on mobile (desktop has it in the header).
  • Standalone admin dashboard select removed (header select shows on admin too).

style.css?v=27.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 9.8 KB
Line 
1<div class="container admin-page">
2 <h1><%= t('admin.title') %></h1>
3 <% if (tenancy === 'hub') { %>
4 <p class="admin-tagline"><%= t('admin.tagline_hub') %></p>
5 <% } else { %>
6 <p class="admin-tagline"><%= t('admin.tagline_solo') %></p>
7 <% } %>
8
9 <nav class="admin-quick-links" aria-label="Beheer-snelkoppelingen">
10 <% if (tenancy === 'hub') { %>
11 <a href="/admin/sites" class="btn"><%= t('admin.b_sites') %></a>
12 <a href="/admin/users" class="btn"><%= t('admin.b_users') %></a>
13 <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a>
14 <a href="/admin/playlists" class="btn"><%= t('admin.b_playlists') %></a>
15 <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a>
16 <% if (primarySite) { %><a href="/admin/seo" class="btn"><%= t('admin.b_seo') %></a><% } %>
17 <a href="/admin/settings" class="btn"><%= t('admin.b_settings') %></a>
18 <% } else { %>
19 <a href="/posts/new" class="btn"><%= t('admin.b_newpost') %></a>
20 <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a>
21 <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a>
22 <% if (primarySite) { %>
23 <a href="/admin/sites/<%= primarySite.slug %>/edit" class="btn"><%= t('admin.b_look') %></a>
24 <% } else { %>
25 <a href="/admin/sites/new" class="btn"><%= t('admin.b_makesite') %></a>
26 <% } %>
27 <% if (tenancy === 'circle') { %>
28 <a href="/admin/circle" class="btn"><%= t('admin.b_circle') %></a>
29 <% } %>
30 <% if (primarySite) { %><a href="/admin/seo" class="btn"><%= t('admin.b_seo') %></a><% } %>
31 <a href="/admin/settings" class="btn"><%= t('admin.b_settings') %></a>
32 <% } %>
33 <% if (typeof premiumUnlocked === 'undefined' || premiumUnlocked) { %>
34 <a href="/admin/stats" class="btn"><%= t('admin.b_stats') %></a>
35 <a href="/admin/newsletter" class="btn"><%= t('admin.b_newsletter') %></a>
36 <% if (tenancy !== 'hub' && primarySite) { %><a href="/pers" class="btn" target="_blank"><%= t('admin.b_perskit') %></a><% } %>
37 <% if (tenancy !== 'hub' && primarySite) { %><a href="/downloads" class="btn" target="_blank"><%= t('admin.b_downloads') %></a><% } %>
38 <% if (tenancy !== 'hub' && primarySite) { %><a href="/links" class="btn" target="_blank"><%= t('admin.b_linkbio') %></a><% } %>
39 <a href="/admin/shows" class="btn"><%= t('admin.b_agenda') %></a>
40 <% } %>
41 <a href="/admin/settings/google" class="btn"><%= t('admin.b_google') %></a>
42 <a href="/admin/updates" class="btn"><%= t('admin.b_updates') %></a>
43 <a href="/admin/handleiding" class="btn"><%= t('admin.b_help') %></a>
44 </nav>
45
46 <div class="admin-stats">
47 <% if (tenancy === 'hub') { %>
48 <div class="stat-card"><div class="stat-num"><%= stats.users %></div><div class="stat-label"><%= t('admin.st_users') %></div></div>
49 <div class="stat-card"><div class="stat-num"><%= stats.sites %></div><div class="stat-label"><%= t('admin.st_sites') %></div></div>
50 <% } %>
51 <div class="stat-card"><div class="stat-num"><%= stats.posts %></div><div class="stat-label"><%= t('admin.st_posts') %></div></div>
52 <div class="stat-card"><div class="stat-num"><%= stats.published %></div><div class="stat-label"><%= t('admin.st_published') %></div></div>
53 </div>
54
55 <% if (typeof posts !== 'undefined' && posts && posts.length) { %>
56 <% var _drafts = posts.filter(function(p){ return p.isDraft; }).length; %>
57 <h2><%= t('admin.sec_posts') %><% if (_drafts) { %> <span class="pl-draftcount"><%= _drafts %> <%= t('admin.draft').toLowerCase() %><%= _drafts === 1 ? '' : 's' %></span><% } %></h2>
58 <ul class="post-admin-list">
59 <% posts.forEach(function(p) { %>
60 <li class="pal-row<%= p.isDraft ? ' is-draft' : '' %>">
61 <a class="pal-title" href="<%= p.editUrl %>">
62 <% if (p.isDraft) { %><span class="pal-badge"><%= t('admin.draft') %></span><% } %>
63 <span class="pal-name"><%= p.title || '(zonder titel)' %></span>
64 </a>
65 <span class="pal-actions">
66 <a class="pal-link" href="<%= p.editUrl %>"><%= t('admin.edit') %></a>
67 <% if (!p.isDraft) { %><a class="pal-link" href="<%= p.viewUrl %>"><%= t('admin.view') %></a><% } %>
68 </span>
69 </li>
70 <% }); %>
71 </ul>
72 <% } %>
73
74 <% if (sites && sites.length) { %>
75 <h2><%= t('admin.sec_sites') %></h2>
76 <table class="admin-table">
77 <thead>
78 <tr><th><%= t('admin.th_slug') %></th><th><%= t('admin.th_title') %></th><th><%= t('admin.th_owner') %></th><th><%= t('admin.th_created') %></th></tr>
79 </thead>
80 <tbody>
81 <% sites.forEach(function(s) { %>
82 <tr>
83 <td><code><%= s.slug %></code></td>
84 <td><%= s.title %></td>
85 <td><%= s.owner_username || '—' %></td>
86 <td><%= formatDate(s.created_at) %></td>
87 </tr>
88 <% }); %>
89 </tbody>
90 </table>
91 <% } %>
92
93 <% if (users && users.length) { %>
94 <h2><%= t('admin.sec_users') %></h2>
95 <table class="admin-table">
96 <thead>
97 <tr><th><%= t('admin.th_username') %></th><th><%= t('admin.th_email') %></th><th><%= t('admin.th_role') %></th><th><%= t('admin.th_joined') %></th></tr>
98 </thead>
99 <tbody>
100 <% users.forEach(function(u) { %>
101 <tr>
102 <td><%= u.username %></td>
103 <td><%= u.email %></td>
104 <td><span class="role-pill role-<%= u.role %>"><%= u.role %></span></td>
105 <td><%= formatDate(u.created_at) %></td>
106 </tr>
107 <% }); %>
108 </tbody>
109 </table>
110 <% } %>
111
112</div>
113
114<style>
115.admin-page { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }
116.admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
117.admin-page h2 { font-family: var(--font-display, serif); font-size: 1.4rem; margin: 2rem 0 0.75rem; }
118.admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
119.admin-tagline em { font-style: normal; opacity: 0.7; }
120
121/* Posts/concepten-lijst */
122.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; }
123.post-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
124.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; }
125.pal-row:hover { border-color: var(--accent); }
126.pal-row.is-draft { border-left: 3px solid var(--accent); }
127.pal-title { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
128.pal-title:hover { color: var(--accent); }
129.pal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
130.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; }
131.pal-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
132.pal-link { color: var(--ink-muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
133.pal-link:hover { color: var(--accent); text-decoration: underline; }
134
135/* Quick-links grid — mobile-first.
136 auto-fit + minmax means: as many equal columns as fit, each at least 140px.
137 Mobile (~360-440px): 2 per row.
138 Tablet (~480-700px): 3 per row.
139 Desktop (≥ ~720px): all 5 in a single row. */
140.admin-quick-links {
141 display: grid;
142 grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
143 gap: 0.5rem;
144 margin: 0 0 1.5rem;
145 padding: 0;
146}
147.admin-quick-links .btn {
148 justify-content: center;
149 padding: 0.7rem 0.9rem;
150 font-weight: 600;
151 text-align: center;
152}
153.admin-quick-links .btn:hover {
154 background: color-mix(in srgb, var(--accent) 8%, var(--paper-2));
155 border-color: var(--accent);
156}
157
158.admin-stats {
159 display: grid;
160 grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
161 gap: 0.75rem;
162 margin-bottom: 1rem;
163}
164.stat-card {
165 background: var(--paper-2);
166 border: 1px solid var(--rule);
167 border-radius: 8px;
168 padding: 1rem 1.25rem;
169 text-align: center;
170}
171.stat-num {
172 font-size: 2rem;
173 font-weight: 700;
174 color: var(--accent);
175 line-height: 1;
176 font-family: var(--font-display, serif);
177}
178.stat-label {
179 color: var(--ink-muted);
180 font-size: 0.85rem;
181 text-transform: uppercase;
182 letter-spacing: 0.05em;
183 margin-top: 0.25rem;
184}
185
186.admin-table {
187 width: 100%;
188 border-collapse: collapse;
189 background: var(--paper-2);
190 border: 1px solid var(--rule);
191 border-radius: 8px;
192 overflow: hidden;
193}
194.admin-table th, .admin-table td {
195 padding: 0.6rem 0.9rem;
196 text-align: left;
197 border-bottom: 1px solid var(--rule);
198}
199.admin-table th {
200 background: var(--paper);
201 font-weight: 600;
202 font-size: 0.85rem;
203 text-transform: uppercase;
204 letter-spacing: 0.05em;
205 color: var(--ink-muted);
206}
207.admin-table tr:last-child td { border-bottom: 0; }
208.admin-table code { background: var(--paper); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.85rem; }
209
210.role-pill {
211 display: inline-block;
212 padding: 0.1rem 0.5rem;
213 border-radius: 10px;
214 font-size: 0.75rem;
215 text-transform: uppercase;
216 letter-spacing: 0.05em;
217 background: var(--paper);
218 color: var(--ink-muted);
219}
220.role-pill.role-god { background: var(--accent); color: white; }
221.role-pill.role-admin { background: var(--paper); color: var(--accent); border: 1px solid var(--accent); }
222
223.admin-todo {
224 margin: 2rem 0 0;
225 padding: 0.75rem 1rem;
226 background: var(--paper-2);
227 border-left: 3px solid var(--accent);
228 border-radius: 4px;
229 font-size: 0.9rem;
230 color: var(--ink-muted);
231}
232
233@media (max-width: 600px) {
234 .admin-table { font-size: 0.85rem; }
235 .admin-table th, .admin-table td { padding: 0.45rem 0.6rem; }
236}
237</style>
Note: See TracBrowser for help on using the repository browser.