From: Magnus Hagander Date: Wed, 17 Dec 2025 09:55:51 +0000 (+0100) Subject: Show slot lengths when editing schedule and volunteer slots X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.%3Cscript%20data-cfasync=?a=commitdiff_plain;p=pgeu-system.git Show slot lengths when editing schedule and volunteer slots --- diff --git a/postgresqleu/confreg/backendforms.py b/postgresqleu/confreg/backendforms.py index 8a05714c..6bb60ac2 100644 --- a/postgresqleu/confreg/backendforms.py +++ b/postgresqleu/confreg/backendforms.py @@ -1189,9 +1189,15 @@ class BackendConferenceSpeakerForm(BackendGlobalSpeakerForm): class BackendConferenceSessionSlotForm(BackendForm): helplink = 'schedule#slots' - list_fields = ['starttime', 'endtime', ] + list_fields = ['starttime', 'endtime', 'slotlength', ] allow_copy_previous = True copy_transform_form = BackendTransformConferenceDateTimeForm + verbose_field_names = { + 'slotlength': 'Slot length', + } + queryset_extra_fields = { + 'slotlength': 'endtime - starttime', + } class Meta: model = ConferenceSessionScheduleSlot @@ -1243,9 +1249,15 @@ class BackendMergeSpeakerForm(django.forms.Form): class BackendVolunteerSlotForm(BackendForm): helplink = 'volunteers#slots' - list_fields = ['timerange', 'title', 'min_staff', 'max_staff', ] + list_fields = ['timerange', 'slotlength', 'title', 'min_staff', 'max_staff', ] allow_copy_previous = True copy_transform_form = BackendTransformConferenceDateTimeForm + verbose_field_names = { + 'slotlength': 'Slot length', + } + queryset_extra_fields = { + 'slotlength': 'upper(timerange)-lower(timerange)', + } class Meta: model = VolunteerSlot