| 1 | <%
|
|---|
| 2 | var ss = (typeof shows !== 'undefined') ? shows : [];
|
|---|
| 3 | var msg = (typeof msg !== 'undefined') ? msg : '';
|
|---|
| 4 | var smtp = (typeof smtp !== 'undefined') ? smtp : false;
|
|---|
| 5 | var nc = (typeof notifyCount !== 'undefined') ? notifyCount : 0;
|
|---|
| 6 | %>
|
|---|
| 7 | <section class="ash">
|
|---|
| 8 | <p><a href="/admin" class="btn">← <%= t('ashow.back_admin') %></a></p>
|
|---|
| 9 | <h1><%= t('ashow.title') %></h1>
|
|---|
| 10 |
|
|---|
| 11 | <% if (msg) { %><div class="ash-msg ash-<%= (typeof msgKind!=='undefined')?msgKind:'' %>"><%= msg %></div><% } %>
|
|---|
| 12 |
|
|---|
| 13 | <% var agOn = (typeof agendaEnabled !== 'undefined') && agendaEnabled; %>
|
|---|
| 14 | <form method="POST" action="<%= siteUrlBase %>/admin/shows/toggle" style="margin:0 0 14px">
|
|---|
| 15 | <label style="display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:600">
|
|---|
| 16 | <input type="checkbox" name="enabled" value="1" <%= agOn ? 'checked' : '' %> onchange="this.form.submit()" style="width:18px;height:18px;accent-color:var(--accent)">
|
|---|
| 17 | <span><%= t('ashow.show_toggle') %> <small style="font-weight:400;opacity:.7"><%= t('ashow.show_toggle_hint') %></small></span>
|
|---|
| 18 | </label>
|
|---|
| 19 | <noscript><button type="submit" class="btn"><%= t('ashow.save') %></button></noscript>
|
|---|
| 20 | </form>
|
|---|
| 21 | <% if (!agOn) { %><div class="ash-msg"><%= t('ashow.off_notice_1') %> <strong><%= t('ashow.off') %></strong> <%= t('ashow.off_notice_2') %></div><% } %>
|
|---|
| 22 |
|
|---|
| 23 | <p class="ash-note"><strong><%= nc %></strong> <%= t('ashow.subscribers') %>
|
|---|
| 24 | <% if (!smtp) { %><br><%= t('ashow.smtp_warn') %><% } %></p>
|
|---|
| 25 |
|
|---|
| 26 | <form method="POST" action="<%= siteUrlBase %>/admin/shows" class="ash-form">
|
|---|
| 27 | <div class="ash-grid">
|
|---|
| 28 | <label><%= t('ashow.f_date') %><input type="date" name="date" required></label>
|
|---|
| 29 | <label><%= t('ashow.f_time') %><input type="time" name="time"></label>
|
|---|
| 30 | <label><%= t('ashow.f_city') %><input type="text" name="city" required placeholder="Amsterdam"></label>
|
|---|
| 31 | <label><%= t('ashow.f_country') %><input type="text" name="country" placeholder="NL"></label>
|
|---|
| 32 | <label class="ash-wide"><%= t('ashow.f_venue') %><input type="text" name="venue" placeholder="Paradiso"></label>
|
|---|
| 33 | <label class="ash-wide"><%= t('ashow.f_ticket') %><input type="url" name="ticket_url" placeholder="https://..."></label>
|
|---|
| 34 | <label class="ash-wide"><%= t('ashow.f_notes') %><input type="text" name="notes" placeholder="<%= t('ashow.f_notes_ph') %>"></label>
|
|---|
| 35 | </div>
|
|---|
| 36 | <label class="ash-check"><input type="checkbox" name="notify" value="1" <%= smtp ? '' : 'disabled' %>> <%= t('ashow.notify_label') %><%= smtp ? '' : ' ' + t('ashow.smtp_required') %></label>
|
|---|
| 37 | <button type="submit" class="ash-add"><%= t('ashow.add_event') %></button>
|
|---|
| 38 | </form>
|
|---|
| 39 |
|
|---|
| 40 | <% if (ss.length) { %>
|
|---|
| 41 | <% var _delConfirm = t('ashow.del_confirm'); %>
|
|---|
| 42 | <ul class="ash-list">
|
|---|
| 43 | <% ss.forEach(function(s){ %>
|
|---|
| 44 | <li class="ash-item">
|
|---|
| 45 | <span class="ash-when"><%= s.date %><% if (s.time) { %> <%= s.time %><% } %></span>
|
|---|
| 46 | <span class="ash-where"><%= s.city %><% if (s.venue) { %> — <%= s.venue %><% } %></span>
|
|---|
| 47 | <form method="POST" action="<%= siteUrlBase %>/admin/shows/<%= s.id %>/delete" onsubmit="return confirm('<%= _delConfirm %>')" style="margin:0">
|
|---|
| 48 | <button type="submit" class="ash-del">🗑</button>
|
|---|
| 49 | </form>
|
|---|
| 50 | </li>
|
|---|
| 51 | <% }); %>
|
|---|
| 52 | </ul>
|
|---|
| 53 | <% } else { %>
|
|---|
| 54 | <p class="ash-empty"><%= t('ashow.empty') %></p>
|
|---|
| 55 | <% } %>
|
|---|
| 56 | </section>
|
|---|
| 57 |
|
|---|
| 58 | <style>
|
|---|
| 59 | .ash { max-width: 680px; margin: 0 auto; padding: 24px 18px 64px; }
|
|---|
| 60 | .ash h1 { margin: .4rem 0 14px; }
|
|---|
| 61 | .ash-msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
|
|---|
| 62 | .ash-ok { background: rgba(60,160,90,.15); } .ash-bad { background: rgba(200,60,60,.15); }
|
|---|
| 63 | .ash-note { font-size: 13px; opacity: .8; margin: 0 0 18px; }
|
|---|
| 64 | .ash-form { border: 1px solid rgba(128,128,128,.2); border-radius: 14px; padding: 16px; margin-bottom: 24px; }
|
|---|
| 65 | /* Mobiel-eerst: één kolom (twee 1fr-kolommen met niet-krimpbare date/text-inputs
|
|---|
| 66 | liepen samen ~374px > telefoonbreedte). Twee kolommen pas vanaf 520px. */
|
|---|
| 67 | .ash-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
|
|---|
| 68 | @media (min-width: 520px) { .ash-grid { grid-template-columns: 1fr 1fr; } }
|
|---|
| 69 | .ash-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; min-width: 0; }
|
|---|
| 70 | .ash-grid .ash-wide { grid-column: 1 / -1; }
|
|---|
| 71 | .ash-grid input { min-width: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(128,128,128,.4); background: transparent; color: inherit; font: inherit; font-weight: 400; }
|
|---|
| 72 | .ash-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 13.5px; }
|
|---|
| 73 | .ash-add { padding: 10px 18px; border-radius: 10px; border: none; background: var(--accent,#6b8f71); color: #fff; font-weight: 600; cursor: pointer; }
|
|---|
| 74 | .ash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|---|
| 75 | .ash-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(128,128,128,.18); border-radius: 10px; }
|
|---|
| 76 | .ash-when { font-variant-numeric: tabular-nums; font-weight: 600; flex: 0 0 auto; }
|
|---|
| 77 | .ash-where { flex: 1 1 auto; opacity: .85; }
|
|---|
| 78 | .ash-del { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; }
|
|---|
| 79 | .ash-empty { opacity: .7; }
|
|---|
| 80 | </style>
|
|---|