67 lines
2.3 KiB
Python
Executable file
67 lines
2.3 KiB
Python
Executable file
from django import forms
|
|
|
|
from core.styles import label_span
|
|
|
|
|
|
class WeeklyReport(forms.Form):
|
|
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():
|
|
return {
|
|
"company_text": self.cleaned_data["company_text"],
|
|
"week_topic": self.cleaned_data["week_topic"],
|
|
"school_text": self.cleaned_data["school_text"],
|
|
}
|
|
|
|
|
|
class DailyReport:
|
|
department = forms.CharField(label="Abteilung", max_length=150)
|
|
week_topic = forms.CharField(label="Thema der Woche", max_length=600)
|
|
monday_text = forms.CharField(label="Berufsschule", max_length=300)
|
|
tuesday_text = forms.CharField(label="Dienstag", max_length=300)
|
|
wednesday_text = forms.CharField(label="Mittwoch", max_length=300)
|
|
thursday_text = forms.CharField(label="Donnerstag", max_length=300)
|
|
friday_text = forms.CharField(label="Freitag", max_length=300)
|