+ Berichtsheft {{ report.year }} / {{ report.week }} +
++ Is Approved? + + {{ report.is_approved }} + +
+Content:
+-
+ {% for key, value in report.content.items %}
+
- {{ key }} +
- {{ value }} +
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 }}
+
Du bist nicht aktuell!
Du hast noch {{ late_reports }} Berichtshefte nachzuschreiben.
diff --git a/core/templates/report.html b/core/templates/report.html index 5f93e64..04db2cb 100755 --- a/core/templates/report.html +++ b/core/templates/report.html @@ -3,17 +3,36 @@Berichtsheft {{ report.year }} / {{ report.week }}
- -Is Approved ? {{ report.is_approved }}
- - {% for key, value in report.content.items %} - -{{ key }} : {{ value }}
- - {% endfor %} - + + + {% with title="Berichtsheft "|add:report.num %} + {% include 'header.html' with title="Berichtsheft" %} +{% endwith %} + ++ Berichtsheft {{ report.year }} / {{ report.week }} +
++ Is Approved? + + {{ report.is_approved }} + +
+{{ user.display_name }}
-Berichtsheft {{ year }} / {{ week }}
-Von: {{ start_date|date:"d.m.Y" }} bis: {{ end_date|date:"d.m.Y" }}
+ {% include 'header.html' with title="Neues Berichtsheft" %} - +