Skip to content

Commit

Permalink
Merge pull request #346 from CTPUG/video-reviewer
Browse files Browse the repository at this point in the history
Add video release permission (and reviewer) to talks
  • Loading branch information
stefanor committed Feb 1, 2017
2 parents 9c7e902 + 5608d71 commit ebfc696
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wafer/schedule/templates/wafer.schedule/penta_schedule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
{% endfor %}
</persons>
<abstract/>
<released>{{ talk.video }}</released>
{% endwith %}
{% else %}
<title>{{ items.item.get_details|escape }}</title>
Expand Down Expand Up @@ -102,6 +103,7 @@
{% else %}
<description/>
{% endif %}
<released>True</released>
{% endif %}
<conf_url>{{ items.item.get_url }}</conf_url>
{# It's useful to have the full url available in the xml file. The pentabarf.xml format isn't that well #}
Expand All @@ -110,8 +112,6 @@
{# forcing https here is a bit horrible - make this configurable somewhere? #}
<full_conf_url>https://{{ WAFER_CONFERENCE_DOMAIN }}{{ items.item.get_url }}</full_conf_url>

{# someday there may be a way to set this to False #}
<released>True</released>
</event>
{% endif %}
{% endfor %}
Expand Down
4 changes: 4 additions & 0 deletions wafer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
# The form used for talk submission
WAFER_TALK_FORM = 'wafer.talks.forms.TalkForm'

# Ask speakers for video release, and an email address of a reviewer
WAFER_VIDEO = True
WAFER_VIDEO_REVIEWER = True

# Set this to False to disable registration
WAFER_REGISTRATION_OPEN = True
# Can be 'ticket' for Quicket tickets or 'form' for a classic form
Expand Down
15 changes: 14 additions & 1 deletion wafer/talks/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def __init__(self, *args, **kwargs):
initial=self.initial.get('talk_type')
)

if not settings.WAFER_VIDEO:
self.fields.pop('video')
if not settings.WAFER_VIDEO_REVIEWER:
self.fields.pop('video_reviewer')

# We add the name, if known, to the authors list
self.fields['authors'].label_from_instance = render_author

Expand All @@ -107,10 +112,18 @@ def __init__(self, *args, **kwargs):
else:
self.helper.add_input(submit_button)

def clean_video_reviewer(self):
video = self.cleaned_data['video']
reviewer = self.cleaned_data['video_reviewer']
if video and not reviewer:
raise forms.ValidationError(
_('A reviewer is required, if video is permitted.'))
return reviewer

class Meta:
model = Talk
fields = ('title', 'talk_type', 'track', 'abstract', 'authors',
'notes', 'private_notes')
'video', 'video_reviewer', 'notes', 'private_notes')
widgets = {
'abstract': MarkItUpWidget(),
'notes': forms.Textarea(attrs={'class': 'input-xxlarge'}),
Expand Down
25 changes: 25 additions & 0 deletions wafer/talks/migrations/0014_video.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-31 12:10
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('talks', '0013_talk_types_optional'),
]

operations = [
migrations.AddField(
model_name='talk',
name='video',
field=models.BooleanField(default=True, help_text='By checking this, you are giving permission for the talk to be videoed, and distributed by the conference, under a license of their choice.'),
),
migrations.AddField(
model_name='talk',
name='video_reviewer',
field=models.EmailField(blank=True, help_text="Email address of a person who will be allowed to review and approve your video details. Ideally, a second set of eyes who is not a busy conference presenter. But you can specify yourself, if you can't think of anyone else who would care.", max_length=254, null=True),
),
]
18 changes: 18 additions & 0 deletions wafer/talks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ class Meta:
settings.AUTH_USER_MODEL, related_name='talks',
help_text=lazy(authors_help, str))

video = models.BooleanField(
default=True,
help_text=_(
"By checking this, you are giving permission for the talk to be "
"videoed, and distributed by the conference, under a license of "
"their choice."
))
video_reviewer = models.EmailField(
null=True, blank=True,
help_text=_(
"Email address of a person who will be allowed to review "
"and approve your video details. "
"Ideally, a second set of eyes who is not a busy conference "
"presenter. "
"But you can specify yourself, if you can't think of anyone else "
"who would care."
))

kv = models.ManyToManyField(KeyValue)

def __str__(self):
Expand Down

0 comments on commit ebfc696

Please sign in to comment.