{%- macro header(content, title=None, subtitle=None, logo=None, href=None) -%} {%- set href = href or h.url_for('home.index') -%}
{%- call ui.util.call(ui.container) -%}
{% if logo -%} {{ ui.link(ui.image(h.url_for_static_or_external(logo), alt=title, attrs={"class": "site-logo"}), href=href, attrs={"class": "logo-link", "aria-label": _('Navigate to Home - {site_title}').format(site_title=title)}) }} {%- else -%}
{{ ui.heading(ui.link(title, href=href), level=1, class="site-title") }} {% if subtitle %} {{ ui.heading(subtitle, level=2, class="site-subtitle") }} {% endif %}
{%- endif %}
{{ content }}
{%- endcall %}
{%- endmacro %} {%- macro footer(content) -%} {%- endmacro %} {%- macro footer_main(content) -%}
{{ content }}
{%- endmacro %} {%- macro footer_secondary(content) -%}
{{ content }}
{%- endmacro %} {%- macro account(content) -%}
{{ ui.container(content) }}
{%- endmacro %} {%- macro language_selector() -%} {% set current_lang = request.environ.CKAN_LANG %} {%- set data_attrs = {"module": "autocomplete", "module-dropdown-class": "lang-dropdown", "module-container-class": "lang-container"} -%} {%- set label = ui.icon("globe", style="solid") ~ ui.util.tag(_('Language'), "span", attrs={"class": "sr-only"}) -%} {%- set item_kwargs = kwargs -%}
{%- call ui.util.call(ui.form, method="POST", action=h.url_for('util.internal_redirect'), data={"module": "select-switch"}) -%} {%- call ui.util.call(ui.select_box, name="url", id=ui.util.id(), data=data_attrs, label=label, **item_kwargs) -%} {% for locale in h.get_available_locales() %} {{ ui.select_option(locale.display_name or locale.english_name, value=h.url_for(h.current_url(), locale=locale.short_name), selected=locale.short_name == current_lang) }} {% endfor %} {%- endcall %} {%- endcall %}
{%- endmacro %}