Files
FabledSteward/steward/templates/_macros.html
T
bvandeusen 389002fc6f
CI / lint (push) Successful in 3s
CI / unit (push) Successful in 8s
CI / integration (push) Successful in 2m18s
CI / publish (push) Successful in 1m2s
feat(ui): breadcrumb navigation across nested pages
Adds a breadcrumb trail to nested views for orientation. Mechanism: a
{% block breadcrumb %} slot in base.html (+ styling) and a shared crumbs()
macro in templates/_macros.html; each nested page fills the block with its
trail (root→current, last item is the current page). Pages without the block
render no bar, so top-level nav roots stay clean.

Applied to: Ansible (browse, schedules, playbook editor, run detail) +
inventory (targets/groups + detail), host_agent (fleet, host detail,
settings), hosts form, settings tabs (ansible/auth/notifications/plugins/
reports + plugin detail), dashboard (list, edit), and alerts (rule form,
maintenance + new). Dynamic labels (host/target/run/dashboard names) come
from the page context — no route changes. All 60 templates Jinja-compile.

Task #873.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 14:22:19 -04:00

19 lines
772 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{# Shared template macros. Import with: {% from "_macros.html" import crumbs %} #}
{# Breadcrumb trail. `items` is a list of (label, href) pairs, ordered root→current.
Intermediate items with a truthy href render as links; the last item (or any
item with an empty href) renders as plain current text. #}
{% macro crumbs(items) -%}
<nav class="breadcrumb" aria-label="Breadcrumb">
{%- for label, href in items -%}
{%- if loop.last -%}
<span class="breadcrumb-cur" aria-current="page">{{ label }}</span>
{%- elif href -%}
<a href="{{ href }}">{{ label }}</a><span class="breadcrumb-sep"></span>
{%- else -%}
<span>{{ label }}</span><span class="breadcrumb-sep"></span>
{%- endif -%}
{%- endfor -%}
</nav>
{%- endmacro %}