source: Klonkt/src/views/pages/downloads.ejs@ 8e1af9c

main
Last change on this file since 8e1af9c was 91c0a39, checked in by roboburr <roboburr@…>, 3 months ago

feat(i18n phase 2): admin dashboard + public calendar/downloads translated + language switcher in admin

  • Language switcher (select) also in the admin dashboard → choice for god/admin.
  • Translated: admin dashboard (title, tagline, all shortcuts, statistics, sections, table headers, post row), public calendar (shows) + downloads (incl. fix: loop var 't' shadowed the translate t() → label fetched upfront).
  • Dictionary extended (nl/en/de). Remaining admin sub-pages to follow.

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

  • Property mode set to 100644
File size: 2.3 KB
Line 
1<%
2 var ts = (typeof dlTracks !== 'undefined') ? dlTracks : [];
3 // NB: de loop hieronder gebruikt 't' als track-variabele, die de vertaal-t()
4 // overschaduwt. Daarom het knoplabel hier al ophalen.
5 var _dlBtn = t('downloads.btn');
6%>
7<article class="container post-page">
8 <%- include('../partials/post-nav', { newerPost: (typeof newerPost !== 'undefined' ? newerPost : null), olderPost: (typeof olderPost !== 'undefined' ? olderPost : null) }) %>
9 <section class="dls">
10 <h1 class="dls-h1"><%= t('downloads.title') %></h1>
11 <p class="dls-sub"><%= t('downloads.sub') %></p>
12
13 <% if (!ts.length) { %>
14 <p class="dls-empty"><%= t('downloads.empty') %></p>
15 <% } else { %>
16 <ul class="dls-list">
17 <% ts.forEach(function(t){ %>
18 <li class="dls-item">
19 <% if (t.cover_url) { %><span class="dls-cover" style="background-image:url('<%= t.cover_url %>')"></span><% } else { %><span class="dls-cover dls-cover-empty">♪</span><% } %>
20 <span class="dls-meta">
21 <span class="dls-title"><%= t.title %></span>
22 <% if (t.artist) { %><span class="dls-artist"><%= t.artist %></span><% } %>
23 </span>
24 <a class="dls-btn" href="<%= siteUrlBase %>/download/<%= t.id %>"><%= _dlBtn %></a>
25 </li>
26 <% }); %>
27 </ul>
28 <% } %>
29 </section>
30</article>
31
32<style>
33 .dls { padding: 0 0 64px; }
34 .dls-h1 { font-size: clamp(26px,5vw,38px); margin: 0 0 8px; }
35 .dls-sub { opacity: .8; margin: 0 0 24px; }
36 .dls-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
37 .dls-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid rgba(128,128,128,.2); border-radius: 12px; }
38 .dls-cover { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 8px; background-size: cover; background-position: center; display: grid; place-items: center; }
39 .dls-cover-empty { background: var(--accent,#6b8f71); color: #fff; opacity: .85; }
40 .dls-meta { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
41 .dls-title { font-weight: 600; }
42 .dls-artist { font-size: 12.5px; opacity: .65; }
43 .dls-btn { flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; background: var(--accent,#6b8f71); color: #fff; text-decoration: none; font-weight: 600; font-size: 13.5px; }
44</style>
Note: See TracBrowser for help on using the repository browser.