| 1 | <div class="container admin-page">
|
|---|
| 2 | <h1><%= t('aepk.title') %></h1>
|
|---|
| 3 | <p><a href="/admin" class="btn">← <%= t('aepk.back_admin') %></a> <a href="/pers" class="btn" target="_blank" rel="noopener">📰 <%= t('aepk.view_epk') %></a></p>
|
|---|
| 4 |
|
|---|
| 5 | <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 6 |
|
|---|
| 7 | <section class="set-card">
|
|---|
| 8 | <h2><%= t('aepk.text_heading') %></h2>
|
|---|
| 9 | <p class="set-help">
|
|---|
| 10 | <%= t('aepk.text_help') %>
|
|---|
| 11 | </p>
|
|---|
| 12 |
|
|---|
| 13 | <form method="post" action="/admin/epk" class="set-form">
|
|---|
| 14 | <label class="set-field">
|
|---|
| 15 | <span><%= t('aepk.bio_label') %></span>
|
|---|
| 16 | <textarea name="epk_bio" rows="5" maxlength="1000"
|
|---|
| 17 | placeholder="<%= t('aepk.bio_ph') %>"><%= epkBio %></textarea>
|
|---|
| 18 | </label>
|
|---|
| 19 | <label class="set-field">
|
|---|
| 20 | <span><%= t('aepk.contact_label') %></span>
|
|---|
| 21 | <input type="text" name="epk_contact" maxlength="300"
|
|---|
| 22 | placeholder="<%= t('aepk.contact_ph') %>"
|
|---|
| 23 | value="<%= epkContact %>">
|
|---|
| 24 | </label>
|
|---|
| 25 |
|
|---|
| 26 | <div class="set-field">
|
|---|
| 27 | <span><%= t('aepk.tracks_label') %> <small><%= t('aepk.tracks_hint', { n: maxEpkTracks }) %></small></span>
|
|---|
| 28 | <% if (!allTracks.length) { %>
|
|---|
| 29 | <p class="set-help" style="margin:0"><%= t('aepk.no_tracks') %></p>
|
|---|
| 30 | <% } else { %>
|
|---|
| 31 | <% var _untitled = t('aepk.untitled'); %>
|
|---|
| 32 | <div class="epk-track-pick" data-max="<%= maxEpkTracks %>">
|
|---|
| 33 | <% allTracks.forEach(function(t){ %>
|
|---|
| 34 | <label class="epk-pick-item">
|
|---|
| 35 | <input type="checkbox" name="epk_tracks" value="<%= t.id %>" <%= chosenTracks.indexOf(t.id) >= 0 ? 'checked' : '' %>>
|
|---|
| 36 | <span class="epk-box" aria-hidden="true">✓</span>
|
|---|
| 37 | <span class="epk-pick-title"><%= t.title || _untitled %></span>
|
|---|
| 38 | <% if (t.artist) { %><span class="epk-pick-artist"><%= t.artist %></span><% } %>
|
|---|
| 39 | </label>
|
|---|
| 40 | <% }); %>
|
|---|
| 41 | </div>
|
|---|
| 42 | <% } %>
|
|---|
| 43 | </div>
|
|---|
| 44 |
|
|---|
| 45 | <button type="submit" class="btn btn-primary"><%= t('aepk.save') %></button>
|
|---|
| 46 | </form>
|
|---|
| 47 | </section>
|
|---|
| 48 | </div>
|
|---|
| 49 |
|
|---|
| 50 | <style>
|
|---|
| 51 | .admin-page .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; margin-top: 1rem; }
|
|---|
| 52 | .admin-page .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 0.5rem; }
|
|---|
| 53 | .admin-page .set-help { font-size: 0.85rem; color: var(--ink-soft, var(--ink-muted)); line-height: 1.5; margin: 0 0 1rem; max-width: 60ch; }
|
|---|
| 54 | .admin-page .set-form { display: flex; flex-direction: column; gap: 1rem; max-width: 520px; }
|
|---|
| 55 | .admin-page .set-field { display: flex; flex-direction: column; gap: 0.3rem; }
|
|---|
| 56 | .admin-page .set-field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 57 | .admin-page .set-field input,
|
|---|
| 58 | .admin-page .set-field textarea {
|
|---|
| 59 | width: 100%; box-sizing: border-box;
|
|---|
| 60 | padding: 0.6rem 0.75rem;
|
|---|
| 61 | border: 1px solid var(--rule); border-radius: 6px;
|
|---|
| 62 | background: var(--paper); color: var(--ink);
|
|---|
| 63 | font-family: var(--font-ui, system-ui), sans-serif; font-size: 0.95rem;
|
|---|
| 64 | -webkit-appearance: none; appearance: none;
|
|---|
| 65 | }
|
|---|
| 66 | .admin-page .set-field textarea { resize: vertical; line-height: 1.5; }
|
|---|
| 67 | .admin-page .set-field input:focus,
|
|---|
| 68 | .admin-page .set-field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
|
|---|
| 69 | .admin-page .set-form .btn { align-self: flex-start; }
|
|---|
| 70 | .admin-page .epk-track-pick { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 8px; padding: 4px; }
|
|---|
| 71 | .admin-page .epk-pick-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
|
|---|
| 72 | .admin-page .epk-pick-item:hover { background: var(--paper); }
|
|---|
| 73 | /* Native checkbox verbergen; we tekenen een eigen, duidelijk vakje (.epk-box). */
|
|---|
| 74 | .admin-page .epk-pick-item input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
|
|---|
| 75 | .admin-page .epk-box {
|
|---|
| 76 | flex: 0 0 auto; width: 20px; height: 20px;
|
|---|
| 77 | border: 2px solid var(--rule); border-radius: 5px;
|
|---|
| 78 | display: grid; place-items: center;
|
|---|
| 79 | color: transparent; font-size: 13px; font-weight: 900; line-height: 1;
|
|---|
| 80 | }
|
|---|
| 81 | .admin-page .epk-pick-item:has(input:checked) .epk-box { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|---|
| 82 | /* Aangevinkte rij ook getint. */
|
|---|
| 83 | .admin-page .epk-pick-item:has(input:checked) {
|
|---|
| 84 | background: color-mix(in srgb, var(--accent) 14%, transparent);
|
|---|
| 85 | border-color: color-mix(in srgb, var(--accent) 45%, transparent);
|
|---|
| 86 | }
|
|---|
| 87 | .admin-page .epk-pick-item:has(input:disabled) { opacity: .45; cursor: not-allowed; }
|
|---|
| 88 | .admin-page .epk-pick-title { font-weight: 600; }
|
|---|
| 89 | .admin-page .epk-pick-artist { color: var(--ink-muted, var(--ink-soft)); font-size: 0.85rem; }
|
|---|
| 90 | .admin-page .epk-pick-item input:disabled ~ .epk-pick-title { opacity: 0.45; }
|
|---|
| 91 | </style>
|
|---|
| 92 | <%# Het script van deze pagina staat in assets/js/mod/admin-epk.js (shaer-bqr). %>
|
|---|