{% load i18n brickwork_icons brickwork_components %} {% comment %} Slide-over / side panel (04-interfaces section 4b, 0.14.0, brickwork#55). Consumed by EXTENDING, exactly like _modal.html: a consumer's slide-over partial opens with {% extends "brickwork/components/_slide_over.html" %} and fills the named blocks. Reuses the modal's a11y machinery (dialog semantics, focus trap, dismissal contract) but is edge-anchored instead of centred, so it can sit BESIDE page content rather than over it. DUAL CONSUMPTION, one partial, two documented render paths (BR-BW-HTMX-001, mirroring the modal): 1. htmx path (needs the #bw-slide-over-root container shell/base.html ships from 0.14.0): the trigger is a real anchor carrying hx-get hx-target="#bw-slide-over-root" hx-swap="innerHTML"; the view returns the consumer's slide-over partial and on insertion bwSlideOver opens it as an edge overlay. 2. no-JS floor: the SAME anchor's href is a full-page route; the view (branching on request.htmx) renders the SAME consumer partial inside a full page. With no JavaScript this markup is simply an in-flow, visible panel on that page: the slide-over is then a page, which is the floor. Nothing here is display:none at rest; the scrim and fixed overlay positioning apply only under the JS-set bw-slide-over--open state, so the floor never hides content behind JavaScript. DEDICATED root, not #bw-modal-root (0.14.0 build decision): a modal and a slide-over must be able to coexist open (e.g. a split-shell detail screen where a slide-over sits beside content while a confirm modal opens over it), and #bw-modal-root's own CSS and bwModal's htmx-path auto-open detection are both keyed to that one container. Reusing it would either block that coexistence or force bwModal and bwSlideOver to disambiguate inside a shared root; a second stable root is simpler and matches the one-container-per-overlay-family shape shell/base.html already uses for the modal and toast regions. Named blocks (semver-public, BR-BW-TPL-001): title: Defaults to rendering {{ title }} inside the chrome-owned heading (heading-sm type role). Prefixed slide_over_title was removed in 4.0.0. body: The panel content. A form inside it follows BR-BW-HTMX-003 unchanged (hx-target="this" hx-swap="outerHTML", 422 re-render with inline errors); a failed request NEVER closes the panel (CBH-026 applied here). On success the view closes it server-side: respond 204 (or with OOB toast content) plus HX-Trigger: {"bw:slide-over:close": {"id": ""}}; bwSlideOver listens for bw:slide-over:close at the window. Prefixed slide_over_body was removed in 4.0.0. footer: Empty renders nothing; the filler owns the wrapper element (write ), matching _modal.html's footer convention. Sticky header/footer with a scrolling body. Prefixed slide_over_footer was removed in 4.0.0. A block name this file does not define is SILENTLY DISCARDED by Django: no error, no warning, DEBUG=True does not catch it. Filling a removed prefixed name (slide_over_title, slide_over_body, slide_over_footer) produces a structurally valid, empty region for that fill. body and footer stay markup-only by design (icvoss/django-brickwork#398 sweep): body is the panel content, commonly a form wired to BR-BW-HTMX-003, and footer's filler owns its own