source: Klonkt/src/views/pages/admin.ejs@ d0cab9d

main
Last change on this file since d0cab9d was 00f669b, checked in by Robin Genis <roboburr@…>, 3 months ago

feat(fediverse-client): notifications inbox (/meldingen)

Aggregates new followers + replies/likes/boosts on your posts into one feed
(getNotifications). New pages/fedi-notifications view + Beheer link. The old
native notifications.ejs (dead since comments removed) is left untouched.

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

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