{% extends "base.html" %} {% block title %}{{ event.title }} - Norda Biznes Hub{% endblock %} {% block extra_css %} {% endblock %} {% block content %} Powrot do kalendarza

{{ event.title }}

Data
{{ event.event_date.strftime('%d.%m.%Y') }}
{% if event.time_start %}
Godzina
{{ event.time_start.strftime('%H:%M') }}{% if event.time_end %} - {{ event.time_end.strftime('%H:%M') }}{% endif %}
{% endif %} {% if event.location %}
Miejsce
{% if event.location_url %} {{ event.location }} {% else %} {{ event.location }} {% endif %}
{% endif %} {% if event.speaker_name %}
Prelegent
{{ event.speaker_name }}
{% endif %}
{% if event.description %}
{{ event.description|safe }}
{% endif %} {% if not event.is_past %}
Chcesz wziac udzial?

{{ event.attendee_count }} osob juz sie zapisalo{% if event.max_attendees %} (limit: {{ event.max_attendees }}){% endif %}

{% else %}

To wydarzenie juz sie odbilo. {{ event.attendee_count }} osob bralo udzial.

{% endif %}
{% if event.attendees %}

Uczestnicy ({{ event.attendee_count }})

{% for attendee in event.attendees %} {{ attendee.user.name or attendee.user.email.split('@')[0] }} {% endfor %}
{% endif %} {% endblock %} {% block extra_js %} const csrfToken = '{{ csrf_token() }}'; async function toggleRSVP() { const btn = document.getElementById('rsvp-btn'); btn.disabled = true; try { const response = await fetch('{{ url_for("calendar_rsvp", event_id=event.id) }}', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken } }); const data = await response.json(); if (data.success) { if (data.action === 'added') { btn.textContent = 'Wypisz sie'; btn.classList.remove('btn-primary'); btn.classList.add('btn-secondary', 'attending'); } else { btn.textContent = 'Wezme udzial'; btn.classList.remove('btn-secondary', 'attending'); btn.classList.add('btn-primary'); } // Refresh page to update attendees list setTimeout(() => location.reload(), 500); } else { alert(data.error || 'Wystapil blad'); } } catch (error) { alert('Blad polaczenia'); } btn.disabled = false; } {% endblock %}