{% extends "layouts/mobile_base.twig" %} {% set active_nav = 'tasks' %} {% block title %}{{ translations.task ?? 'Task' }}{% endblock %} {% block page_title %}{{ translations.task ?? 'Task' }}{% endblock %} {% block page_subtitle %} {{ translations.task_details ?? 'Details & completion' }} {% endblock %} {% block head %} {% endblock %} {% block content %} {% set prio = task.getPriority()|default(0) %} {% set freq = task.getFrequency()|default('') %} {% set mand = task.getIsMandatory() ? 1 : 0 %} {% set isPhotoReq = task.getRequiresPhoto() ? 1 : 0 %} {# Wybór daty wykonania (ważne dla API) #} {% set scheduled_for_date = selected_date|default("now"|date("Y-m-d")) %} {# Godzina (jeśli task ma execution_time) #} {% set scheduled_time = task.getExecutionTime() ? task.getExecutionTime() : '00:00:00' %} {# HERO #}

{{ task.getName() }}

{% if task.getSectionName() %}{{ task.getSectionName() }}{% endif %} {% if task.getCategoryName() %}{{ task.getCategoryName() }}{% endif %} {% if task.getSubcategoryName() %}{{ task.getSubcategoryName() }}{% endif %} {% if prio %}P{{ prio }}{% endif %} {% if mand %}{{ translations.mandatory ?? 'Mandatory' }}{% endif %} {% if isPhotoReq %}{{ translations.photo_required ?? 'Photo required' }}{% endif %}
{{ translations.scheduled_for ?? 'Scheduled for' }}: {{ scheduled_for_date }} {% if scheduled_time and scheduled_time != '00:00:00' %} • {{ scheduled_time|slice(0,5) }} {% endif %}
{# DETAILS #}
{{ translations.details ?? 'Details' }}
{% if task.getDescription() %}
{{ task.getDescription() }}
{% else %}
{{ translations.no_description ?? 'No description.' }}
{% endif %}
{{ translations.metadata ?? 'Info' }}
{{ translations.frequency ?? 'Frequency' }}
{{ freq ?: '-' }}
{{ translations.execution_time ?? 'Execution time' }}
{% if task.getExecutionTime() %}{{ task.getExecutionTime()|slice(0,5) }}{% else %}-{% endif %}
{{ translations.day_of_week ?? 'Day' }}
{{ task.getDayOfWeek() ?: '-' }}
{{ translations.priority ?? 'Priority' }}
{{ prio ?: '-' }}
{# COMPLETION #}
{{ translations.complete_task ?? 'Complete task' }}
{% if isPhotoReq %}
{{ translations.photo_required_hint ?? 'This task requires a photo as proof.' }}
* {{ translations.photo_required_before_done ?? 'You cannot mark it done without a photo.' }}
{% endif %} {% if errors.photo_upload is defined %}
{{ errors.photo_upload }}
{% endif %} {# UWAGA: endpoint w kontrolerze to POST /tasks/{id} #}
{# wymagane przez API #}
{# Foto UI (dopóki API nie przyjmie pliku, backend aplikacji musi to ogarnąć osobno) #}
{# Live camera area #} {# Preview selected / captured photo #}
{{ translations.preview ?? 'Preview' }}
{{ translations.photo_hint ?? 'You can use file picker or open live camera.' }}
{{ translations.back_to_tasks ?? 'Back to tasks' }}
{% endblock %} {% block scripts %} {% endblock %}