Compare commits

..

3 commits

Author SHA1 Message Date
Jannis Portmann ec0ee49d34 Update dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-05 18:51:06 +02:00
Jannis Portmann 28423de82b Bump django to 4.1.11 2023-09-05 18:47:44 +02:00
Jannis Portmann a5fca29239 Fix captcha theming 2023-07-29 12:16:00 +02:00
3 changed files with 27 additions and 12 deletions

View file

@ -20,8 +20,10 @@
const setTheme = function(theme) { const setTheme = function(theme) {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark') document.documentElement.setAttribute('data-bs-theme', 'dark')
set_captcha_theme('dark', 0)
} else { } else {
document.documentElement.setAttribute('data-bs-theme', theme) document.documentElement.setAttribute('data-bs-theme', theme)
set_captcha_theme(theme, 0)
} }
} }
@ -59,4 +61,17 @@
}) })
}) })
}) })
})() })()
function set_captcha_theme(theme, set_try) {
var captchaDiv = document.getElementById("id_captcha");
if (captchaDiv) {
console.log("Set the theme on try" + set_try)
if (theme == 'dark') {
captchaDiv.classList.add("dark");
} else {
captchaDiv.classList.remove("dark");
}
}
};

View file

@ -46,7 +46,6 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src="{% static 'bootstrap-color-toggler.js' %}"></script>
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body class="d-flex flex-column h-100 justify-content-between {% block background %}{% endblock background %}"> <body class="d-flex flex-column h-100 justify-content-between {% block background %}{% endblock background %}">
@ -93,7 +92,7 @@
{% get_language_info_list for LANGUAGES as languages %} {% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %} {% for language in languages %}
<li> <li>
<form method="POST" action="{% url 'set_language' %}"> <form method="POST" action="{% url 'save_language' %}">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="language" value="{{ language.code }}" /> <input type="hidden" name="language" value="{{ language.code }}" />
<button class="dropdown-item d-flex align-items-center {% if language.code == LANGUAGE_CODE %} active{% endif %}" <button class="dropdown-item d-flex align-items-center {% if language.code == LANGUAGE_CODE %} active{% endif %}"
@ -215,5 +214,6 @@
</div> </div>
</div> </div>
</footer> </footer>
<script src="{% static 'bootstrap-color-toggler.js' %}"></script>
</body> </body>
</html> </html>

View file

@ -1,14 +1,14 @@
crispy-bootstrap5==0.7 crispy-bootstrap5==0.7
Django==4.1.10 Django==4.1.11
djangoloco==1.0 djangoloco==1.0
django-bootstrap5==22.2 django-bootstrap5==23.3
django-crispy-forms==2.0 django-crispy-forms==2.0
django-jquery==3.1.0 django-jquery==3.1.0
django-friendly-captcha==0.1.7 django-friendly-captcha==0.1.8
geopy==2.3.0 geopy==2.4.0
gunicorn==20.1.0 gunicorn==21.2.0
fontawesomefree==6.3.0 fontawesomefree==6.4.2
pandas==2.0.0 pandas==2.1.0
Pillow==9.4.0 Pillow==10.0.0
psycopg2-binary==2.9.5 psycopg2-binary==2.9.7
python-dotenv==1.0.0 python-dotenv==1.0.0