Skip to content
Snippets Groups Projects
Verified Commit cd919896 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Introduce template var SITE_PREFERENCES to access site preferences

parent 63800c3a
No related branches found
No related tags found
1 merge request!777Resolve "base_print.html doesn't uses correct site preferences if run in background"
......@@ -11,7 +11,7 @@
{% block no_browser_title %}
{% block browser_title %}{% endblock %} —
{% endblock %}
{{ config.SITE_TITLE }}
{{ SITE_PREFERENCES.general__title }}
</title>
{% include_css "material-design-icons" %}
......@@ -51,7 +51,7 @@
<div id="print-header" class="row">
<div class="col s6 logo">
{% static "img/aleksis-banner.svg" as aleksis_banner %}
<img src="{% firstof request.site.preferences.theme__logo.url aleksis_banner %}" alt="Logo"
<img src="{% firstof SITE_PREFERENCES.theme__logo.url aleksis_banner %}" alt="Logo"
id="print-logo"/>
</div>
<div class="col s6 right-align">
......@@ -65,7 +65,7 @@
<footer>
<div class="left">
{{ request.site.preferences.school__name }}
{{ SITE_PREFERENCES.school__name }}
</div>
<div class="right">
......
......@@ -108,7 +108,7 @@
</div>
{% endif %}
{% if user.person.preferences.general__automatically_update_dashboard and request.site.preferences.general__automatically_update_dashboard_site %}
{% if user.person.preferences.general__automatically_update_dashboard and SITE_PREFERENCES.general__automatically_update_dashboard_site %}
<script type="text/javascript" src="{% static "js/include_ajax_live.js" %}"></script>
{% endif %}
{% endblock %}
......@@ -3,20 +3,20 @@
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="description" content="{{ request.site.preferences.general__description }}"/>
<meta name="description" content="{{ SITE_PREFERENCES.general__description }}"/>
<meta name="generator" content="AlekSIS School Information System"/>
<meta name="theme-color" content="red">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="{{ request.site.preferences.general__title }}">
<meta name="apple-mobile-web-app-title" content="{{ SITE_PREFERENCES.general__title }}">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="msapplication-navbutton-color" content="{{ request.site.preferences.theme__primary }}">
<meta name="msapplication-TileColor" content="{{ request.site.preferences.theme__primary }}">
<meta name="msapplication-navbutton-color" content="{{ SITE_PREFERENCES.theme__primary }}">
<meta name="msapplication-TileColor" content="{{ SITE_PREFERENCES.theme__primary }}">
<meta name="msapplication-TileImage" content="{{ PWA_ICONS.microsoft.144.faviconImage.url }}">
<meta name="application-name" content="{{ request.site.preferences.general__title }}">
<meta name="application-name" content="{{ SITE_PREFERENCES.general__title }}">
<meta name="msapplication-starturl" content="/">
<meta name="msapplication-tap-highlight" content="no">
<meta name="browsermode" content="application">
......
......@@ -213,6 +213,7 @@ def custom_information_processor(request: HttpRequest) -> dict:
"ADMINS": settings.ADMINS,
"PWA_ICONS": regrouped_pwa_icons,
"SENTRY_ENABLED": settings.SENTRY_ENABLED,
"SITE_PREFERENCES": get_site_preferences(),
}
if settings.SENTRY_ENABLED:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment