Skip to content

Commit 8cb140f

Browse files
committed
Added streaming selection option to events
1 parent 370cdb0 commit 8cb140f

5 files changed

Lines changed: 64 additions & 3 deletions

File tree

src/program/forms.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ class Meta:
268268
"title",
269269
"abstract",
270270
"allow_video_recording",
271+
"allow_video_streaming",
271272
"duration",
272273
"tags",
273274
"slides_url",
@@ -313,8 +314,9 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
313314
self.fields["track"].empty_label = None
314315
self.fields["track"].queryset = EventTrack.objects.filter(camp=camp)
315316

316-
# make sure video_recording checkbox defaults to checked
317+
# make sure video_recording and streaming checkbox defaults to checked
317318
self.fields["allow_video_recording"].initial = True
319+
self.fields["allow_video_streaming"].initial = True
318320

319321
if event_type.name not in [TALK, LIGHTNING_TALK]:
320322
# Only talk or lightning talk should show the slides_url field
@@ -374,6 +376,7 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
374376

375377
# no video recording for music acts
376378
del self.fields["allow_video_recording"]
379+
del self.fields["allow_video_streaming"]
377380

378381
elif event_type.name == RECREATIONAL_EVENT:
379382
# fix label and help_text for the title field
@@ -394,6 +397,7 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
394397

395398
# no video recording for music acts
396399
del self.fields["allow_video_recording"]
400+
del self.fields["allow_video_streaming"]
397401

398402
elif event_type.name in [TALK, LIGHTNING_TALK]:
399403
# fix label and help_text for the title field
@@ -439,6 +443,7 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
439443

440444
# no video recording for workshops
441445
del self.fields["allow_video_recording"]
446+
del self.fields["allow_video_streaming"]
442447

443448
elif event_type.name == RECREATIONAL_EVENT:
444449
# fix label and help_text for the title field
@@ -459,6 +464,7 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
459464

460465
# no video recording for recreational events
461466
del self.fields["allow_video_recording"]
467+
del self.fields["allow_video_streaming"]
462468

463469
elif event_type.name == MEETUP:
464470
# fix label and help_text for the title field
@@ -479,6 +485,7 @@ def __init__(self, camp, event_type=None, matrix=None, *args, **kwargs):
479485

480486
# no video recording for meetups
481487
del self.fields["allow_video_recording"]
488+
del self.fields["allow_video_streaming"]
482489

483490
else:
484491
raise ImproperlyConfigured(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.20 on 2025-04-21 17:12
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('program', '0105_cascade_delete_event_urls'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='event',
15+
name='video_streaming',
16+
field=models.BooleanField(default=True, help_text='Do we intend to stream video of this event?'),
17+
),
18+
migrations.AddField(
19+
model_name='eventproposal',
20+
name='allow_video_streaming',
21+
field=models.BooleanField(default=False, help_text='Uncheck if you do not want the event streamed.'),
22+
),
23+
]

src/program/models.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,11 @@ class EventProposal(ExportModelOperationsMixin("event_proposal"), UserSubmittedM
544544
help_text="Recordings are made available under the <b>CC BY-SA 4.0</b> license. Uncheck if you do not want the event recorded, or if you cannot accept the license.",
545545
)
546546

547+
allow_video_streaming = models.BooleanField(
548+
default=False,
549+
help_text="Uncheck if you do not want the event streamed (only if recording is unchecked!).",
550+
)
551+
547552
duration = models.IntegerField(
548553
blank=True,
549554
help_text="How much time (in minutes) should we set aside for this event?",
@@ -575,6 +580,8 @@ def headline(self):
575580
return self.title
576581

577582
def save(self, **kwargs):
583+
if self.allow_video_recording:
584+
self.allow_video_streaming = True
578585
if not self.duration:
579586
self.duration = self.event_type.event_duration_minutes
580587
super().save(**kwargs)
@@ -609,6 +616,7 @@ def mark_as_approved(self, request=None):
609616
event.event_type = self.event_type
610617
event.proposal = self
611618
event.video_recording = self.allow_video_recording
619+
event.video_streaming = self.allow_video_streaming
612620
event.save()
613621
# loop through the speaker_proposals linked to this event_proposal and associate any related speaker objects with this event
614622
for sp in self.speakers.all():
@@ -1207,10 +1215,12 @@ def get_ics_event(self):
12071215
domain = Site.objects.get_current().domain
12081216
speakers = ", ".join(self.event.speakers.all().values_list("name", flat=True))
12091217
recorded = "Yes" if self.event.video_recording else "No"
1218+
streamed = "Yes" if self.event.video_streaming else "No"
12101219
ievent["description"] = (
12111220
f"URL: https://{domain}{self.event.get_absolute_url()}\n\n"
12121221
f"Speaker(s): {speakers}\n\n"
12131222
f"Recorded: {recorded}\n\n"
1223+
f"Streamed: {streamed}\n\n"
12141224
f"{self.event.abstract}"
12151225
)
12161226
ievent["dtstart"] = icalendar.vDatetime(self.when.lower).to_ical()
@@ -1308,6 +1318,11 @@ class Event(ExportModelOperationsMixin("event"), CampRelatedModel):
13081318
help_text="Do we intend to record video of this event?",
13091319
)
13101320

1321+
video_streaming = models.BooleanField(
1322+
default=True,
1323+
help_text="Do we intend to stream video of this event?",
1324+
)
1325+
13111326
proposal = models.OneToOneField(
13121327
"program.EventProposal",
13131328
null=True,
@@ -1380,6 +1395,8 @@ def serialize(self):
13801395

13811396
if self.video_recording:
13821397
video_state = "to-be-recorded"
1398+
elif self.video_streaming:
1399+
video_state = "to-be-streamed-not-to-be-recorded"
13831400
else:
13841401
video_state = "not-to-be-recorded"
13851402

@@ -1515,6 +1532,8 @@ def serialize(self, user=None):
15151532

15161533
if self.event.video_recording:
15171534
video_state = "to-be-recorded"
1535+
elif self.event.video_streaming:
1536+
video_state = "to-be-streamed-not-to-be-recorded"
15181537
else:
15191538
video_state = "not-to-be-recorded"
15201539

src/program/templates/event_detail.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,25 @@ <h4>
4141
<h4>Metadata for <i>{{ event.title }}</i></h4>
4242
<strong>To be recorded</strong>:
4343
<span class="fa-stack">
44-
<i class="fas fa-video fa-stack-1x"></i>
4544
{% if event.video_recording %}
46-
<i class="far fa-circle fa-stack-2x"></i>
45+
<i class="fas fa-video fa-stack-1x"></i>
4746
{% else %}
47+
<i class="fas fa-video fa-stack-1x"></i>
4848
<i class="fas fa-ban fa-stack-2x text-danger"></i>
4949
{% endif %}
5050
</span>
5151
{{ event.video_recording|yesno:"Yes,No" }}
52+
<br>
53+
<strong>To be streamed</strong>:
54+
<span class="fa-stack">
55+
{% if event.video_streaming %}
56+
<i class="far fa-play fa-stack-1x"></i>
57+
{% else %}
58+
<i class="fas fa-play fa-stack-1x"></i>
59+
<i class="fas fa-ban fa-stack-2x text-danger"></i>
60+
{% endif %}
61+
</span>
62+
{{ event.video_streaming|yesno:"Yes,No" }}
5263
<hr>
5364

5465
<h4>URLs for <i>{{ event.title }}</i></h4>

src/utils/management/commands/bootstrap_devsite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ class Meta:
229229
title = factory.Faker("sentence")
230230
abstract = output_fake_md_description()
231231
allow_video_recording = factory.Iterator([True, True, True, False])
232+
allow_video_streaming = factory.Iterator([True, True, True, False])
232233
submission_notes = factory.Iterator(["", output_fake_description()])
233234
use_provided_speaker_laptop = factory.Iterator([True, False])
234235

0 commit comments

Comments
 (0)