{% extends "brickwork/shell/app.html" %} {% load i18n %} {% comment %} Wizard pattern (04-interfaces.md section 4b, 0.14.0, brickwork#59): the structural shell for a multi-step flow. A consuming page EXTENDS this template, never includes it; the pattern itself extends shell/app.html, so every shell block stays available to the extending page. Blocks (semver-public, BR-BW-TPL-001): page_header default: _page_header.html wired from title/description. wizard_stepper default: _stepper.html wired from the steps context var. Override to replace the progress indicator entirely (e.g. to hide it on a single-step confirmation screen). wizard_step default: empty. The current step's own form/content. This is the ONE block a consuming step template exists to fill. wizard_nav default: a nav row with an optional back link (back_url) at the start and the block's own trailing content (typically the step's submit button, which lives INSIDE the step's own
, not here, since the pattern does not own the form element). Renders nothing when both are absent (BR-BW-TPL-006). SERVER-DRIVEN CONTRACT (no client-side wizard state machine, brickwork#59): brickwork ships the progress indicator (_stepper.html) and this thin page scaffold ONLY. The flow itself, the routing between steps, and every step's form are entirely consumer-owned: - Each step is its own server-rendered page at its own URL (e.g. /signup/step-1/, /signup/step-2/), a normal Django view extending this pattern. - The view renders _stepper.html at the CURRENT step (the steps list's status values come from the view comparing the current step number against each step's position; brickwork holds no wizard state of its own) plus that step's form in wizard_step. - A normal POST to the same URL validates the step's form: on success, the view redirects (303/302) to the NEXT step's URL (steps are never submitted via htmx partial swap; this is a full navigation, exactly the no-JS floor for the whole flow, not just this pattern). On validation failure, the view re-renders THIS SAME step with inline errors (the ordinary 422-shaped re-render loop for the form part, matching BR-BW-HTMX-003's contract for a plain form: full-page here, since a wizard step is a page, not an htmx partial). - "Back" is an ordinary link (back_url) to the previous step's URL, not a state rewind: since each step's data was already persisted server- side on that step's successful POST (session, a draft model row, whatever the consumer's own storage is), navigating back and forward again is safe and requires no client memory. - brickwork tracks NONE of this: no session key, no draft model, no step-position cookie. The consumer's own view layer owns state (typically the session, or a draft row keyed to the wizard instance); brickwork's only contribution is the two rendering pieces above. Required context: title, steps (the stepper's own {label, status} list, see _stepper.html). Optional: description, back_url, stepper_orientation. Supplying only title and steps renders a complete working page with an empty wizard_step and wizard_nav (AC-BW-076-shaped). {% endcomment %} {% block page_header %}{% include "brickwork/components/_page_header.html" %}{% endblock %} {% block content %}
{% block wizard_stepper %}{% include "brickwork/components/_stepper.html" with orientation=stepper_orientation %}{% endblock %}
{% block wizard_step %}{% endblock %}
{% block wizard_nav %} {% if back_url %} {% endif %} {% endblock %}
{% endblock %}