{% extends "layouts/base.twig" %} {% block title %}{{ translations.checklists_title | default('Checklisty') }}{% endblock %} {% block head %} {% endblock %} {% block page_heading %}

{{ translations.checklists_title | default('Checklisty') }}

{{ translations.checklists_subtitle | default('Przeglądaj zadania dzienne zgrupowane według checklisty.') }}

{% endblock %} {% block content %} {# ── Panel filtrów ── #}
{# Data #}
{# Checklista #}
{# ── Wyniki ── #} {% if progress is not null and progress.checklist is defined %} {# Nagłówek checklisty #}

{{ progress.checklist.name }}

{% if progress.checklist.execution_time %} {{ progress.checklist.execution_time|slice(0,5) }} · {% endif %} {{ selected_date }}
{{ progress.summary.total }}
{{ translations.summary_total | default('Łącznie') }}
{{ progress.summary.done }}
{{ translations.summary_done | default('Wykonane') }}
{{ progress.summary.not_done }}
{{ translations.summary_not_done | default('Niewykonane') }}
{% if progress.summary.total > 0 %}
{% endif %}
{# Lista zadań #} {% if progress.tasks is empty %}

{{ translations.no_tasks | default('Brak zadań dla tej checklisty w wybranym dniu.') }}

{% else %}
{% for task in progress.tasks %} {% set status = task.status ?? 'PENDING' %} {% endfor %}
# {{ translations.col_task | default('Zadanie') }} {{ translations.col_planned_time | default('Planowana godz.') }} {{ translations.col_status | default('Status') }} {{ translations.col_completed_at | default('Zrealizowane') }} {{ translations.col_completed_by | default('Przez') }} {{ translations.col_note | default('Notatka') }} {{ translations.col_action | default('Akcja') }}
{{ loop.index }} {% if task.is_mandatory %} {% endif %} {{ task.name }} {% if task.requires_photo %} {% endif %} {% if task.execution_time %} {{ task.execution_time|slice(0,5) }} {% else %} — {% endif %} {% if status == 'DONE' %} {{ translations.status_done | default('Wykonane') }} {% elseif status == 'SKIPPED' %} {{ translations.status_skipped | default('Pominięte') }} {% elseif status == 'FAILED' %} {{ translations.status_failed | default('Nieudane') }} {% else %} {{ translations.status_pending | default('Oczekuje') }} {% endif %} {% if task.completed_at %} {{ task.completed_at|slice(11,5) }} {% else %} — {% endif %} {% if task.completed_by %} {{ task.completed_by }} {% else %} — {% endif %} {% if task.note %} {{ task.note|slice(0,40) }}{% if task.note|length > 40 %}…{% endif %} {% else %} — {% endif %} {% if status != 'DONE' and status != 'SKIPPED' %} {% else %} — {% endif %}
{% endif %} {% elseif checklists is not empty and selected_checklist_id is empty %} {# Widok listy checklist bez szczegółów #}
{% for cl in checklists %} {% set pct = cl.tasks_total > 0 ? (cl.tasks_done / cl.tasks_total * 100)|round : 0 %}
{{ cl.name }}
{% if cl.execution_time %} {{ cl.execution_time|slice(0,5) }} {% endif %}
{{ cl.tasks_done }} / {{ cl.tasks_total }} {{ translations.tasks_done_of | default('wykonanych') }} {{ pct }}%
{% endfor %}
{% elseif selected_date and checklists is empty %}

{{ translations.no_checklists | default('Brak aktywnych checklist dla wybranego dnia.') }}

{% endif %} {% endblock %} {% block scripts %} {# ── Modal potwierdzenia wykonania zadania ── #} {% endblock %}