{% 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' } %}
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 %}{{ 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 %}Adresa: {{ event.address }}
{% endif %} {% if event.contact_person %}Kontakt: {{ event.contact_person }}
{% endif %}{{ event.description }}
{% endif %} {# Spots #}| # | 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 %}
|
Žádné pozice zatím nejsou přidány.
{% endif %} {# Equipment section #}| 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 %} |
Žádný plán vybavení.
{% endif %} {% if current_user.has_permission('event.equipment.plan') and event.status != EventStatus.CANCELLED %} {% endif %}