{# Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #} {% import 'appbuilder/general/lib.html' as lib %} {% from 'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context %} {% import "superset/macros.html" as macros %} {% set favicons = config['FAVICONS'] %} {% block title %} {% if title %} {{ title }} {% else %} {{ default_title | default('Superset') }} {% endif %} {% endblock %} {% block head_meta %} {# Manifest is served dynamically by PwaManifestView so APPLICATION_ROOT and STATIC_ASSETS_PREFIX resolve at request time. Do NOT use `assets_prefix` here — that may point to a CDN host with no Superset backend. See superset/views/pwa_manifest.py. #} {% if title %}{% endif %} {% if dashboard_description %} {% endif %} {% if request %}{% endif %} {% endblock %} {% if dark_theme_bg and entry != 'embedded' %} {% endif %} {% block head_css %} {% for favicon in favicons %} {% endfor %} {% endblock %} {{ css_bundle(assets_prefix, 'theme') }} {% if entry %} {{ css_bundle(assets_prefix, entry) }} {% endif %} {{ js_bundle(assets_prefix, 'theme') }} {% block head_js %} {% include "head_custom_extra.html" %} {% endblock %} {% block body %}
{% set tokens = theme_tokens | default({}) %} {% set spinner_style = "width: 70px; height: auto; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" %} {% if spinner_svg %}
{{ spinner_svg | safe }}
{% elif tokens.get('brandSpinnerUrl') %} {% endif %}
{% endblock %} {% block tail_js %} {# Load the language pack BEFORE the entry bundle so module-level `const X = t('...')` calls across webpack-split chunks all find a configured translator on first access (upstream issue #35330). The script sets window.__SUPERSET_LANGUAGE_PACK__ and is content-addressed (/language_pack///script.js), so browsers cache it as immutable across page loads and cache-bust automatically whenever translations change. English emits no tag at all. If the script fails to load, preamble.ts falls back to the async language pack fetch. #} {% if language_pack_src %} {% endif %} {# Operators can still supply a pack directly in the bootstrap payload via COMMON_BOOTSTRAP_OVERRIDES_FUNC (the historical #35330 workaround). When one is present, stash it on window here instead of emitting the versioned script tag, so early chunks see the override. #} {% if language_pack_inline %} {% endif %} {% if entry %} {{ js_bundle(assets_prefix, entry) }} {% endif %} {% include "tail_js_custom_extra.html" %} {% endblock %}