yksa-web-kit/yksa_web/templates/yksa/ui/_page_title.html
2026-08-21 22:09:17 +08:00

18 lines
1 KiB
HTML

{% comment %}
Always h1.h3, so pages cannot drift apart. Heading rank is structural; size is
fixed. Never pick a heading level for its size.
{% trans "Widgets" as parent %}{% url 'public:widget-list' as parent_url %}
{% include "yksa/ui/_page_title.html" with title=widget.name parent=parent parent_url=parent_url %}
A page one level deeper names its grandparent too, so the trail reaches the
section root rather than starting halfway down it:
{% include "yksa/ui/_page_title.html" with title=_("Status") parent=widget.name parent_url=... grandparent=_("Widgets") grandparent_url=... %}
Put it inside the page header's flex row; the row owns the actions on the right.
{% endcomment %}
<h1 class="h3 mb-0">
{% if grandparent %}<a class="text-decoration-none" href="{{ grandparent_url }}">{{ grandparent }}</a> / {% endif %}{% if parent %}<a class="text-decoration-none" href="{{ parent_url }}">{{ parent }}</a> / {% endif %}{{ title }}
</h1>
{% if subtitle %}<span class="text-body-secondary small">{{ subtitle }}</span>{% endif %}