{% extends 'pipeline/base.html' %} {% load i18n %} {% block page_title %}{{ flow.name }}{% endblock %} {% block header_nav_brand %} {% trans "Pipeline" %} {{ flow.name }} {% endblock header_nav_brand %} {% block pipeline_content %}
{# ── Flow header ─────────────────────────────────────────────────────── #}

{{ flow.name }}

{{ flow.get_flow_type_display }} {% if flow.status == 'draft' %} {% trans "Preview (Draft)" %} {% endif %}
{% if flow.description %}

{{ flow.description }}

{% endif %}
{{ completed_count }} / {{ total_count }} {% trans "steps complete" %}
{# ===== Left Sidebar: Step List ====================================== #} {# /sidebar #} {# ===== Right Panel: Step Content ==================================== #}
{% if all_complete %} {# ── Completion card ─────────────────────────────────────────── #}

{% trans "Flow Complete!" %}

{% if complete_body_html %}
{{ complete_body_html|safe }}
{% else %}

{% blocktrans with name=flow.name %}You have completed all required steps in {{ name }}. Well done!{% endblocktrans %}

{% endif %}
{% elif current %} {# ── Active step card ─────────────────────────────────────────── #}
{% if current.complete %} {% elif current.effective_type == 'acknowledgement' %} {% elif current.effective_type == 'service_check' %} {% else %} {% endif %} {{ current.step.name }}
{% if current.step.optional %} {% trans "Optional" %} {% endif %} {{ current.step.get_step_type_display }}
{# Step body text (rendered Markdown) #} {% if current.body_html %}
{{ current.body_html|safe }}
{% endif %} {# ── filter_check: requirements checklist ─────────────── #} {% if current.effective_type == 'filter_check' and current.check_details %}
{% trans "Requirements" %}
{% for check in current.check_details %}
{% if check.passed %} {% else %} {% endif %} {{ check.label }}
{% endfor %}
{% endif %} {# ── service_check: service status ─────────────────────── #} {% if current.effective_type == 'service_check' %} {% endif %}
{# /card-body #} {# ── Card footer: CTA ─────────────────────────────────────── #} {% if not current.complete %} {% else %} {# Step is complete — show a continue button to the next step #} {% endif %}
{# /step card #} {% else %} {# ── Fallback: all optional steps incomplete but no required steps ─ #}

{% trans "All required steps are complete." %}

{% endif %} {# ── Step navigation (prev / next) ─────────────────────────────── #} {% if steps|length > 1 %}
{% with prev_step=None %} {% for s in steps %} {% if current and s.step.pk == current.step.pk %} {# Previous button logic is handled via JS or a templatetag in Phase 2 #} {% endif %} {% endfor %} {% endwith %}
{% endif %}
{# /right panel #}
{# /row #}
{# /container-fluid #} {% endblock pipeline_content %}