{% extends "base.html" %} {% from 'macros/badges.html' import badge_status, badge_info, badge_secondary %} {% block title %}{{ event.name }} — MedCover{% endblock %} {% block content %} {% set status_colors = { 'Koncept': 'secondary', 'Zveřejněná': 'primary', 'Přihlášky otevřeny': 'success', 'Přihlášky uzavřeny': 'warning', 'Dokončena': 'dark', 'Zrušena': 'danger' } %}

{{ event.name }} {{ badge_status(event.status.value, status_colors, extra_classes='ms-1 fs-6') }} {% if event.archived %} Archivováno {% endif %} {# Event type badge #} {% if event.event_type == EventType.TRAINING %} {{ event.event_type.value }} {% elif event.event_type == EventType.PRESENTATION %} {{ event.event_type.value }} {% endif %} {% if event.paid %}Placená{% else %}Neplacená{% endif %} {{ event.staffing_status }}

{{ event.master_event.name }}

{% if current_user.has_permission('event.edit') and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %} Upravit {% endif %} {# Lifecycle transition buttons #} {% if event.status == EventStatus.DRAFT and current_user.has_permission('event.publish') %}
{% endif %} {% if event.status == EventStatus.PUBLISHED and current_user.has_permission('event.assignments.open') %}
{% endif %} {% if event.status == EventStatus.ASSIGNMENTS_OPEN and current_user.has_permission('event.assignments.close') %}
{% endif %} {% if event.status == EventStatus.ASSIGNMENTS_CLOSED and current_user.has_permission('event.assignments.open') %}
{% endif %} {% if event.status == EventStatus.COMPLETED %} {% set my_assignment = event.spots | selectattr('assignment') | selectattr('assignment.user_id', 'equalto', current_user.id) | map(attribute='assignment') | first | default(none) %} {% if my_assignment %} {% if my_assignment.debriefing %} Zobrazit debriefing {% else %} Vyplnit debriefing {% endif %} {% endif %} {% if current_user.has_any_permission('debriefing.view_all', 'debriefing.manage') %} Přehled debriefingů {% endif %} {% endif %} {% if event.status == EventStatus.CANCELLED and current_user.has_permission('event.restore') %}
{% endif %} {% if event.status != EventStatus.COMPLETED and event.status != EventStatus.CANCELLED and current_user.has_permission('event.cancel') %}
{% endif %} {% if event.status != EventStatus.COMPLETED and event.status != EventStatus.CANCELLED and current_user.has_permission('event.create') %} {% endif %} {% if not event.archived and current_user.has_permission('event.archive_draft' if event.status == EventStatus.DRAFT else 'event.archive') %}
{% endif %} {% if event.archived and current_user.has_permission('event.unarchive') %}
{% endif %}
{# ── Split modal ──────────────────────────────────────────────────────────── #} {% if event.status != EventStatus.COMPLETED and event.status != EventStatus.CANCELLED and current_user.has_permission('event.create') %} {% endif %} {# Event details #}
Termín

Plánovaný začátek: {{ event.start_datetime | localdt }}

Plánovaný konec: {{ event.end_datetime | localdt }}

{% if event.assignments_open_datetime %} {% if event.assignments_open_datetime <= now %}

Přihlášky otevřeny: {{ event.assignments_open_datetime | localdt }}

{% else %}

Přihlášky se otevřou: {{ event.assignments_open_datetime | localdt }}

{% endif %} {% endif %} {% if event.actual_start_datetime %}

Skutečný začátek: {{ event.actual_start_datetime | localdt }}

Skutečný konec: {{ event.actual_end_datetime | localdt }}

{% if event.event_type == EventType.MEDICAL_COVER %}

Počet ošetřených: {{ event.post_event_count }}

{% elif event.event_type == EventType.TRAINING %} {% if event.post_event_count is not none %}

Skutečný počet účastníků: {{ event.post_event_count }}

{% endif %} {% endif %} {% endif %} {% if event.event_type == EventType.TRAINING and event.planned_participants_count is not none %}

Plánovaný počet účastníků: {{ event.planned_participants_count }}

{% endif %}
Obsazení

{{ event.filled_spots }}/{{ event.total_spots }} pozic obsazeno

Zodpovědná osoba: {% if event.responsible_person %} {{ event.responsible_person.name }} {% else %} Chybí zodpovědná osoba {% endif %}

{% if current_user.has_any_permission("event.set_responsible_person") %} {% if rp_eligible_attendees | length > 1 or (rp_eligible_attendees | length == 1 and event.responsible_person_id != rp_eligible_attendees[0].id) %}
{% endif %} {% endif %}
{% if event.address or event.contact_person %}
Místo a kontakt
{% if event.address %}

Adresa: {{ event.address }}

{% endif %} {% if event.contact_person %}

Kontakt: {{ event.contact_person }}

{% endif %}
{% endif %}
{% if event.description %}

{{ event.description }}

{% endif %} {# Spots #}
Pozice ({{ event.total_spots }})
{% if current_user.has_permission('event.edit') and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %} {% endif %}
{% if current_user.has_permission('event.edit') and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %}
Požadovaná kvalifikace
{% for cred in all_qualifications %}
{% endfor %}
{% endif %} {% if event.spots %}
{% for spot in event.spots %} {% endfor %}
# Popis Požadovaná kvalifikace Přihlášen
{{ loop.index }} {{ spot.description or '—' }} {% if spot.is_optional %} {{ badge_info('volitelná', extra_classes='ms-1 font-65') }} {% endif %} {% if spot.required_qualifications %} {% for q in spot.required_qualifications %} {% if q.is_deleted %} {{ q.name }} {{ badge_secondary('odstraněna', extra_classes='font-65') }}{% if not loop.last %}, {% endif %} {% else %} {{ q.name }}{% if not loop.last %}, {% endif %} {% endif %} {% endfor %} {% else %} — {% endif %} {% if spot.assignment %} {{ spot.assignment.user.name }} {% else %} Volné {% endif %} {# Show ineligible message as plain text outside the button group #} {% if not me_coordinated and not spot.assignment and event.status == EventStatus.ASSIGNMENTS_OPEN and current_user.has_permission('event.assign_own') %} {% set already_assigned = namespace(val=false) %} {% for s in event.spots %}{% if s.assignment and s.assignment.user_id == current_user.id %}{% set already_assigned.val = true %}{% endif %}{% endfor %} {% if not already_assigned.val and not spot.is_eligible(current_user) %} Nekvalifikován {% endif %} {% endif %}
{# Claim own spot — blocked when ME is centrally coordinated (members only) #} {% if not me_coordinated and not spot.assignment and event.status == EventStatus.ASSIGNMENTS_OPEN and current_user.has_permission('event.assign_own') %} {% set already_assigned = namespace(val=false) %} {% for s in event.spots %}{% if s.assignment and s.assignment.user_id == current_user.id %}{% set already_assigned.val = true %}{% endif %}{% endfor %} {% if not already_assigned.val %} {% if spot.is_eligible(current_user) %}
{% endif %} {% endif %} {% endif %} {# Release own assignment — blocked when ME is centrally coordinated #} {% if not me_coordinated and spot.assignment and spot.assignment.user_id == current_user.id and event.status != EventStatus.COMPLETED %}
{% endif %} {# Coordinator/elevated RP: assign another user #} {% if not spot.assignment and can_assign and event.status in [EventStatus.ASSIGNMENTS_OPEN, EventStatus.ASSIGNMENTS_CLOSED] %} {% endif %} {# Coordinator/elevated RP: unassign another user #} {% if spot.assignment and can_assign and event.status != EventStatus.COMPLETED %}
{% endif %} {# Delete spot (no assignment, editor) #} {% if current_user.has_permission('event.edit') and not spot.assignment and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %}
{% endif %} {# Edit spot (editor) #} {% if current_user.has_permission('event.edit') and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %} {% endif %}
{# Collapse: assign another user form #} {% if can_assign and not spot.assignment %}
{% endif %} {# Collapse: edit spot form #} {% if current_user.has_permission('event.edit') and event.status not in [EventStatus.COMPLETED, EventStatus.CANCELLED] %}
{% for cred in all_qualifications %}
{% endfor %}
{% if spot.assignment %}

⚠️ Uživatel {{ spot.assignment.user.name }} nesplňuje nové požadavky a bude automaticky odhlášen.

{% endif %}
{% endif %}
{% else %}

Žádné pozice zatím nejsou přidány.

{% endif %}
← Zpět na seznam
{# Equipment section #}
Vybavení
{# Equipment plan #}
Plán vybavení
{% if event.equipment_plans %}
{% for plan in event.equipment_plans %} {% set avail = equipment_availability.get(plan.equipment_type_id, 0) %} {% endfor %}
Typ Požadované množství Volné kusy
{{ plan.equipment_type.name }} {{ plan.quantity_required }} {% if avail < plan.quantity_required %} {{ avail }} Nedostatek {% else %} {{ avail }} {% endif %} {% if current_user.has_permission('event.equipment.plan') and event.status != EventStatus.CANCELLED %}
{% endif %}
{% else %}

Žádný plán vybavení.

{% endif %} {% if current_user.has_permission('event.equipment.plan') and event.status != EventStatus.CANCELLED %}
{% endif %}
{% endblock %} {% block extra_scripts %} {% endblock %}