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
|
2019-09-28 06:03:41 +00:00
|
|
|
from pinaxcon.proposals import models
|
2018-10-01 02:09:33 +00:00
|
|
|
|
2017-09-22 02:48:09 +00:00
|
|
|
|
|
|
|
DEFAULT_FIELDS = [
|
|
|
|
"title",
|
2023-04-20 01:54:36 +00:00
|
|
|
# "primary_topic",
|
2017-09-22 02:48:09 +00:00
|
|
|
"target_audience",
|
2021-08-09 11:12:43 +00:00
|
|
|
"experience_level",
|
2017-09-22 02:48:09 +00:00
|
|
|
"abstract",
|
|
|
|
"private_abstract",
|
2023-04-20 07:47:34 +00:00
|
|
|
# "content_warning",
|
2017-09-22 02:48:09 +00:00
|
|
|
"technical_requirements",
|
2023-04-20 01:54:36 +00:00
|
|
|
# "project",
|
|
|
|
# "project_url",
|
2023-04-20 07:47:34 +00:00
|
|
|
# "video_url",
|
2021-08-09 11:12:43 +00:00
|
|
|
"require_approval",
|
2017-09-22 02:48:09 +00:00
|
|
|
"recording_release",
|
|
|
|
"materials_release",
|
|
|
|
]
|
|
|
|
|
2023-04-15 04:54:11 +00:00
|
|
|
TALK_FORMAT_FIELDS = copy.copy(DEFAULT_FIELDS)
|
|
|
|
TALK_FORMAT_FIELDS.insert(2, "talk_format")
|
|
|
|
TALK_FORMAT_FIELDS.append("ticket_acknowledgement")
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
class TalkProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
2019-09-28 06:03:41 +00:00
|
|
|
model = models.TalkProposal
|
2021-07-05 10:20:24 +00:00
|
|
|
fields = copy.copy(DEFAULT_FIELDS)
|
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:
|
2019-09-28 06:03:41 +00:00
|
|
|
model = models.TutorialProposal
|
2021-07-05 10:20:24 +00:00
|
|
|
fields = copy.copy(DEFAULT_FIELDS)
|
2023-04-15 04:54:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MiniconfProposalForm(ProposalForm):
|
|
|
|
|
|
|
|
def __init__(self, *a, **k):
|
|
|
|
super(MiniconfProposalForm, self).__init__(*a, **k)
|
|
|
|
self.fields['ticket_acknowledgement'].required = True
|
|
|
|
|
|
|
|
|
|
|
|
class CopyleftComplianceProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.CopyleftComplianceProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class MemberProjectProposalForm(MiniconfProposalForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = models.MemberProjectProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
2023-04-20 07:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ContainerDaysProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.ContainerDaysProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class SustainableOpenSourceBusinessProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.SustainableOpenSourceBusinessProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
2023-04-21 08:39:47 +00:00
|
|
|
class SoftwareWorkerCoopsProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.SoftwareWorkerCoopsProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
2023-04-20 07:47:34 +00:00
|
|
|
class DiversityEquityInclusionProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.DiversityEquityInclusionProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class FOSSAtPlayProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.FOSSAtPlayProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class OpenSourcAIDataProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.OpenSourcAIDataProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class OpenWorkProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.OpenWorkProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class CommunityProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.CommunityProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class BSDUnixProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.BSDUnixProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class XMPPProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.XMPPProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class ScienceOfCommunityProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.ScienceOfCommunityProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class AArch64ARM64ProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.AArch64ARM64Proposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class FOSSForEducationProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.FOSSForEducationProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|
|
|
|
|
|
|
|
|
|
|
|
class FOSSInDailyLifeProposalForm(MiniconfProposalForm):
|
|
|
|
class Meta:
|
|
|
|
model = models.FOSSInDailyLifeProposal
|
|
|
|
fields = TALK_FORMAT_FIELDS
|