{% extends "base.html" %} {% block title %}{{ recipe.code }} — {{ _('Anteprima Ricetta') }} — TieMeasureFlow{% endblock %} {% block extra_head %} {% endblock %} {% block content %}
{# ================================================================ BREADCRUMB ================================================================ #} {# ================================================================ HEADER ================================================================ #}
{# Preview badge #} {{ _('Anteprima') }}

{{ recipe.code }} — {{ recipe.name }}

{% if recipe.current_version %}

{{ _('Versione') }} v{{ recipe.current_version.version_number }}

{% endif %}
{# Action buttons #}
{# ================================================================ PREVIEW BANNER ================================================================ #}

{{ _('Modalita Anteprima') }}

{{ _('Stai vedendo la ricetta come la vedra il Tecnico di Misura. Tutti i campi sono in sola lettura.') }}

{# ================================================================ RECIPE DESCRIPTION (if present) ================================================================ #} {% if recipe.description %}

{{ recipe.description }}

{% endif %} {# ================================================================ TASKS LOOP ================================================================ #} {% if recipe.tasks %} {% for task in recipe.tasks %}
{# ---- Task Header ---- #}
{{ loop.index }}

{{ task.title }}

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

{{ task.directive or task.description }}

{% endif %}
{% if task.subtasks %} {{ task.subtasks|length }} {{ _('misure') }} {% endif %}
{# ---- Technical Drawing / Annotations ---- #} {% if task.file_path and task.file_type == 'image' %}
{{ _('Disegno Tecnico') }}
{% elif task.file_path and task.file_type == 'pdf' %}

{{ _('Documento PDF allegato') }}

{{ task.file_path }}

{{ _('Apri PDF') }}
{% else %}

{{ _('Nessuna immagine allegata') }}

{% endif %} {# ---- Subtask List ---- #} {% if task.subtasks %}
{{ _('Punti di Misura') }}
{% for subtask in task.subtasks %}
{# Subtask header: marker badge + description #}
{{ subtask.marker_number }}

{{ subtask.description }}

{% if subtask.measurement_type %} {{ subtask.measurement_type }} · {% endif %} {{ subtask.unit or 'mm' }}
{# Tolerance parameters grid #}
{# Nominal #}
{{ _('Nominale') }} {% if subtask.nominal is not none %}{{ "%.3f"|format(subtask.nominal) }}{% else %}—{% endif %}
{# LTL #}
LTL {% if subtask.ltl is not none %}{{ "%.3f"|format(subtask.ltl) }}{% else %}—{% endif %}
{# LWL #}
LWL {% if subtask.lwl is not none %}{{ "%.3f"|format(subtask.lwl) }}{% else %}—{% endif %}
{# UWL #}
UWL {% if subtask.uwl is not none %}{{ "%.3f"|format(subtask.uwl) }}{% else %}—{% endif %}
{# UTL #}
UTL {% if subtask.utl is not none %}{{ "%.3f"|format(subtask.utl) }}{% else %}—{% endif %}
{# Visual tolerance bar #} {% if subtask.ltl is not none and subtask.utl is not none %}
{# Nominal center line #}
{{ "%.2f"|format(subtask.ltl) }} {{ "%.2f"|format(subtask.nominal or 0) }} {{ "%.2f"|format(subtask.utl) }}
{% endif %}
{% endfor %}
{% else %}

{{ _('Nessun punto di misura definito per questo task') }}

{% endif %}
{% endfor %} {% else %} {# ---- Empty state: no tasks ---- #}

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

{{ _('Questa ricetta non contiene ancora task di misurazione.') }}

{{ _('Aggiungi Task') }}
{% endif %} {# ================================================================ FOOTER NAVIGATION ================================================================ #}
{{ _('Torna a Ricetta') }}
{% endblock %} {% block extra_js %} {% endblock %}