{% extends "base.html" %} {% block title %}{{ recipe.name }} — {{ _('Task') }} — TieMeasureFlow{% endblock %} {% block content %}
{# The clock follows the operator here too, and brings them back when it expires. #} {% include "components/production_clock.html" %}
{{ _('Seleziona altra ricetta') }}
{{ recipe.code }} {% if recipe.current_version or recipe.version %} v{{ recipe.current_version.version_number if recipe.current_version else recipe.version }} {% endif %}

{{ recipe.name }}

{% if recipe.description %}

{{ recipe.description }}

{% endif %}
{# Avvia does not start while the recipe is still owed its traceability. The selection screen asks for it first, but this page can be reached directly - by a bookmark, or by going back - and the rule has to hold on whichever door the operator comes through. #} {% set needs_lot = recipe.requires_lot|default(false) and not lot_number %} {% set needs_serial = recipe.requires_serial|default(false) and not serial_number %} {% set missing_trace = ([_('lotto')] if needs_lot else []) + ([_('seriale')] if needs_serial else []) %}
{% if tasks %} {% if missing_trace %} {{ _('Compila prima:') }} {{ missing_trace|join(', ') }} {% else %} {{ _('AVVIA IN SEQUENZA') }} {% endif %} {% endif %} {% if lot_number %}
{{ _('Lotto') }}: {{ lot_number }}
{% endif %} {% if serial_number %}
{{ _('Seriale') }}: {{ serial_number }}
{% endif %}

{{ _('Task da eseguire') }}

{{ tasks|length }} task {%- set total_subs = namespace(count=0) -%} {%- for t in tasks -%} {%- if t.subtask_count is defined -%} {%- set total_subs.count = total_subs.count + t.subtask_count -%} {%- elif t.subtasks -%} {%- set total_subs.count = total_subs.count + t.subtasks|length -%} {%- endif -%} {%- endfor -%} {%- if total_subs.count > 0 %} · {{ total_subs.count }} {{ _('misurazioni totali') }}{% endif %}
{% if tasks %}
{% for task in tasks %} {# How far this task got. A task walked away from halfway through used to look exactly like one never opened; this is what tells them apart. #} {% set prog = (progress|default({})).get(task.id) %}
{{ loop.index }}

{{ task.title or task.name or (_('Task') ~ ' ' ~ loop.index) }}

{% if task.directive or task.description %}

{{ (task.directive or task.description)|rich_text }}

{% endif %}
{# The declared type, so the operator sees what a task is before opening it - and a measurement task still reads as one before its quotes are in. #} {% set task_type_labels = { 'measure': _('Misura'), 'drawing': _('Disegno'), 'note': _('Nota'), 'dxf_compare': _('Confronto profilo'), 'camera_measure': _('Misura camera'), } %} {% set is_measure = task.task_type in ('measure', 'camera_measure') %} {% if task.task_type %} {{ task_type_labels.get(task.task_type, task.task_type) }} {% endif %} {% if prog and prog.state in ('partial', 'complete') %} {% if prog.state == 'complete' %} {{ _('Completato') }} {% else %} {{ _('Incompiuto') }} {% endif %} {{ prog.measured }}/{{ prog.quotes }} {% elif task.subtask_count is defined or task.subtasks %} {% if task.subtask_count is defined %}{{ task.subtask_count }}{% elif task.subtasks %}{{ task.subtasks|length }}{% endif %} {% endif %} {% if task.file_path %} {% if task.file_path.endswith('.pdf') %} {% else %} {% endif %} {% endif %}
{# Opening one task on its own. The sequence is the normal way through the recipe - this is the way back to a task left unfinished, which is why the operator has it now and not only the Maker: a list that says "incompiuto" and gives you no way there would be a complaint, not a feature. #}
{% endfor %}
{% else %}

{{ _('Nessun task disponibile') }}

{{ _('Questa ricetta non ha ancora task definiti.') }}

{% endif %}
{% endblock %}