diff --git a/partials/landing/main/home.php b/partials/landing/main/home.php index 8c36597..754e8f5 100644 --- a/partials/landing/main/home.php +++ b/partials/landing/main/home.php @@ -222,3 +222,12 @@ try { +
Keine Events gefunden.
'; + + // wire detail buttons + el.list.querySelectorAll('[data-event-detail]').forEach(btn => { + btn.addEventListener('click', () => { + const id = parseInt(btn.getAttribute('data-event-detail'), 10); + const ev = events.find(e => e.id === id); + if (!ev || !el.modal || !el.modalBody || !el.modalTitle) return; + el.modalTitle.textContent = ev.title; + el.modalBody.innerHTML = ` +${ev.teaser}
+ ${ev.locationLabel ? `Ort: ${ev.locationLabel}
` : ''} +Kinder: ${ev.allowKids ? 'Mit Kindern' : 'Ohne Kinder'}
+Sichtbarkeit: ${ev.visibility === 'public' ? 'Öffentlich' : 'Nur Mitglieder'}
+ `; + el.modal.classList.add('open'); + }); + }); }; if (el.chips.length > 0) { @@ -169,6 +191,8 @@ document.addEventListener('DOMContentLoaded', () => { state.region = (el.locInput?.value || '').trim().toLowerCase(); state.topic = el.topicSelect?.value || 'all'; state.age = el.ageSelect?.value || ''; + state.query = state.region; // keep simple search for now + searchState.active = true; renderEvents(); }); } @@ -182,6 +206,7 @@ document.addEventListener('DOMContentLoaded', () => { navigator.geolocation.getCurrentPosition( (pos) => { state.geo = { lat: pos.coords.latitude, lng: pos.coords.longitude }; + searchState.active = false; renderEvents(); }, () => alert('Standort konnte nicht ermittelt werden.') @@ -189,5 +214,11 @@ document.addEventListener('DOMContentLoaded', () => { }); } + // Close modal + document.querySelectorAll('[data-event-modal-close]').forEach(btn => { + btn.addEventListener('click', () => el.modal?.classList.remove('open')); + }); + el.modal?.addEventListener('click', (e) => { if (e.target === el.modal) el.modal.classList.remove('open'); }); + renderEvents(); });