22 lines
849 B
Python
22 lines
849 B
Python
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"}),
|
|
}
|