mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fix dark theme test when no user is available
This commit is contained in:
@@ -74,6 +74,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
|
{{ block.super }}
|
||||||
<script src="{% static 'js/tooltip.js' %}"></script>
|
<script src="{% static 'js/tooltip.js' %}"></script>
|
||||||
<script src="{% static 'js/popover.js' %}"></script>
|
<script src="{% static 'js/popover.js' %}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
<div class="modal fade" id="modal" role="dialog" tabindex=-1></div>
|
<div class="modal fade" id="modal" role="dialog" tabindex=-1></div>
|
||||||
<script src="{% static 'js/base.js' %}"></script>
|
<script src="{% static 'js/base.js' %}"></script>
|
||||||
<script>
|
<script>
|
||||||
if({{ request.user.dark_theme|lower }} || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
if({{ request.user.dark_theme|lower|default:'false' }} || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
$('<link>').appendTo('head').attr({type : 'text/css', rel : 'stylesheet'}).attr('href', '{% static "css/dark_screen.css" %}');
|
$('<link>').appendTo('head').attr({type : 'text/css', rel : 'stylesheet'}).attr('href', '{% static "css/dark_screen.css" %}');
|
||||||
document.body.setAttribute('data-theme', 'dark');
|
document.body.setAttribute('data-theme', 'dark');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
if({{ request.user.dark_theme|lower }} || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
if({{ request.user.dark_theme|lower|default:'false' }} || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
$('<link>').appendTo('head').attr({type : 'text/css', rel : 'stylesheet'}).attr('href', '{% static "css/dark_screen.css" %}');
|
$('<link>').appendTo('head').attr({type : 'text/css', rel : 'stylesheet'}).attr('href', '{% static "css/dark_screen.css" %}');
|
||||||
document.body.setAttribute('data-theme', 'dark');
|
document.body.setAttribute('data-theme', 'dark');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user