From: Magnus Hagander Date: Wed, 17 Jan 2024 11:42:21 +0000 (+0100) Subject: Allow publishing of pending sessions as TBD X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=238726c528a6e2cf53f32ad352210a7d41eb93f3;p=pgeu-system.git Allow publishing of pending sessions as TBD When this is enabled (default is off), any session listed as Pending will be include din the schedule, but have it's title replaced with TBD and have the speaker information removed. This can be used to help "pad" schedules in the early stages. --- diff --git a/docs/confreg/configuring.md b/docs/confreg/configuring.md index 6df385c7..da4df927 100644 --- a/docs/confreg/configuring.md +++ b/docs/confreg/configuring.md @@ -252,6 +252,11 @@ need ot be satisfied for the call for sponsors to be open. Schedule publishing active : If the schedule is published, including times, and rooms. +TBD sessions in schedule +: If sessions in [state](callforpapers) *Pending* should be included + on the schedule. If they are, their title is replaced with *TBD*, + and the speaker information is not included. + Session list publishing active : If the session publishing is active, which just lists the sessions and their details, typically used before the schedule is done but diff --git a/postgresqleu/confreg/backendforms.py b/postgresqleu/confreg/backendforms.py index 7fca4c42..b8ca4d18 100644 --- a/postgresqleu/confreg/backendforms.py +++ b/postgresqleu/confreg/backendforms.py @@ -77,7 +77,7 @@ class BackendConferenceForm(BackendForm): model = Conference fields = ['registrationopen', 'registrationtimerange', 'callforpapersopen', 'callforpaperstimerange', 'callforsponsorsopen', 'callforsponsorstimerange', 'feedbackopen', 'checkinactive', - 'conferencefeedbackopen', 'scheduleactive', 'sessionsactive', 'cardsactive', 'allowedit', + 'conferencefeedbackopen', 'scheduleactive', 'tbdinschedule', 'sessionsactive', 'cardsactive', 'allowedit', 'promoactive', 'promotext', 'promopicurl', 'twitter_timewindow_start', 'twitter_timewindow_end', 'twitter_postpolicy', 'schedulewidth', 'pixelsperminute', 'notifyregs', 'notifysessionstatus', 'notifyvolunteerstatus', @@ -101,7 +101,7 @@ class BackendConferenceForm(BackendForm): {'id': 'promo', 'legend': 'Website promotion', 'fields': ['promoactive', 'promotext', 'promopicurl']}, {'id': 'twitter', 'legend': 'Twitter settings', 'fields': ['twitter_timewindow_start', 'twitter_timewindow_end', 'twitter_postpolicy', ]}, {'id': 'fields', 'legend': 'Registration fields', 'fields': ['asktshirt', 'askfood', 'asknick', 'asktwitter', 'askbadgescan', 'askshareemail', 'askphotoconsent', 'dynafields', 'scannerfields', ]}, - {'id': 'steps', 'legend': 'Steps', 'fields': ['registrationopen', 'registrationtimerange', 'allowedit', 'callforpapersopen', 'callforpaperstimerange', 'callforsponsorsopen', 'callforsponsorstimerange', 'scheduleactive', 'sessionsactive', 'cardsactive', 'checkinactive', 'conferencefeedbackopen', 'feedbackopen']}, + {'id': 'steps', 'legend': 'Steps', 'fields': ['registrationopen', 'registrationtimerange', 'allowedit', 'callforpapersopen', 'callforpaperstimerange', 'callforsponsorsopen', 'callforsponsorstimerange', 'scheduleactive', 'tbdinschedule', 'sessionsactive', 'cardsactive', 'checkinactive', 'conferencefeedbackopen', 'feedbackopen']}, {'id': 'callforpapers', 'legend': 'Call for papers', 'fields': ['skill_levels', 'callforpaperstags', 'callforpapersrecording', 'showvotes']}, {'id': 'roles', 'legend': 'Roles', 'fields': ['testers', 'talkvoters', 'staff', 'volunteers', 'checkinprocessors', ]}, {'id': 'display', 'legend': 'Display', 'fields': ['jinjaenabled', 'videoproviders', ]}, diff --git a/postgresqleu/confreg/migrations/0110_conference_tbdinschedule.py b/postgresqleu/confreg/migrations/0110_conference_tbdinschedule.py new file mode 100644 index 00000000..f54c1b1c --- /dev/null +++ b/postgresqleu/confreg/migrations/0110_conference_tbdinschedule.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.14 on 2024-01-17 11:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('confreg', '0109_videolinks'), + ] + + operations = [ + migrations.AddField( + model_name='conference', + name='tbdinschedule', + field=models.BooleanField(default=False, help_text='Include pending sessions as TBD on schedule', verbose_name='TBD sessions in schedule'), + ), + ] diff --git a/postgresqleu/confreg/models.py b/postgresqleu/confreg/models.py index 58de9f50..3a7d8c17 100644 --- a/postgresqleu/confreg/models.py +++ b/postgresqleu/confreg/models.py @@ -188,6 +188,7 @@ class Conference(models.Model): checkinactive = models.BooleanField(blank=False, null=False, default=False, verbose_name="Check-in active") schedulewidth = models.IntegerField(blank=False, default=600, null=False, verbose_name="Width of HTML schedule") pixelsperminute = models.FloatField(blank=False, default=1.5, null=False, verbose_name="Vertical pixels per minute") + tbdinschedule = models.BooleanField(null=False, blank=False, default=False, verbose_name="TBD sessions in schedule", help_text="Include pending sessions as TBD on schedule") confurl = models.CharField(max_length=128, blank=False, null=False, validators=[validate_lowercase, ], verbose_name="Conference URL") twitter_timewindow_start = models.TimeField(null=False, blank=False, default='00:00', verbose_name="Don't post tweets before") twitter_timewindow_end = models.TimeField(null=False, blank=False, default='23:59:59', verbose_name="Don't post tweets after") diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py index 3ddcb09b..5fefacba 100644 --- a/postgresqleu/confreg/views.py +++ b/postgresqleu/confreg/views.py @@ -1265,7 +1265,7 @@ class SessionSet(object): def _scheduledata(request, conference): with ensure_conference_timezone(conference): - tracks = exec_to_dict("SELECT id, color, fgcolor, incfp, trackname, sortkey, showcompany FROM confreg_track t WHERE conference_id=%(confid)s AND EXISTS (SELECT 1 FROM confreg_conferencesession s WHERE s.conference_id=%(confid)s AND s.track_id=t.id AND s.status=1 AND s.track_id IS NOT NULL) ORDER BY sortkey", { + tracks = exec_to_dict("SELECT id, color, fgcolor, incfp, trackname, sortkey, showcompany FROM confreg_track t WHERE conference_id=%(confid)s AND EXISTS (SELECT 1 FROM confreg_conferencesession s WHERE s.conference_id=%(confid)s AND s.track_id=t.id AND (s.status=1{}) AND s.track_id IS NOT NULL) ORDER BY sortkey".format(" or s.status=3" if conference.tbdinschedule else ''), { 'confid': conference.id, }) @@ -1275,14 +1275,16 @@ def _scheduledata(request, conference): day_rooms = exec_to_keyed_dict("""WITH t AS ( SELECT s.starttime::date AS day, room_id - FROM confreg_conferencesession s WHERE s.conference_id=%(confid)s AND status=1 AND s.room_id IS NOT NULL AND s.starttime IS NOT NULL AND s.track_id IS NOT NULL + FROM confreg_conferencesession s WHERE s.conference_id=%(confid)s AND (status=1{}) AND s.room_id IS NOT NULL AND s.starttime IS NOT NULL AND s.track_id IS NOT NULL UNION SELECT d.day, ad.room_id FROM confreg_room_availabledays ad INNER JOIN confreg_registrationday d ON d.id=ad.registrationday_id ) SELECT day, array_agg(room_id ORDER BY r.sortkey, r.roomname) AS rooms FROM t INNER JOIN confreg_room r ON r.id=t.room_id GROUP BY day -""", { +""".format( + " or s.status=3" if conference.tbdinschedule else '', + ), { 'confid': conference.id, }) @@ -1295,14 +1297,15 @@ INNER JOIN confreg_room r ON r.id=t.room_id GROUP BY day s.track_id, to_json(r.*) AS room, s.room_id, - s.title, + CASE WHEN s.status=1 THEN s.title ELSE 'TBD' END AS title, s.htmlicon, to_char(starttime, 'HH24:MI') || ' - ' || to_char(endtime, 'HH24:MI') AS timeslot, extract(epoch FROM endtime-starttime)/60 AS length, min(starttime) OVER days AS firsttime, max(endtime) OVER days AS lasttime, cross_schedule, s.recordingconsent, EXISTS (SELECT 1 FROM confreg_conferencesessionslides sl WHERE sl.session_id=s.id) AS has_slides, - COALESCE(json_agg(json_build_object( + CASE WHEN s.status=1 THEN + COALESCE(json_agg(json_build_object( 'id', spk.id, 'name', spk.fullname, 'company', spk.company, @@ -1311,7 +1314,8 @@ INNER JOIN confreg_room r ON r.id=t.room_id GROUP BY day 'hasphoto', spk.photo IS NOT NULL AND spk.photo != ''::bytea, 'hasphoto512', spk.photo512 IS NOT NULL AND spk.photo512 != ''::bytea, 'attributes', attributes - ) ORDER BY spk.fullname) FILTER (WHERE spk.id IS NOT NULL), '[]') AS speakers, + ) ORDER BY spk.fullname) FILTER (WHERE spk.id IS NOT NULL), '[]') + ELSE '{{}}'::json END AS speakers, s.videolinks FROM confreg_conferencesession s LEFT JOIN confreg_track t ON t.id=s.track_id @@ -1320,12 +1324,14 @@ LEFT JOIN confreg_conferencesession_speaker css ON css.conferencesession_id=s.id LEFT JOIN confreg_speaker spk ON spk.id=css.speaker_id WHERE s.conference_id=%(confid)s AND - s.status=1 AND + (s.status=1{}) AND s.track_id IS NOT NULL AND (cross_schedule OR room_id IS NOT NULL) GROUP BY s.id, t.id, r.id WINDOW days AS (PARTITION BY s.starttime::date) -ORDER BY day, s.starttime, r.sortkey""", { +ORDER BY day, s.starttime, r.sortkey""".format( + " or s.status=3" if conference.tbdinschedule else '', + ), { 'confid': conference.id, })