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

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

Admin: dedicated SEO page (/admin/seo) for advanced SEO

The <head> already consumed a rich SEO set (title_template, canonical,
default_description, og_image_default, og_locale, author, *_verification,
facebook_app_id, publisher_*/schema_type for JSON-LD), but many fields
had nowhere to be edited. New god-only page manages the full set for the
primary site, accessible via a 🔎 SEO button in /admin.

The old hidden SEO block in Appearance has been removed (+ its columns
from the appearance-save so saving no longer zeroes them out) and replaced
with a link to the new page — single source of truth.

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

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