From d17d41e07a6ff7929f12a29bbfa1a1ed53376eb4 Mon Sep 17 00:00:00 2001 From: ben8 Date: Fri, 11 Jul 2025 16:54:00 +0200 Subject: [PATCH] dark_mode --- django/library/forms.py | 10 ++- django/static/css/t-input.css | 2 +- django/templates/404.html | 6 +- django/templates/accounts/home.html | 12 ++-- django/templates/accounts/login.html | 2 +- django/templates/accounts/register.html | 2 +- django/templates/base.html | 3 +- django/templates/homepage/home.html | 8 +-- django/templates/homepage/impress.html | 6 +- django/templates/homepage/privacy.html | 4 +- .../library/delete_confirmation.html | 6 +- django/templates/library/detail_quiz.html | 56 ++++++++--------- django/templates/library/form.html | 11 +++- django/templates/library/head.html | 26 ++++---- django/templates/library/overview_quiz.html | 52 +++++++++------ .../library/overview_quiz_favorite.html | 54 ++++++++-------- .../templates/library/overview_quiz_my.html | 42 ++++++------- .../library/question/question_input.html | 24 +++---- .../question/question_multiple_choice.html | 63 ++++++++++--------- .../library/question/question_true_false.html | 22 +++---- django/templates/partials/_footer.html | 6 +- django/templates/partials/_nav.html | 14 ++--- django/templates/play/game/finished.html | 8 +-- django/templates/play/game/question_host.html | 12 ++-- .../play/game/question_participant.html | 10 +-- .../templates/play/game/score_overview.html | 18 +++--- .../play/initialize_participant.html | 10 +-- django/templates/play/join_game.html | 6 +- django/templates/play/lobby.html | 26 ++++---- django/templates/play/select_mode.html | 2 +- .../registration/delete_account_confirm.html | 6 +- .../registration/password_change_form.html | 8 +-- .../registration/password_reset_complete.html | 2 +- .../registration/password_reset_confirm.html | 9 +-- .../registration/password_reset_done.html | 8 +-- .../registration/password_reset_form.html | 4 +- 36 files changed, 296 insertions(+), 264 deletions(-) diff --git a/django/library/forms.py b/django/library/forms.py index b4d711c..f455876 100644 --- a/django/library/forms.py +++ b/django/library/forms.py @@ -6,6 +6,14 @@ class QuizForm(forms.ModelForm): model = QivipQuiz fields = ['name', 'description', 'status', 'category','difficulty','credits'] + def __init__(self, *args, **kwargs): + super(QuizForm, self).__init__(*args, **kwargs) + for field in self.fields.values(): + field.widget.attrs.update({ + 'class': 'dark:bg-[#2a2f3a]! dark:text-white' + }) + + class QuestionForm(forms.ModelForm): class Meta: model = QivipQuestion @@ -34,5 +42,5 @@ class QuizFilterForm(forms.Form): required=False, label="Kategorie", widget=forms.Select(attrs={ - 'class': 'border-2 border-gray-300 rounded-lg p-2 w-full' + 'class': 'border-2 border-gray-300 rounded-lg p-2 w-full dark:bg-[#2a2f3a] dark:text-white' })) \ No newline at end of file diff --git a/django/static/css/t-input.css b/django/static/css/t-input.css index 726280d..666e567 100644 --- a/django/static/css/t-input.css +++ b/django/static/css/t-input.css @@ -17,7 +17,7 @@ a.qp-a-button-small { .register input{@apply p-3 rounded-full bg-gray-200 focus:scale-105 transition duration-200 font-black w-full;} .input-group { - @apply flex flex-col gap-4 max-w-md mx-auto p-6 bg-white rounded-xl shadow-lg; + @apply flex flex-col gap-4 max-w-md mx-auto p-6 bg-white rounded-xl shadow-lg; } .input-group form { diff --git a/django/templates/404.html b/django/templates/404.html index bdb7592..da27217 100644 --- a/django/templates/404.html +++ b/django/templates/404.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content %} -
+
-

Seite nicht gefunden

-

Ups, die angeforderte Seite wurde nicht gefunden. Überprüfen Sie die URL oder kehren Sie zur Startseite zurück.

+

Seite nicht gefunden

+

Ups, die angeforderte Seite wurde nicht gefunden. Überprüfen Sie die URL oder kehren Sie zur Startseite zurück.

-
+
+

Willkommen, {{ request.user.username }}!

@@ -18,16 +18,16 @@
-
+
-
+
Erfolge
-
    +
    • {{ my_quizzes_number }} Quizze erstellt
    • {{ my_questions_number }} Fragen insgesamt erstellt
    @@ -37,7 +37,7 @@
- qivip + qivip
diff --git a/django/templates/accounts/login.html b/django/templates/accounts/login.html index 90fda41..23b04e5 100644 --- a/django/templates/accounts/login.html +++ b/django/templates/accounts/login.html @@ -4,7 +4,7 @@ {% block content %}
-

Anmeldung

+

Anmeldung

{% if form.errors %}
diff --git a/django/templates/accounts/register.html b/django/templates/accounts/register.html index 8b3820d..b1afe9f 100644 --- a/django/templates/accounts/register.html +++ b/django/templates/accounts/register.html @@ -4,7 +4,7 @@
-

Registrieren

+

Registrieren

{% if form.errors %} diff --git a/django/templates/base.html b/django/templates/base.html index eac8bb6..b5f2fd8 100644 --- a/django/templates/base.html +++ b/django/templates/base.html @@ -1,6 +1,6 @@ {% load static %} - + @@ -75,5 +75,6 @@ + \ No newline at end of file diff --git a/django/templates/homepage/home.html b/django/templates/homepage/home.html index 894c152..2aa3640 100644 --- a/django/templates/homepage/home.html +++ b/django/templates/homepage/home.html @@ -6,7 +6,7 @@

qivip

weil Lernen auch Spaß
machen kann!

-
+
Teilnehmen Moderieren Erstellen @@ -25,13 +25,13 @@ {% if faqs %}
-

FAQs

+

FAQs

-
+

@@ -43,7 +43,7 @@

{% for faq in faqs %} -
+
{{ faq.question }} diff --git a/django/templates/homepage/impress.html b/django/templates/homepage/impress.html index 1d54f5a..660cc4e 100644 --- a/django/templates/homepage/impress.html +++ b/django/templates/homepage/impress.html @@ -1,8 +1,8 @@ {% extends 'base.html' %} {% block content%} -
-
+
+

Impressum

@@ -12,7 +12,7 @@
- qivip + qivip
diff --git a/django/templates/homepage/privacy.html b/django/templates/homepage/privacy.html index 30a0d91..1175107 100644 --- a/django/templates/homepage/privacy.html +++ b/django/templates/homepage/privacy.html @@ -2,7 +2,7 @@ {% block content%}
-
+

Datenschutz-
erklärung

@@ -12,7 +12,7 @@
- qivip + qivip
diff --git a/django/templates/library/delete_confirmation.html b/django/templates/library/delete_confirmation.html index ecb3254..b170f6d 100644 --- a/django/templates/library/delete_confirmation.html +++ b/django/templates/library/delete_confirmation.html @@ -3,15 +3,15 @@ {% block content %}
-
+
-

Löschen bestätigen

+

Löschen bestätigen

-

+

{% if object.quiz_id %} Möchten Sie die Frage "{{ object.data.question }}" wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden. {% else %} diff --git a/django/templates/library/detail_quiz.html b/django/templates/library/detail_quiz.html index 865a982..20deecb 100644 --- a/django/templates/library/detail_quiz.html +++ b/django/templates/library/detail_quiz.html @@ -4,21 +4,21 @@

-
-

{{ quiz.name }}

+
+

{{ quiz.name }}

-
+
{% if quiz.user_id == request.user %} - + - + @@ -54,13 +54,13 @@
{% if quiz.description %} -

{{ quiz.description }}

+

{{ quiz.description }}

{% endif %}
{% if detail == True %} -
+
@@ -71,7 +71,7 @@ {% else %} -
+
@@ -85,7 +85,7 @@
-
+

Fragen @@ -123,7 +123,7 @@ -
+

{{ forloop.counter }}.

{% if quiz.user_id == request.user %} {% endif %}
@@ -144,7 +144,7 @@ {% for option in question.data.options %} -
  • +
  • {% if option.is_correct %} @@ -152,10 +152,10 @@ {{ option.value }} {% else %} - + - {{ option.value }} + {{ option.value }} {% endif %}
  • {% endfor %} @@ -173,7 +173,7 @@ - {{ option.value }} + {{ option.value }} {% endfor %} @@ -186,7 +186,7 @@ {% for option in question.data.options %} {% if option.is_correct %}

    - Richtige Antwort: + Richtige Antwort: {{ option.value }}

    {% endif %} @@ -209,7 +209,7 @@
    {% if quiz.user_id == request.user %} - + {% endif %} @@ -236,32 +236,32 @@
    {% if quiz.base_quiz %} -

    Kopie von: {{ quiz.base_quiz}}

    +

    Kopie von: {{ quiz.base_quiz}}

    {% endif %}
    {% if quiz.base_quiz %} -

    Autor: {{ quiz.base_quiz.user_id }}

    +

    Autor: {{ quiz.base_quiz.user_id }}

    {% endif %}
    -

    Credits:

    +

    Credits:

    {% if quiz.credits %} -

    - {{ quiz.credits }} - (Credits für das Quiz) +

    + {{ quiz.credits }} + (Credits für das Quiz)

    {% else %} -

    Keine Credits für das Quizformular vorhanden!

    +

    Keine Credits für das Quizformular vorhanden!

    {% endif %}
    @@ -270,13 +270,13 @@