Changeset bbf9d1a in Klonkt for src/views/pages/admin-playlists.ejs
- Timestamp:
- 06/21/2026 02:32:39 PM (3 months ago)
- Branches:
- main
- Children:
- 4885eab
- Parents:
- 929d98d
- File:
-
- 1 edited
-
src/views/pages/admin-playlists.ejs (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/admin-playlists.ejs
r929d98d rbbf9d1a 10 10 <header class="ax-header"> 11 11 <div> 12 <h1> Playlists</h1>12 <h1><%= t('apl.title') %></h1> 13 13 <p class="ax-tagline"> 14 Canonieke playlists. Bewerk een playlist hier en de wijzigingen werken 15 door in álle posts die hem gebruiken via <code>[[playlist:<id>]]</code>. 14 <%= t('apl.tagline_pre') %> <code>[[playlist:<id>]]</code><%= t('apl.tagline_post') %> 16 15 </p> 17 16 </div> … … 21 20 <div class="ax-actions-bar"> 22 21 <button type="button" class="ax-btn ax-btn-primary" id="pl-new-btn"> 23 + Nieuwe playlist22 + <%= t('apl.new_playlist') %> 24 23 </button> 25 24 </div> … … 29 28 <div class="ax-empty"> 30 29 <div class="ax-empty-icon">📃</div> 31 <p> Nog geen playlists.</p>32 <p class="ax-empty-sub"> Maak er een via de knop hierboven, of via de 📃 knop in de post-editor.</p>30 <p><%= t('apl.none') %></p> 31 <p class="ax-empty-sub"><%= t('apl.none_sub') %></p> 33 32 </div> 34 33 </div> 35 34 <% } else { %> 35 <% 36 // Pre-fetch loop labels (defensive — keep `t` calls out of the loop body). 37 var _aplPlaylist = t('apl.pill_playlist'); 38 var _aplAlbum = t('apl.pill_album'); 39 var _aplTrack = t('apl.track'); 40 var _aplTracks = t('apl.tracks'); 41 var _aplCopy = t('apl.copy_click'); 42 var _aplEdit = t('apl.edit'); 43 var _aplDelete = t('apl.delete'); 44 %> 36 45 <ul class="ax-list"> 37 46 <% playlists.forEach(function(p) { %> … … 44 53 <div class="ax-track-title"> 45 54 <%= p.title %> 46 <span class="ax-pill"><%= p.kind === 'playlist' ? '📃 playlist' : '💿 album'%></span>55 <span class="ax-pill"><%= p.kind === 'playlist' ? '📃 ' + _aplPlaylist : '💿 ' + _aplAlbum %></span> 47 56 </div> 48 57 <div class="ax-track-sub"> 49 <span><%= p.track_count %> <%= p.track_count === 1 ? 'track' : 'tracks'%></span>58 <span><%= p.track_count %> <%= p.track_count === 1 ? _aplTrack : _aplTracks %></span> 50 59 <% if (p.artist) { %><span class="ax-track-sep">·</span><span><%= p.artist %></span><% } %> 51 60 <% if (p.year) { %><span class="ax-track-sep">·</span><span><%= p.year %></span><% } %> 52 61 </div> 53 <code class="ax-embed" data-copy="[[playlist:<%= p.id %>]]" title=" Klik om te kopiëren">[[playlist:<%= p.id %>]]</code>62 <code class="ax-embed" data-copy="[[playlist:<%= p.id %>]]" title="<%= _aplCopy %>">[[playlist:<%= p.id %>]]</code> 54 63 </div> 55 64 56 65 <div class="ax-track-actions"> 57 <button type="button" class="ax-icon-btn" data-pl-edit data-id="<%= p.id %>" aria-label=" Bewerken" title="Bewerken">✎</button>58 <button type="button" class="ax-icon-btn ax-icon-btn-danger" data-pl-delete data-id="<%= p.id %>" data-title="<%= p.title %>" aria-label=" Verwijderen" title="Verwijderen">🗑</button>66 <button type="button" class="ax-icon-btn" data-pl-edit data-id="<%= p.id %>" aria-label="<%= _aplEdit %>" title="<%= _aplEdit %>">✎</button> 67 <button type="button" class="ax-icon-btn ax-icon-btn-danger" data-pl-delete data-id="<%= p.id %>" data-title="<%= p.title %>" aria-label="<%= _aplDelete %>" title="<%= _aplDelete %>">🗑</button> 59 68 </div> 60 69 </li> … … 229 238 el.classList.add('is-copied'); 230 239 const original = el.textContent; 231 el.textContent = '✓ gekopieerd';240 el.textContent = '✓ <%= t('apl.copied') %>'; 232 241 setTimeout(() => { el.classList.remove('is-copied'); el.textContent = original; }, 1200); 233 242 } catch (_) { /* fall back to selection */ } … … 247 256 const id = btn.dataset.id; 248 257 const title = btn.dataset.title || id; 249 if (!confirm( `Playlist "${title}" verwijderen? Posts die deze playlist embedden tonen vanaf nu een placeholder.`)) return;258 if (!confirm('<%= t('apl.delete_confirm') %>'.replace('{title}', title))) return; 250 259 try { 251 260 const r = await fetch(`/admin/playlists/api/${encodeURIComponent(id)}/delete`, { … … 256 265 const j = await r.json(); 257 266 if (j.ok) location.reload(); 258 else alert(' Verwijderen mislukt: ' + (j.error || ''));267 else alert('<%= t('apl.delete_failed') %>: ' + (j.error || '')); 259 268 } catch (err) { 260 alert(' Verwijderen mislukt: ' + err.message);269 alert('<%= t('apl.delete_failed') %>: ' + err.message); 261 270 } 262 271 });
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)