source: Klonkt/src/views/pages/admin.ejs@ 7bc636b

main
Last change on this file since 7bc636b was 7bc636b, checked in by Robin <robin@…>, 4 months ago

Initial commit — PrutFolio v1 source (pulled from Hetzner /srv/prutfolio)

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