{% load i18n crispy_forms_tags %} {% comment %} Step form partial. HTMX swaps this whole block into #wizard-body. The stepper is re-included at the top so visited/active states update in lock-step with the form below. Context: step_items, current_step, prev_step, is_first, is_final step_title, step_description informational — no form, just a Next/Start button optional — show a "Skip" button form — None for informational steps {% endcomment %} {% include "conjunto/wizard/_stepper.html" %} {% if step_title %}

{{ step_title }}

{% endif %} {% if step_description %}

{{ step_description }}

{% endif %} {% if informational %}
{% csrf_token %}
{% if prev_step %} {% translate "Back" %} {% endif %}
{% else %}
{% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %} {{ form|crispy }}
{% comment %} Back is navigation, not a form submission — so it isn't the first submit button, which means Enter in a field triggers the primary action (Next/Finish) as expected. It re-renders the previous step via HTMX (href is the no-JS fallback). {% endcomment %} {% if prev_step %} {% translate "Back" %} {% endif %}
{# Primary button is first in DOM (so it's the Enter default); Skip is #} {# rendered to its left via flex `order`. #}
{% if is_final %} {% else %} {% endif %} {% if optional %} {% endif %}
{% endif %}