Update web/templates/base.html
This commit is contained in:
parent
d7a84978d6
commit
ee6faf3a11
@ -1,6 +1,6 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en" data-theme="{{ request.session.theme|default:'classic' }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>{% block title %}Illustrations{% endblock %}</title>
|
<title>{% block title %}Illustrations{% endblock %}</title>
|
||||||
@ -10,13 +10,14 @@
|
|||||||
{# === THEME SYSTEM (BEGIN) === #}
|
{# === THEME SYSTEM (BEGIN) === #}
|
||||||
<link rel="stylesheet" href="{% static 'css/theme-base.css' %}">
|
<link rel="stylesheet" href="{% static 'css/theme-base.css' %}">
|
||||||
<link id="theme-css" rel="stylesheet"
|
<link id="theme-css" rel="stylesheet"
|
||||||
href="{% static 'themes/' %}{{ request.session.theme|default:'midnight' }}.css">
|
href="{% static 'themes/' %}{{ request.session.theme|default:'classic' }}.css">
|
||||||
<script>
|
<script>
|
||||||
// Early apply from localStorage to prevent flash if a user-selected theme exists
|
// Early apply from localStorage to prevent flash if a user-selected theme exists
|
||||||
(function () {
|
(function () {
|
||||||
try {
|
try {
|
||||||
var stored = localStorage.getItem('theme');
|
var stored = localStorage.getItem('theme');
|
||||||
if (stored) {
|
if (stored) {
|
||||||
|
document.documentElement.setAttribute('data-theme', stored);
|
||||||
document.getElementById('theme-css').href = '{% static "themes/" %}' + stored + '.css';
|
document.getElementById('theme-css').href = '{% static "themes/" %}' + stored + '.css';
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user