--wip-- [skip ci]

This commit is contained in:
2026-04-02 10:13:19 +02:00
parent dd936473d8
commit 9c71dc1e47
26 changed files with 650 additions and 343 deletions

21
course_calendar/forms.py Normal file
View File

@@ -0,0 +1,21 @@
from django.forms import fields as form_fields
from django.forms.widgets import ColorInput
from wagtail.admin.forms import WagtailAdminModelForm
from wagtail_color_panel.edit_handlers import NativeColorPanel
from course_calendar.models import CalendarEvent
class EventForm(WagtailAdminModelForm):
class Meta:
model = CalendarEvent
fields = "__all__"
widgets = {
"color": ColorInput(),
"start": form_fields.DateTimeInput(attrs={"type": "datetime-local"}),
"end": form_fields.DateTimeInput(attrs={"type": "datetime-local"}),
"recurrence_start_time": form_fields.TimeInput(attrs={"type": "time"}),
"recurrence_end_time": form_fields.TimeInput(attrs={"type": "time"}),
"recurrence_end_date": form_fields.DateInput(attrs={"type": "date"}),
}