source: Klonkt/src/views/pages/downloads.ejs@ b5a09ce2

main
Last change on this file since b5a09ce2 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
RevLine 
[91094a4]1<%
2 var ts = (typeof dlTracks !== 'undefined') ? dlTracks : [];
[91c0a39]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');
[91094a4]6%>
[d68bcf1]7<article class="container post-page">
[d8c6a83]8 <%- include('../partials/post-nav', { newerPost: (typeof newerPost !== 'undefined' ? newerPost : null), olderPost: (typeof olderPost !== 'undefined' ? olderPost : null) }) %>
[d68bcf1]9 <section class="dls">
[91c0a39]10 <h1 class="dls-h1"><%= t('downloads.title') %></h1>
11 <p class="dls-sub"><%= t('downloads.sub') %></p>
[91094a4]12
13 <% if (!ts.length) { %>
[91c0a39]14 <p class="dls-empty"><%= t('downloads.empty') %></p>
[91094a4]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>
[91c0a39]24 <a class="dls-btn" href="<%= siteUrlBase %>/download/<%= t.id %>"><%= _dlBtn %></a>
[91094a4]25 </li>
26 <% }); %>
27 </ul>
28 <% } %>
[d68bcf1]29 </section>
30</article>
[91094a4]31
32<style>
[d68bcf1]33 .dls { padding: 0 0 64px; }
[91094a4]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.