From 43fe9aea31df1f0c93a294c545e8fb1be9b530f8 Mon Sep 17 00:00:00 2001 From: Angelo Rodriguez Date: Wed, 4 Dec 2024 16:36:57 +0100 Subject: [PATCH] work done --- core/reports.py | 49 +++++++++++++++++++++++++++++--- core/styles.py | 4 +++ core/templates/header.html | 5 ++++ core/templates/htmx/reports.html | 2 +- core/templates/index.html | 7 +++-- core/templates/report.html | 45 ++++++++++++++++++++--------- core/templates/write.html | 43 +++++++++++++++++++++------- 7 files changed, 125 insertions(+), 30 deletions(-) create mode 100755 core/templates/header.html diff --git a/core/reports.py b/core/reports.py index 3fcd9ff..3dfbffa 100755 --- a/core/reports.py +++ b/core/reports.py @@ -1,11 +1,52 @@ from django import forms +from core.styles import label_span + class WeeklyReport(forms.Form): - department = forms.CharField(label="Abteilung", max_length=150) - company_text = forms.CharField(label="Betriebliche Tätigkeiten", max_length=300) - week_topic = forms.CharField(label="Thema der Woche", max_length=600) - school_text = forms.CharField(label="Berufsschule", max_length=300) + department = forms.CharField( + label=label_span("Abteilung"), + max_length=150, + widget=forms.TextInput( + attrs={ + "placeholder": "Abteilung", + "class": "w-full p-2 border border-gray-300 rounded-lg focus:ring focus:ring-blue-400 mb-5", + } + ), + ) + company_text = forms.CharField( + label=label_span("Betriebliche Tätigkeiten"), + max_length=300, + widget=forms.Textarea( + attrs={ + "class": "w-full p-2 border border-gray-300 rounded-lg focus:ring focus:ring-blue-400 mb-5", + "rows": 10, + "placeholder": "Betriebliche Tätigkeiten", + } + ), + ) + week_topic = forms.CharField( + label=label_span("Thema der Woche"), + max_length=600, + widget=forms.Textarea( + attrs={ + "class": "w-full p-2 border border-gray-300 rounded-lg focus:ring focus:ring-blue-400 mb-5", + "rows": 8, + "placeholder": "Thema der Woche", + } + ), + ) + school_text = forms.CharField( + label=label_span("Berufsschule"), + max_length=300, + widget=forms.Textarea( + attrs={ + "class": "w-full p-2 border border-gray-300 rounded-lg focus:ring focus:ring-blue-400 mb-5", + "rows": 5, + "placeholder": "Berufsschule", + } + ), + ) def content_values(self) -> dict: if self.is_valid(): diff --git a/core/styles.py b/core/styles.py index 37615c7..088b45d 100755 --- a/core/styles.py +++ b/core/styles.py @@ -4,3 +4,7 @@ STYLE = { "red_btn": "text-white bg-red-700 hover:bg-red-800 focus:outline-none focus:ring-4 focus:ring-red-300 font-medium rounded-full text-sm px-5 py-2.5 text-center me-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900", "card": "bg-white drop-shadow-md p-4 mx-auto mt-5 aspect-[2/3] hover:drop-shadow-xl hover:scale-[0.85] scale-[0.8] lg:hover:scale-[0.95] lg:scale-[0.9] transition-all duration-50 transform ease-in-out w-60 sm:w-80", } + + +def label_span(txt): + return f'{txt}' diff --git a/core/templates/header.html b/core/templates/header.html new file mode 100755 index 0000000..1a2dd41 --- /dev/null +++ b/core/templates/header.html @@ -0,0 +1,5 @@ +
+
+

{{ title }}

+
+
diff --git a/core/templates/htmx/reports.html b/core/templates/htmx/reports.html index dc0fb8f..aee0210 100755 --- a/core/templates/htmx/reports.html +++ b/core/templates/htmx/reports.html @@ -3,7 +3,7 @@ {% include 'component/report.html' with report=report %} - {% endfor %} + {% endfor %}
Azube {% include 'head.html' %} - + + + {% include 'header.html' with title="Deine Berichtshefte" center=False %} +
-

Deine Berichtshefte

{% if late_reports > 1 %} +