* build(deps): bump askama from 0.12.1 to 0.15.4 Bumps [askama](https://github.com/askama-rs/askama) from 0.12.1 to 0.15.4. - [Release notes](https://github.com/askama-rs/askama/releases) - [Commits](https://github.com/askama-rs/askama/compare/0.12.1...v0.15.4) --- updated-dependencies: - dependency-name: askama dependency-version: 0.15.4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): adapt templates and tests for askama 0.15 - Migrate macro calls from {% call %} to {{ }} expression syntax (134 occurrences) - Update test assertion for askama 0.15's numeric HTML entity encoding (& vs &) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jon Seager <jon@sgrs.uk>
43 lines
2 KiB
HTML
43 lines
2 KiB
HTML
{% import "partials/icons.html" as icons %}
|
|
|
|
<div data-signals:{{ tab_signal }}="'{{ active_type }}'" data-signals:_tabs-open="false">
|
|
<!-- Desktop tabs -->
|
|
<nav class="hidden md:flex flex-wrap gap-1.5 p-2" role="tablist">
|
|
{% for tab in tabs %}
|
|
<button
|
|
type="button"
|
|
role="tab"
|
|
class="tab"
|
|
data-class:tab-active="{{ tab_signal_js }} === '{{ tab.key }}'"
|
|
data-on:click="{{ tab_signal_js }} = '{{ tab.key }}'{% if !tab_base_url.is_empty() %}; history.pushState(null, '', '{{ tab_base_url }}{{ tab.key }}'); @get('{{ tab_base_url }}{{ tab.key }}', {responseOverrides: {selector: '{{ tab_fetch_target }}', mode: '{{ tab_fetch_mode }}'}}){% endif %}"
|
|
>{{ tab.label }}</button>
|
|
{% endfor %}
|
|
</nav>
|
|
<!-- Mobile tab selector -->
|
|
<div class="md:hidden">
|
|
<button
|
|
type="button"
|
|
class="flex w-full items-center justify-between p-3 text-sm font-medium"
|
|
style="color: var(--text)"
|
|
data-on:click="$_tabsOpen = !$_tabsOpen"
|
|
>
|
|
<span>
|
|
{% for tab in tabs %}
|
|
<span data-show="{{ tab_signal_js }} === '{{ tab.key }}'">{{ tab.label }}</span>
|
|
{% endfor %}
|
|
</span>
|
|
<span data-show="!$_tabsOpen">{{ icons::chevron_down("h-5 w-5") }}</span>
|
|
<span data-show="$_tabsOpen" style="display:none">{{ icons::chevron_up("h-5 w-5") }}</span>
|
|
</button>
|
|
<div class="flex flex-col border-t" data-show="$_tabsOpen" style="display:none">
|
|
{% for tab in tabs %}
|
|
<button
|
|
type="button"
|
|
class="tab-mobile"
|
|
data-class:tab-mobile-active="{{ tab_signal_js }} === '{{ tab.key }}'"
|
|
data-on:click="{{ tab_signal_js }} = '{{ tab.key }}'; $_tabsOpen = false{% if !tab_base_url.is_empty() %}; history.pushState(null, '', '{{ tab_base_url }}{{ tab.key }}'); @get('{{ tab_base_url }}{{ tab.key }}', {responseOverrides: {selector: '{{ tab_fetch_target }}', mode: '{{ tab_fetch_mode }}'}}){% endif %}"
|
|
>{{ tab.label }}</button>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|