source: Klonkt/src/views/pages/admin.ejs@ 2cc887b

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

tenancy: Prutter in hub only; Account tile removed from admin; tenancy in all views

  • render.js: tenancy in the shared locals -> available in every view/partial.
  • topnav + bottom-tab: Prutter nav only in hub mode (hidden in solo).
  • admin dashboard: duplicate Account removed (already in mini-nav/profile menu).

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

  • Property mode set to 100644
File size: 5.7 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 PrutFolio.</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 <a href="/admin/settings" class="btn">⚙️ Instellingen</a>
25 <% } %>
26 </nav>
27
28 <div class="admin-stats">
29 <% if (tenancy === 'hub') { %>
30 <div class="stat-card"><div class="stat-num"><%= stats.users %></div><div class="stat-label">Gebruikers</div></div>
31 <div class="stat-card"><div class="stat-num"><%= stats.sites %></div><div class="stat-label">Sites</div></div>
32 <% } %>
33 <div class="stat-card"><div class="stat-num"><%= stats.posts %></div><div class="stat-label">Posts</div></div>
34 <div class="stat-card"><div class="stat-num"><%= stats.published %></div><div class="stat-label">Gepubliceerd</div></div>
35 </div>
36
37 <% if (sites && sites.length) { %>
38 <h2>Sites</h2>
39 <table class="admin-table">
40 <thead>
41 <tr><th>Slug</th><th>Title</th><th>Owner</th><th>Created</th></tr>
42 </thead>
43 <tbody>
44 <% sites.forEach(function(s) { %>
45 <tr>
46 <td><code><%= s.slug %></code></td>
47 <td><%= s.title %></td>
48 <td><%= s.owner_username || '—' %></td>
49 <td><%= formatDate(s.created_at) %></td>
50 </tr>
51 <% }); %>
52 </tbody>
53 </table>
54 <% } %>
55
56 <% if (users && users.length) { %>
57 <h2>Users</h2>
58 <table class="admin-table">
59 <thead>
60 <tr><th>Username</th><th>Email</th><th>Role</th><th>Joined</th></tr>
61 </thead>
62 <tbody>
63 <% users.forEach(function(u) { %>
64 <tr>
65 <td><%= u.username %></td>
66 <td><%= u.email %></td>
67 <td><span class="role-pill role-<%= u.role %>"><%= u.role %></span></td>
68 <td><%= formatDate(u.created_at) %></td>
69 </tr>
70 <% }); %>
71 </tbody>
72 </table>
73 <% } %>
74
75</div>
76
77<style>
78.admin-page { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }
79.admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
80.admin-page h2 { font-family: var(--font-display, serif); font-size: 1.4rem; margin: 2rem 0 0.75rem; }
81.admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
82.admin-tagline em { font-style: normal; opacity: 0.7; }
83
84/* Quick-links grid — mobile-first.
85 auto-fit + minmax means: as many equal columns as fit, each at least 140px.
86 Mobile (~360-440px): 2 per row.
87 Tablet (~480-700px): 3 per row.
88 Desktop (≥ ~720px): all 5 in a single row. */
89.admin-quick-links {
90 display: grid;
91 grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
92 gap: 0.5rem;
93 margin: 0 0 1.5rem;
94 padding: 0;
95}
96.admin-quick-links .btn {
97 justify-content: center;
98 padding: 0.7rem 0.9rem;
99 font-weight: 600;
100 text-align: center;
101}
102.admin-quick-links .btn:hover {
103 background: color-mix(in srgb, var(--accent) 8%, var(--paper-2));
104 border-color: var(--accent);
105}
106
107.admin-stats {
108 display: grid;
109 grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
110 gap: 0.75rem;
111 margin-bottom: 1rem;
112}
113.stat-card {
114 background: var(--paper-2);
115 border: 1px solid var(--rule);
116 border-radius: 8px;
117 padding: 1rem 1.25rem;
118 text-align: center;
119}
120.stat-num {
121 font-size: 2rem;
122 font-weight: 700;
123 color: var(--accent);
124 line-height: 1;
125 font-family: var(--font-display, serif);
126}
127.stat-label {
128 color: var(--ink-muted);
129 font-size: 0.85rem;
130 text-transform: uppercase;
131 letter-spacing: 0.05em;
132 margin-top: 0.25rem;
133}
134
135.admin-table {
136 width: 100%;
137 border-collapse: collapse;
138 background: var(--paper-2);
139 border: 1px solid var(--rule);
140 border-radius: 8px;
141 overflow: hidden;
142}
143.admin-table th, .admin-table td {
144 padding: 0.6rem 0.9rem;
145 text-align: left;
146 border-bottom: 1px solid var(--rule);
147}
148.admin-table th {
149 background: var(--paper);
150 font-weight: 600;
151 font-size: 0.85rem;
152 text-transform: uppercase;
153 letter-spacing: 0.05em;
154 color: var(--ink-muted);
155}
156.admin-table tr:last-child td { border-bottom: 0; }
157.admin-table code { background: var(--paper); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.85rem; }
158
159.role-pill {
160 display: inline-block;
161 padding: 0.1rem 0.5rem;
162 border-radius: 10px;
163 font-size: 0.75rem;
164 text-transform: uppercase;
165 letter-spacing: 0.05em;
166 background: var(--paper);
167 color: var(--ink-muted);
168}
169.role-pill.role-god { background: var(--accent); color: white; }
170.role-pill.role-admin { background: var(--paper); color: var(--accent); border: 1px solid var(--accent); }
171
172.admin-todo {
173 margin: 2rem 0 0;
174 padding: 0.75rem 1rem;
175 background: var(--paper-2);
176 border-left: 3px solid var(--accent);
177 border-radius: 4px;
178 font-size: 0.9rem;
179 color: var(--ink-muted);
180}
181
182@media (max-width: 600px) {
183 .admin-table { font-size: 0.85rem; }
184 .admin-table th, .admin-table td { padding: 0.45rem 0.6rem; }
185}
186</style>
Note: See TracBrowser for help on using the repository browser.