source: Klonkt/src/views/pages/my-site.ejs@ c581e5e

main
Last change on this file since c581e5e was 59f0170, checked in by Robin Genis <roboburr@…>, 3 months ago

refactor(comments): remove native comments — social is fediverse-only

Removes routes/comments.js + admin-comments.js (+ mounts), the comment section &
reply UI on posts, comment loading in the post route, the admin moderation page +
links, and the per-site comment-moderation settings. The 'From the fediverse'
section is now the post's comment area. The .comment CSS stays (reused there);
the comments table is left in place (dead) so old-data cascade-deletes still work.

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

  • Property mode set to 100644
File size: 4.8 KB
Line 
1<div class="container admin-page">
2 <p><a href="/" class="btn">&larr; <%= t('myst.overview') %></a></p>
3 <h1><%= t('myst.title') %></h1>
4 <p class="admin-tagline"><%= mySite.title %></p>
5
6 <nav class="admin-quick-links" aria-label="<%= t('myst.quick_links_aria') %>">
7 <a href="/user/<%= mySite.slug %>/posts/new" class="btn">✍️ <%= t('myst.new_post') %></a>
8 <a href="/admin/sites/<%= mySite.slug %>/edit" class="btn">🎨 <%= t('myst.appearance') %></a>
9 <a href="/user/<%= mySite.slug %>" class="btn">👁️ <%= t('myst.view_site') %></a>
10 <a href="/account" class="btn">👤 <%= t('myst.account') %></a>
11 </nav>
12
13 <div class="admin-stats">
14 <div class="stat-card"><div class="stat-num"><%= mine.posts %></div><div class="stat-label"><%= t('myst.posts') %></div></div>
15 <div class="stat-card"><div class="stat-num"><%= mine.published %></div><div class="stat-label"><%= t('myst.published') %></div></div>
16 </div>
17
18 <% if (typeof posts !== 'undefined' && posts && posts.length) { %>
19 <% var _drafts = posts.filter(function(p){ return p.isDraft; }).length; %>
20 <%
21 var _lblBadge = t('myst.draft_badge');
22 var _lblUntitled = t('myst.untitled');
23 var _lblEdit = t('myst.edit');
24 var _lblView = t('myst.view');
25 %>
26 <h2 class="ms-posts-title"><%= t('myst.posts') %><% if (_drafts) { %> <span class="pl-draftcount"><%= _drafts === 1 ? t('myst.draft_count_one', { n: _drafts }) : t('myst.draft_count_many', { n: _drafts }) %></span><% } %></h2>
27 <ul class="post-admin-list">
28 <% posts.forEach(function(p) { %>
29 <li class="pal-row<%= p.isDraft ? ' is-draft' : '' %>">
30 <a class="pal-title" href="<%= p.editUrl %>">
31 <% if (p.isDraft) { %><span class="pal-badge"><%= _lblBadge %></span><% } %>
32 <span class="pal-name"><%= p.title || _lblUntitled %></span>
33 </a>
34 <span class="pal-actions">
35 <a class="pal-link" href="<%= p.editUrl %>"><%= _lblEdit %></a>
36 <% if (!p.isDraft) { %><a class="pal-link" href="<%= p.viewUrl %>"><%= _lblView %></a><% } %>
37 </span>
38 </li>
39 <% }); %>
40 </ul>
41 <% } %>
42</div>
43
44<style>
45.admin-page { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }
46.admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
47.admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
48.admin-quick-links {
49 display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
50 gap: 0.5rem; margin: 0 0 1.5rem; padding: 0;
51}
52.admin-quick-links .btn { justify-content: center; padding: 0.7rem 0.9rem; font-weight: 600; text-align: center; }
53.admin-quick-links .btn:hover { background: color-mix(in srgb, var(--accent) 8%, var(--paper-2)); border-color: var(--accent); }
54.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
55.stat-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem; text-align: center; }
56.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; font-family: var(--font-display, serif); }
57.stat-label { color: var(--ink-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }
58
59/* Posts/concepten-lijst */
60.ms-posts-title { font-family: var(--font-display, serif); font-size: 1.4rem; margin: 2rem 0 0.75rem; }
61.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; }
62.post-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
63.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; }
64.pal-row:hover { border-color: var(--accent); }
65.pal-row.is-draft { border-left: 3px solid var(--accent); }
66.pal-title { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
67.pal-title:hover { color: var(--accent); }
68.pal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
69.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; }
70.pal-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
71.pal-link { color: var(--ink-muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
72.pal-link:hover { color: var(--accent); text-decoration: underline; }
73</style>
Note: See TracBrowser for help on using the repository browser.