{% extends "base.html" %} {% from 'macros/help.html' import help_icon %} {% block title %}{{ "Upravit: " ~ event.name if mode == "edit" else "Nová akce" }} — MedCover{% endblock %} {% block content %}

{%- if mode == "edit" -%}Upravit akci {%- elif template -%}Nová akce ze šablony {%- else -%}Nová akce {%- endif -%}

{% if template %}
📋 Vytváříte akci ze šablony: {{ template.name }}
{% endif %}
{% if mode == "edit" %} {% elif template %} {% endif %}
{# ── Name ──────────────────────────────────────────────────────────── #}
{# ── Event type ────────────────────────────────────────────────────── #}
{# ── Planned participants (training only) ──────────────────────────── #} {# ── Master event ──────────────────────────────────────────────────── #}
{# ── Responsible person ────────────────────────────────────────────── #}
{# ── Start datetime ────────────────────────────────────────────────── #}
{# ── End datetime ──────────────────────────────────────────────────── #}
{# ── Assignments open datetime ─────────────────────────────────────── #}
Prázdné = okamžitě po zveřejnění
{# ── Spots ────────────────────────────────────────────────────────── #}
{% if mode == "edit" %}

Změna pozic v tomto formuláři odstraní stávající přiřazení. Pro jemnou úpravu jednotlivých pozic použijte detail akce.

{% endif %}
{# Priority: 1) POST failure, 2) event spots (edit), 3) template prefill, 4) empty #} {% set spot_total_raw = request.form.get('spot_total', '') %} {% if spot_total_raw %} {% for i in range(spot_total_raw | int) %}
{% set checked_creds = request.form.getlist('spot_cred_' ~ i) | map('int') | list %} {% for cred in all_qualifications %}
{% endfor %}
{% endfor %} {% elif event and event.spots %} {% for spot in event.spots %} {% set i = loop.index0 %}
{% set spot_qual_ids = spot.required_qualifications | map(attribute='id') | list %} {% for cred in all_qualifications %}
{% endfor %}
{% endfor %} {% elif template_spot_prefill is defined and template_spot_prefill %} {% for st in template_spot_prefill %} {% set i = loop.index0 %}
{% for cred in all_qualifications %}
{% endfor %}
{% endfor %} {% endif %}
{# ── Paid ─────────────────────────────────────────────────────────── #}
{% set default_paid = '1' if (event and event.paid) else ('1' if (template and template.paid) else '0') %}
{# ── Address ──────────────────────────────────────────────────────── #}
{# ── Contact person ───────────────────────────────────────────────── #}
{# ── Description ──────────────────────────────────────────────────── #}
{# ── Equipment plan ───────────────────────────────────────────────────── #} {% if all_equipment_types %}
Vybavení {{ help_icon("Plán vybavení pro akci. Uložení bude blokováno, pokud plánujete více kusů, než je k dispozici.") }}
{% set eq_total_raw = request.form.get('eq_total', '') %} {% if eq_total_raw %} {% for i in range(eq_total_raw | int) %} {% set tid = request.form.get('eq_type_id_' ~ i, '') %} {% set qty = request.form.get('eq_qty_' ~ i, '1') %} {% if tid %}
{% endif %} {% endfor %} {% elif event and event.equipment_plans %} {% for plan in event.equipment_plans %}
{% endfor %} {% elif template_eq_plans is defined and template_eq_plans %} {% for tid, qty in template_eq_plans %}
{% endfor %} {% endif %}
{% endif %} {# ── Submit buttons ───────────────────────────────────────────────────── #}
{% if mode == "edit" %} Zrušit {% else %} {% if current_user.has_permission("event.publish") and current_user.has_permission("event.assignments.open") %} {% endif %} Zrušit {% endif %}
{% endblock %} {% block extra_scripts %} {% if mode == "edit" %} {% endif %} {% endblock %}