{% extends "layouts/framework.html" %} {#- The layout of flaskspark.core: sidebar navigation (docked from lg on, a drawer behind the hamburger below), the theme's branding, colour mode (system/light/dark) and language in the sidebar's footer. Pages fill `content`, their scripts go into `page_scripts`. Everything about the brand comes from the theme (theme.yaml, theme.css). -#} {% block title %}{% block page_title %}{{ _("Home") }}{% endblock %} · {{ app_title }}{% endblock %} {% block flaskspark_head_assets %} {% block page_styles %}{% endblock %} {#- Modules import shared code as "webcomponents/…" (the installed package), the core's JS as "flaskspark/…", the public JS of a module as "modules//…" (its web/static/public//) and the app's own JS as "app/…" (the app package's static/app/). #} {#- Icons by name in the web components (e.g. ): Bootstrap Icons' sprite. #} {% if theme.apple_touch_icon %}{% endif %} {% if theme.manifest_file %} {%- elif theme.manifest is mapping %}{% endif %} {#- The translations of the page's module (or the parts the page names: {% set i18n_modules = ["notes", "core"] %}) for flaskspark/i18n.js: t() and nt() know them without asking the server. #} {#- Only with the core's context (an app that renders this layout with a context of its own gets no catalogue). #} {% if i18n_catalogue is defined and i18n_page_parts is defined %} {% set i18n_parts = i18n_modules if i18n_modules is defined else i18n_page_parts() %} {% endif %} {#- The stored colour mode before the first paint; webcomponents' theme.js takes over afterwards. A page that fixes its mode (, e.g. a screen) neither reads nor stores the choice. #} {% endblock %} {% block body_attrs %}class="app-body" data-theme="{{ theme.name }}" data-i18n-endpoint="{{ url_for('flaskspark_i18n') }}"{% endblock %} {% block app_body %} {% set logo = url_for('theme.static', filename='images/' ~ theme.logo) %} {% set logo_dark = url_for('theme.static', filename='images/' ~ theme.logo_dark) %} {% macro brand(cls="") %} {% endmacro %}
{{ brand() }}
{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} {{ message }} {% endfor %} {% endif %} {% endwith %} {% block page_header %}{% endblock %} {% block content %}{% endblock %}
{% if theme.footer %}
{{ theme.footer }}
{% endif %}
{#- What the modules add to every page (Module.LAYOUT): dialogs, scripts of the navigation. #} {% for template in module_layouts %}{% include template %}{% endfor %} {% endblock %} {#- Flashes are toasts above; FlaskSpark's plain version is not needed. #} {% block flaskspark_body_end %}{% endblock %} {#- No asset bundle (ASSETS_ENABLE off): the core's script is an ES module. #} {% block flaskspark_scripts %}{% endblock %} {% block app_scripts %} {% block page_scripts %}{% endblock %} {% endblock %}