translate
This commit is contained in:
parent
e7d9c7038d
commit
9ee465dd59
@ -2595,18 +2595,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function approveSub(id) {
|
async function approveSub(id) {
|
||||||
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'approved' }); toast("Angenommen ✓", "success"); renderAdmin(); }
|
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'approved' }); toast("Accepted ✓", "success"); renderAdmin(); }
|
||||||
catch (e) { toast(e.message, "danger"); }
|
catch (e) { toast(e.message, "danger"); }
|
||||||
}
|
}
|
||||||
async function rejectSub(id) {
|
async function rejectSub(id) {
|
||||||
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'rejected' }); toast("Abgelehnt.", "danger"); renderAdmin(); }
|
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'rejected' }); toast("Rejected ✕", "danger"); renderAdmin(); }
|
||||||
catch (e) { toast(e.message, "danger"); }
|
catch (e) { toast(e.message, "danger"); }
|
||||||
}
|
}
|
||||||
async function injectSub(id, ghostName) {
|
async function injectSub(id, ghostName) {
|
||||||
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'approved' }); } catch { }
|
try { await api('PATCH', `/admin/submissions/${id}`, { status: 'approved' }); } catch { }
|
||||||
const g = ghosts.find(x => x.name === ghostName);
|
const g = ghosts.find(x => x.name === ghostName);
|
||||||
openGhostForm(g?.id || null);
|
openGhostForm(g?.id || null);
|
||||||
setTimeout(() => toast("💡 Submission-Info anzeigen: prüfe den Tip!", "info"), 300);
|
setTimeout(() => toast("💡 Show submission info: check the tip!", "info"), 300);
|
||||||
renderAdmin();
|
renderAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2614,8 +2614,8 @@
|
|||||||
function openGhostForm(id) {
|
function openGhostForm(id) {
|
||||||
const g = id ? ghosts.find(x => x.id === id) : null;
|
const g = id ? ghosts.find(x => x.id === id) : null;
|
||||||
editingId = id || null;
|
editingId = id || null;
|
||||||
document.getElementById('em-title').textContent = g ? `Bearbeiten: ${g.name}` : 'Neuen Geist erstellen';
|
document.getElementById('em-title').textContent = g ? `Edit: ${g.name}` : 'New Ghost';
|
||||||
document.getElementById('em-sub').textContent = g ? `Admin · Ghost Editor · ID: ${g.id}` : 'Admin · Ghost Editor · Neu';
|
document.getElementById('em-sub').textContent = g ? `Admin · Ghost Editor · ID: ${g.id}` : 'Admin · Ghost Editor · New';
|
||||||
document.getElementById('ef-name').value = g?.name || '';
|
document.getElementById('ef-name').value = g?.name || '';
|
||||||
document.getElementById('ef-sanity').value = g?.sanity ?? 50;
|
document.getElementById('ef-sanity').value = g?.sanity ?? 50;
|
||||||
document.getElementById('ef-hunt').value = g?.hunt || 'mid';
|
document.getElementById('ef-hunt').value = g?.hunt || 'mid';
|
||||||
@ -2692,19 +2692,19 @@
|
|||||||
const ul = document.getElementById('user-sub-list');
|
const ul = document.getElementById('user-sub-list');
|
||||||
try {
|
try {
|
||||||
const subs = await api('GET', '/api/submissions/mine');
|
const subs = await api('GET', '/api/submissions/mine');
|
||||||
if (!subs.length) { ul.innerHTML = '<div class="empty-state">📭 Du hast noch nichts eingereicht.</div>'; return; }
|
if (!subs.length) { ul.innerHTML = '<div class="empty-state">📭 You have not submitted anything yet.</div>'; return; }
|
||||||
ul.innerHTML = '';
|
ul.innerHTML = '';
|
||||||
subs.forEach(sub => {
|
subs.forEach(sub => {
|
||||||
const tl = sub.type === 'tip' ? '💡 Tip' : sub.type === 'edit' ? '✏️ Korrektur' : '🆕 Neuer Geist';
|
const tl = sub.type === 'tip' ? '💡 Tip' : sub.type === 'edit' ? '✏️ Korrektur' : '🆕 Neuer Geist';
|
||||||
const sc = sub.status === 'approved' ? 'ssa' : sub.status === 'rejected' ? 'ssr' : 'ssp';
|
const sc = sub.status === 'approved' ? 'ssa' : sub.status === 'rejected' ? 'ssr' : 'ssp';
|
||||||
const sl = sub.status === 'approved' ? '✓ Angenommen' : sub.status === 'rejected' ? '✕ Abgelehnt' : '⏳ Ausstehend';
|
const sl = sub.status === 'approved' ? '✓ Accepted' : sub.status === 'rejected' ? '✕ Rejected' : '⏳ Waiting';
|
||||||
const d = document.createElement('div'); d.className = 'usi';
|
const d = document.createElement('div'); d.className = 'usi';
|
||||||
d.innerHTML = `<div class="usi-meta"><span style="font-family:'Cinzel',serif;font-size:13px;color:var(--accent2)">${escH(sub.ghost_name || 'Allgemein')}</span><span style="font-family:'Share Tech Mono',monospace;font-size:9px;color:var(--muted2)">${tl}</span><span class="usi-st ${sc}">${sl}</span><span class="sub-time">${fmtTime(sub.created_at)}</span></div><div style="font-size:13.5px;color:var(--muted2);line-height:1.55;font-style:italic">${escH(sub.content)}</div>${sub.admin_note ? `<div style="font-size:12px;color:var(--accent2);margin-top:6px">Admin: ${escH(sub.admin_note)}</div>` : ''}`;
|
d.innerHTML = `<div class="usi-meta"><span style="font-family:'Cinzel',serif;font-size:13px;color:var(--accent2)">${escH(sub.ghost_name || 'Allgemein')}</span><span style="font-family:'Share Tech Mono',monospace;font-size:9px;color:var(--muted2)">${tl}</span><span class="usi-st ${sc}">${sl}</span><span class="sub-time">${fmtTime(sub.created_at)}</span></div><div style="font-size:13.5px;color:var(--muted2);line-height:1.55;font-style:italic">${escH(sub.content)}</div>${sub.admin_note ? `<div style="font-size:12px;color:var(--accent2);margin-top:6px">Admin: ${escH(sub.admin_note)}</div>` : ''}`;
|
||||||
ul.appendChild(d);
|
ul.appendChild(d);
|
||||||
});
|
});
|
||||||
const approved = subs.filter(s => s.status === 'approved').length;
|
const approved = subs.filter(s => s.status === 'approved').length;
|
||||||
const ub = document.getElementById('badge-user'); ub.textContent = approved; ub.classList.toggle('show', approved > 0);
|
const ub = document.getElementById('badge-user'); ub.textContent = approved; ub.classList.toggle('show', approved > 0);
|
||||||
} catch { ul.innerHTML = '<div class="empty-state">Fehler beim Laden.</div>'; }
|
} catch { ul.innerHTML = '<div class="empty-state">Failed to load.</div>'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── EXPORT ── */
|
/* ── EXPORT ── */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user