2017-09-22 02:48:09 +00:00
|
|
|
import copy
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
from django import forms
|
|
|
|
|
2018-10-05 19:43:50 +00:00
|
|
|
from pinaxcon.proposals.fields import HelpTextField
|
2017-04-24 13:35:04 +00:00
|
|
|
from pinaxcon.proposals.models import TalkProposal, TutorialProposal, MiniconfProposal
|
2017-09-22 02:48:09 +00:00
|
|
|
from pinaxcon.proposals.models import SysAdminProposal, KernelProposal, OpenHardwareProposal
|
2018-10-01 02:09:33 +00:00
|
|
|
from pinaxcon.proposals.models import GamesProposal, DevDevProposal, ArtTechProposal
|
2018-10-24 06:34:58 +00:00
|
|
|
from pinaxcon.proposals.models import OpenEdProposal, DocsProposal, SecurityProposal
|
2018-10-01 02:09:33 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
|
|
|
|
DEFAULT_FIELDS = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
|
|
|
TALK_FORMAT_FIELDS = copy.copy(DEFAULT_FIELDS)
|
2018-09-30 04:04:28 +00:00
|
|
|
TALK_FORMAT_FIELDS.insert(2, "talk_format")
|
2017-03-05 07:34:15 +00:00
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
class ProposalForm(forms.ModelForm):
|
|
|
|
|
2017-04-24 13:10:51 +00:00
|
|
|
required_css_class = 'label-required'
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
def clean_description(self):
|
|
|
|
value = self.cleaned_data["description"]
|
|
|
|
if len(value) > 400:
|
|
|
|
raise forms.ValidationError(
|
|
|
|
u"The description must be less than 400 characters"
|
|
|
|
)
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
2018-10-03 08:19:22 +00:00
|
|
|
class DocsProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = DocsProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
class TalkProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TalkProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
2016-06-20 23:58:27 +00:00
|
|
|
"target_audience",
|
2015-10-16 17:53:02 +00:00
|
|
|
"abstract",
|
2016-06-20 23:58:27 +00:00
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"video_url",
|
2015-10-16 17:53:02 +00:00
|
|
|
"recording_release",
|
2016-06-20 23:58:27 +00:00
|
|
|
"materials_release",
|
2015-10-16 17:53:02 +00:00
|
|
|
]
|
2016-06-21 11:47:45 +00:00
|
|
|
|
2016-06-29 13:17:15 +00:00
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class TutorialProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = TutorialProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"target_audience",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
|
|
|
"project",
|
|
|
|
"project_url",
|
|
|
|
"video_url",
|
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
2016-06-29 13:17:15 +00:00
|
|
|
|
2016-06-21 11:47:45 +00:00
|
|
|
class MiniconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = MiniconfProposal
|
|
|
|
fields = [
|
|
|
|
"title",
|
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
|
|
|
"technical_requirements",
|
2017-07-02 12:28:29 +00:00
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
2016-06-21 11:47:45 +00:00
|
|
|
]
|
2017-09-20 12:50:39 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
class SysadminProposalForm(ProposalForm):
|
2017-09-20 12:50:39 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SysAdminProposal
|
2017-09-22 02:48:09 +00:00
|
|
|
fields = TALK_FORMAT_FIELDS
|
2017-09-20 12:50:39 +00:00
|
|
|
|
2018-10-24 06:34:58 +00:00
|
|
|
|
|
|
|
class SecurityProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SecurityProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
2017-09-20 12:50:39 +00:00
|
|
|
class KernelProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = KernelProposal
|
2018-10-18 07:30:50 +00:00
|
|
|
fields = TALK_FORMAT_FIELDS
|
2017-09-20 12:50:39 +00:00
|
|
|
|
2018-10-05 19:43:50 +00:00
|
|
|
|
2017-09-20 12:50:39 +00:00
|
|
|
class GamesProposalForm(ProposalForm):
|
|
|
|
|
2018-10-06 20:27:23 +00:00
|
|
|
HELP_TEXT = ("If you have <strong>any</strong> questions please check our "
|
|
|
|
"<a href=\"https://gamesandfoss-lcaminiconf.github.io/lca2019/\" ref="
|
|
|
|
"\"noreferrer noopener\" target=\"_blank\">website</a> or contact "
|
2018-10-05 19:43:50 +00:00
|
|
|
"the games miniconf organisers. We're excited to hear from you! You "
|
|
|
|
"can reach us via email <a href=\"mailto:games@lca.lonely.coffee\">"
|
|
|
|
"games@lca.lonely.coffee</a> or twitter DM <a href=\"https://twitter"
|
|
|
|
".com/ducky_tape\" ref=\"noreferrer noopener\" target=\"_blank\">"
|
|
|
|
"@ducky_tape</a> and <a href=\"https://twitter.com/the_mcjones\" "
|
|
|
|
"ref=\"noreferrer noopener\" target=\"_blank\">@the_mcjones</a>.")
|
|
|
|
|
|
|
|
help_field = HelpTextField(text=HELP_TEXT, label='')
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.fields['private_abstract'].help_text = ("it would be helpful if "
|
|
|
|
"you could please include a <strong>rough</strong> (don't worry, "
|
|
|
|
"we know it might change!) Outline of your presentation, e.g. "
|
|
|
|
"'0-2mins intro, 2-5mins the problem, 5-10mins things, 10-15mins "
|
|
|
|
"stuff 15-20mins solution'.")
|
|
|
|
|
2017-09-20 12:50:39 +00:00
|
|
|
class Meta:
|
|
|
|
model = GamesProposal
|
2018-10-05 19:43:50 +00:00
|
|
|
fields = ['help_field', ] + TALK_FORMAT_FIELDS
|
2017-09-20 12:50:39 +00:00
|
|
|
|
2018-10-18 07:30:50 +00:00
|
|
|
|
2017-09-20 12:50:39 +00:00
|
|
|
class OpenHardwareProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = OpenHardwareProposal
|
2017-09-22 02:48:09 +00:00
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
2018-10-18 07:30:50 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
class OpenEdProposalForm(ProposalForm):
|
|
|
|
class Meta:
|
2018-10-23 08:15:08 +00:00
|
|
|
NO_TARGET_AUDIENCE_FIELDS = copy.copy(TALK_FORMAT_FIELDS)
|
|
|
|
del(NO_TARGET_AUDIENCE_FIELDS[1])
|
|
|
|
|
2018-09-29 05:56:44 +00:00
|
|
|
model = OpenEdProposal
|
2018-10-23 08:15:08 +00:00
|
|
|
fields = NO_TARGET_AUDIENCE_FIELDS
|
2017-09-22 02:48:09 +00:00
|
|
|
|
2018-10-18 07:30:50 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
class DevDevProposalForm(ProposalForm):
|
|
|
|
|
2018-10-18 07:30:50 +00:00
|
|
|
HELP_TEXT = ("The Developer Developer Miniconf is taking <strong> "
|
|
|
|
"20-minute</strong> talks only.")
|
|
|
|
|
|
|
|
help_field = HelpTextField(text=HELP_TEXT, label='')
|
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
class Meta:
|
|
|
|
model = DevDevProposal
|
2018-10-18 07:30:50 +00:00
|
|
|
fields = ['help_field', ] + DEFAULT_FIELDS
|
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
|
|
|
|
class ArtTechProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
2017-10-15 08:04:26 +00:00
|
|
|
ARTTECH_FIELDS = copy.copy(DEFAULT_FIELDS)
|
|
|
|
ARTTECH_FIELDS.remove("target_audience")
|
|
|
|
ARTTECH_FIELDS.append("talk_format")
|
|
|
|
ARTTECH_FIELDS.append("can_exhibit")
|
|
|
|
ARTTECH_FIELDS.append("exhibition_requirements")
|
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
model = ArtTechProposal
|
2017-10-15 08:04:26 +00:00
|
|
|
fields = ARTTECH_FIELDS
|