| 1 | <%# Beheer → Media: image library + cleanup (the Audio half links out to /admin/audio). %>
|
|---|
| 2 | <div class="admin-wrap" style="max-width:980px;margin:0 auto;padding:1.5rem 1rem;">
|
|---|
| 3 | <a href="/admin" class="btn" style="margin-bottom:1rem;display:inline-block;">← <%= t('nav.admin') %></a>
|
|---|
| 4 | <h1 style="font-family:var(--display,serif);margin:.2rem 0 1rem;"><%= t('admin.t_media') %></h1>
|
|---|
| 5 |
|
|---|
| 6 | <%- include('../partials/media-tabs', { active: 'images', audioOn: audioOn }) %>
|
|---|
| 7 |
|
|---|
| 8 | <% if (success) { %><p style="background:rgba(60,160,90,.15);border:1px solid rgba(60,160,90,.4);padding:.5rem .8rem;border-radius:8px;"><%= success %></p><% } %>
|
|---|
| 9 |
|
|---|
| 10 | <div style="display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem;">
|
|---|
| 11 | <p style="margin:0;opacity:.75;">
|
|---|
| 12 | <%= items.length %> <%= t('admin.media_count') %><% if (unusedCount) { %> · <strong><%= unusedCount %></strong> <%= t('admin.media_unused') %><% } %>
|
|---|
| 13 | </p>
|
|---|
| 14 | <% if (unusedCount) { %>
|
|---|
| 15 | <button type="button" id="media-cleanup" class="btn" style="background:#b4452e;color:#fff;border-color:#b4452e;">🗑 <%= t('admin.media_cleanup') %> (<%= unusedCount %>)</button>
|
|---|
| 16 | <% } %>
|
|---|
| 17 | </div>
|
|---|
| 18 |
|
|---|
| 19 | <% if (!items.length) { %>
|
|---|
| 20 | <p style="opacity:.7;"><%= t('admin.media_empty') %></p>
|
|---|
| 21 | <% } else { %>
|
|---|
| 22 | <div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1rem;">
|
|---|
| 23 | <% items.forEach(function(it){ %>
|
|---|
| 24 | <div class="media-card" data-file="<%= it.file %>" style="border:1px solid var(--rule,rgba(128,128,128,.25));border-radius:10px;overflow:hidden;background:var(--paper-2,rgba(128,128,128,.06));">
|
|---|
| 25 | <div style="position:relative;aspect-ratio:1;background:#0a0e1a;">
|
|---|
| 26 | <img src="<%= thumb(it.url, 320) %>" alt="" loading="lazy" decoding="async" style="width:100%;height:100%;object-fit:cover;display:block;">
|
|---|
| 27 | <% if (it.hasVideo) { %><span title="animated cover" style="position:absolute;top:6px;right:6px;background:rgba(0,0,0,.6);border-radius:6px;padding:0 6px;font-size:13px;">🎬</span><% } %>
|
|---|
| 28 | <% if (!it.usedCount) { %><span style="position:absolute;top:6px;left:6px;background:#b4452e;color:#fff;border-radius:6px;padding:1px 6px;font-size:11px;"><%= t('admin.media_unused') %></span><% } %>
|
|---|
| 29 | </div>
|
|---|
| 30 | <div style="padding:.5rem .6rem;font-size:13px;">
|
|---|
| 31 | <div style="opacity:.7;"><%= it.kb %> KB · <%= it.usedCount %>×</div>
|
|---|
| 32 | <div style="display:flex;gap:.4rem;margin-top:.45rem;">
|
|---|
| 33 | <button type="button" class="btn" style="padding:3px 8px;font-size:12px;" data-copy="<%= it.url %>"><%= t('admin.media_copy') %></button>
|
|---|
| 34 | <button type="button" class="btn" style="padding:3px 8px;font-size:12px;background:transparent;border-color:#b4452e;color:#b4452e;" data-del="<%= it.file %>">🗑</button>
|
|---|
| 35 | </div>
|
|---|
| 36 | </div>
|
|---|
| 37 | </div>
|
|---|
| 38 | <% }) %>
|
|---|
| 39 | </div>
|
|---|
| 40 | <% } %>
|
|---|
| 41 | </div>
|
|---|
| 42 |
|
|---|
| 43 | <%# Het script staat in assets/js/mod/admin-media.js; de gegevens via partials/page-data.ejs (shaer-bqr). %>
|
|---|
| 44 | <%- include('../partials/page-data', { pageData: { copy: t('admin.media_copy'), delC: t('admin.media_del_confirm'), cleanC: t('admin.media_cleanup_confirm') } }) %>
|
|---|