{# LOTUSGUILD TERMINAL DESIGN SYSTEM — Flask/Jinja2 Base Template Extend this in every page template: {% extends "base.html" %} {% block title %}Dashboard{% endblock %} {% block active_nav %}dashboard{% endblock %} {% block content %} … your page HTML … {% endblock %} {% block scripts %} {% endblock %} Required Flask setup (app.py): - Pass `nonce` into every render_template() call via a context processor - Pass `user` dict from _get_user() helper - Pass `config` dict with APP_NAME, etc. Context processor example: @app.context_processor def inject_globals(): import base64, os nonce = base64.b64encode(os.urandom(16)).decode() return dict(nonce=nonce, user=_get_user(), config=_config()) #} {% block title %}Dashboard{% endblock %} — {{ config.get('app_name', 'LotusGuild') }}
{{ config.get('app_name', 'APP') | upper }} {{ config.get('app_subtitle', 'LotusGuild Infrastructure') }}
{% if user.name or user.username %} {{ user.name or user.username }} {% endif %} {% if 'admin' in user.groups %} admin {% endif %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %} {# --------------------------------------------------------------- active_nav block — override in each page template: {% block active_nav %}dashboard{% endblock %} Values: dashboard | links | inspector | suppressions --------------------------------------------------------------- #} {% block active_nav %}{% endblock %}