feat: fixed dark mode

This commit is contained in:
Rushil Umaretiya 2022-09-21 00:14:52 -04:00
parent 2d86576cd5
commit 47729c71a9
3 changed files with 4 additions and 25 deletions

View File

@ -34,9 +34,7 @@ def index(request):
challenges_dict[c.id] = [c, "available"]
categories_dict[category.id] = [category, challenges_dict]
logger.debug(f"user is {request.user.username} with mode {request.user.dark_mode}")
return render(request, "main/index.html", context={"categories": categories_dict,"data": data, dark_mode: request.user.dark_mode})
return render(request, "main/index.html", context={"categories": categories_dict,"data": data, "dark_mode": request.user.dark_mode})
else:
return redirect(reverse("main:overview"))

View File

@ -1,22 +0,0 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hunt.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View File

@ -65,6 +65,7 @@
{% if dark_mode %}
<style>
body {
background: #1B2430
}
@ -88,10 +89,12 @@
h1 {
color: lightgray
}
</style>
{% endif %}
{% endblock %}
{% block main %}
<div id="hoco-scores">
<div class="score-box">
<div class="class">{{ data.0.0 }}</div>