source: Klonkt/src/views/partials/post-nav.ejs@ c73ac64

main
Last change on this file since c73ac64 was 834bcc3, checked in by Robin Genis <roboburr@…>, 3 months ago

i18n: translate Dutch code comments to English across src/

Comments in routes/services/views/config/middleware/assets translated to
English for the public repo. A few dev-facing throw/console message strings
were Englished too. No user-facing UI strings or i18n dictionary values changed
(src/services/i18n.js untouched). Logic unchanged.

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

  • Property mode set to 100644
File size: 3.1 KB
Line 
1<%# Post navigation (Newer link left / Older right) — shared by post.ejs and
2 fan-gate.ejs. Expects newerPost + olderPost in scope. If a neighbour is missing,
3 a greyed-out placeholder keeps every post in the same two-card structure. %>
4<% if ((typeof newerPost !== 'undefined' && newerPost) || (typeof olderPost !== 'undefined' && olderPost)) { %>
5 <nav class="post-nav post-nav--top">
6 <% if (newerPost) { %>
7 <a class="post-nav-prev" href="<%= newerPost._urlBase || '' %>/<%= newerPost.slug %>"<% if (!newerPost._urlBase) { %>
8 hx-get="/<%= newerPost.slug %>?partial=1" hx-target="#pcms-main"
9 hx-push-url="/<%= newerPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
10 <span class="post-nav-label"><% if (newerPost.pinned) { %><span class="post-nav-pin" title="Vastgepind">📌</span> <% } %>← <%= t('postnav.newer') %></span>
11 <span class="post-nav-title"><%= newerPost.title %></span>
12 </a>
13 <% } else { %>
14 <div class="post-nav-prev is-empty" aria-hidden="true">
15 <span class="post-nav-label">← Newer</span>
16 <span class="post-nav-title"><%= t('postnav.newest') %></span>
17 </div>
18 <% } %>
19 <% if (olderPost) { %>
20 <a class="post-nav-next" href="<%= olderPost._urlBase || '' %>/<%= olderPost.slug %>"<% if (!olderPost._urlBase) { %>
21 hx-get="/<%= olderPost.slug %>?partial=1" hx-target="#pcms-main"
22 hx-push-url="/<%= olderPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
23 <span class="post-nav-label"><%= t('postnav.older') %> →<% if (olderPost.pinned) { %> <span class="post-nav-pin" title="Vastgepind">📌</span><% } %></span>
24 <span class="post-nav-title"><%= olderPost.title %></span>
25 </a>
26 <% } else { %>
27 <div class="post-nav-next is-empty" aria-hidden="true">
28 <span class="post-nav-label">Older →</span>
29 <span class="post-nav-title"><%= t('postnav.oldest') %></span>
30 </div>
31 <% } %>
32 </nav>
33<% } %>
34
35<style>
36.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
37/* Above the post: no line/gap above it, but a dividing line BELOW (toward the content). */
38.post-nav--top { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
39.post-nav-prev, .post-nav-next { display: flex; flex-direction: column; padding: 1rem; background: var(--paper-2); border-radius: 6px; text-decoration: none; color: var(--ink); }
40/* Empty slot (no newer/older post): same card, greyed out + not clickable,
41 so every post keeps the same two-card structure. */
42.post-nav-prev.is-empty, .post-nav-next.is-empty { opacity: 0.4; cursor: default; }
43.post-nav-prev.is-empty .post-nav-title, .post-nav-next.is-empty .post-nav-title { font-weight: 400; font-style: italic; color: var(--ink-muted); }
44.post-nav-next { text-align: right; align-items: flex-end; }
45.post-nav-label { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
46.post-nav-title { font-weight: 500; }
47.post-nav-pin { font-size: 0.85em; }
48@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }
49</style>
Note: See TracBrowser for help on using the repository browser.