feat: concerts button always visible, shows 'Keine Konzerte angekündigt' when empty
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4bb131b219
commit
f04d87254b
3 files changed
+7
-3
No files matched your search
+1
-3
@@ -229,14 +229,12 @@ export async function loadArtistDetail(artist) {
|
||||
actionBar.appendChild(shuffleBtn);
|
||||
}
|
||||
const events = eventsRes.status === 'fulfilled' ? (eventsRes.value || []) : [];
|
||||
if(events.length) {
|
||||
const evBtn = document.createElement('button');
|
||||
evBtn.className = 'artist-action-btn';
|
||||
evBtn.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> Konzerte <span style="font-size:11px;opacity:.7">(${events.length})</span>`;
|
||||
evBtn.innerHTML = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> Konzerte${events.length ? ` <span style="font-size:11px;opacity:.7">(${events.length})</span>` : ''}`;
|
||||
evBtn.onclick = () => openEventsModal(events, artist.name);
|
||||
actionBar.appendChild(evBtn);
|
||||
}
|
||||
}
|
||||
|
||||
if(albEl) { albEl.innerHTML = ''; _renderArtistAlbums(albEl, ndAlbums, iAlbums, artist); }
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@ export function openEventsModal(events, artistName) {
|
||||
if(!modal || !list) return;
|
||||
|
||||
title.textContent = `Konzerte · ${artistName}`;
|
||||
if(!events.length) {
|
||||
list.innerHTML = '<div class="events-empty">Keine Konzerte angekündigt</div>';
|
||||
modal.classList.add('open');
|
||||
return;
|
||||
}
|
||||
list.innerHTML = events.map(e => {
|
||||
const d = new Date(e.datetime);
|
||||
const date = d.toLocaleDateString('de-DE', { day: '2-digit', month: 'short', year: 'numeric' });
|
||||
|
||||
@@ -858,6 +858,7 @@ button:focus{outline:none}
|
||||
.event-book-btn{flex-shrink:0;padding:7px 14px;border-radius:20px;background:var(--accent);color:#fff;font-family:var(--font);font-size:12px;font-weight:700;text-decoration:none;transition:opacity .15s;display:flex;flex-direction:column;align-items:center;gap:2px}
|
||||
.event-book-btn:hover{opacity:.85}
|
||||
.event-sold-badge{font-size:9px;font-weight:600;opacity:.8;letter-spacing:.3px}
|
||||
.events-empty{padding:32px 24px;color:var(--text2);font-size:14px;text-align:center}
|
||||
|
||||
/* ── MISC ── */
|
||||
.spinner{width:28px;height:28px;border:3px solid var(--surface2);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin:50px auto;display:block}
|
||||
|
||||
Reference in new issue
Block a user