--wip-- [skip ci]
This commit is contained in:
21
course_calendar/forms.py
Normal file
21
course_calendar/forms.py
Normal 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"}),
|
||||
}
|
||||
Reference in New Issue
Block a user