Merge pull request #18 from lca2017/chrisjrn/017-cfp-models-and-forms
CFP models and forms
This commit is contained in:
commit
f56ce51459
3 changed files with 100 additions and 23 deletions
|
@ -86,28 +86,56 @@ class ProposalBase(models.Model):
|
||||||
kind = models.ForeignKey(ProposalKind, verbose_name=_("Kind"))
|
kind = models.ForeignKey(ProposalKind, verbose_name=_("Kind"))
|
||||||
|
|
||||||
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
||||||
description = models.TextField(
|
|
||||||
_("Brief Description"),
|
|
||||||
max_length=400, # @@@ need to enforce 400 in UI
|
|
||||||
help_text=_("If your proposal is accepted this will be made public and printed in the "
|
|
||||||
"program. Should be one paragraph, maximum 400 characters.")
|
|
||||||
)
|
|
||||||
abstract = models.TextField(
|
abstract = models.TextField(
|
||||||
_("Detailed Abstract"),
|
_("Abstract"),
|
||||||
help_text=_("Detailed outline. Will be made public if your proposal is accepted. Edit "
|
help_text=_("This will appear in the conference programme. Up to about "
|
||||||
"using <a href='http://daringfireball.net/projects/markdown/basics' "
|
"500 words. Edit using <a "
|
||||||
"target='_blank'>Markdown</a>.")
|
"href='http://daringfireball.net/projects/markdown/basics' " "target='_blank'>Markdown</a>.")
|
||||||
)
|
)
|
||||||
abstract_html = models.TextField(blank=True)
|
abstract_html = models.TextField(blank=True)
|
||||||
additional_notes = models.TextField(
|
|
||||||
_("Addtional Notes"),
|
private_abstract = models.TextField(
|
||||||
blank=True,
|
_("Private Abstract"),
|
||||||
help_text=_("Anything else you'd like the program committee to know when making their "
|
help_text=_("This will only be shown to organisers and reviewers. You "
|
||||||
"selection: your past experience, etc. This is not made public. Edit using "
|
"should provide any details about your proposal that you "
|
||||||
"<a href='http://daringfireball.net/projects/markdown/basics' "
|
"don't want to be public here. Edit using <a " "href='http://daringfireball.net/projects/markdown/basics' "
|
||||||
"target='_blank'>Markdown</a>.")
|
"target='_blank'>Markdown</a>.")
|
||||||
)
|
)
|
||||||
additional_notes_html = models.TextField(blank=True)
|
private_abstract_html = models.TextField(blank=True)
|
||||||
|
|
||||||
|
technical_requirements = models.TextField(
|
||||||
|
_("Special Requirements"),
|
||||||
|
blank=True,
|
||||||
|
help_text=_("Speakers will be provided with: Internet access, power, "
|
||||||
|
"projector, audio. If you require anything in addition, "
|
||||||
|
"please list your technical requirements here. Such as: a "
|
||||||
|
"static IP address, A/V equipment or will be demonstrating "
|
||||||
|
"security-related techniques on the conference network. "
|
||||||
|
"Edit using <a "
|
||||||
|
"href='http://daringfireball.net/projects/markdown/basics' "
|
||||||
|
"target='_blank'>Markdown</a>.")
|
||||||
|
)
|
||||||
|
technical_requirements_html = models.TextField(blank=True)
|
||||||
|
|
||||||
|
project = models.CharField(
|
||||||
|
max_length=100,
|
||||||
|
blank=True,
|
||||||
|
help_text=_("The name of the project you will be talking about."),
|
||||||
|
)
|
||||||
|
project_url = models.URLField(
|
||||||
|
_("Project URL"),
|
||||||
|
blank=True,
|
||||||
|
help_text=_("If your project has a webpage, specify the URL here so "
|
||||||
|
"the committee can find out more about your proposal.")
|
||||||
|
)
|
||||||
|
video_url = models.URLField(
|
||||||
|
_("Video"),
|
||||||
|
blank=True,
|
||||||
|
help_text=_("You may optionally provide us with a link to a video of "
|
||||||
|
"you speaking at another event, or of a short 'elevator "
|
||||||
|
"pitch' of your proposed talk.")
|
||||||
|
)
|
||||||
|
|
||||||
submitted = models.DateTimeField(
|
submitted = models.DateTimeField(
|
||||||
default=now,
|
default=now,
|
||||||
editable=False,
|
editable=False,
|
||||||
|
@ -130,7 +158,8 @@ class ProposalBase(models.Model):
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
self.abstract_html = parse(self.abstract)
|
self.abstract_html = parse(self.abstract)
|
||||||
self.additional_notes_html = parse(self.additional_notes)
|
self.private_abstract_html = parse(self.private_abstract)
|
||||||
|
self.technical_requirements_html = parse(self.technical_requirements)
|
||||||
return super(ProposalBase, self).save(*args, **kwargs)
|
return super(ProposalBase, self).save(*args, **kwargs)
|
||||||
|
|
||||||
def can_edit(self):
|
def can_edit(self):
|
||||||
|
|
|
@ -11,13 +11,21 @@ class SpeakerForm(forms.ModelForm):
|
||||||
fields = [
|
fields = [
|
||||||
"name",
|
"name",
|
||||||
"biography",
|
"biography",
|
||||||
|
"experience",
|
||||||
"photo",
|
"photo",
|
||||||
|
"telephone",
|
||||||
|
"homepage",
|
||||||
"twitter_username",
|
"twitter_username",
|
||||||
"accessibility",
|
"accessibility",
|
||||||
"travel_assistance",
|
"travel_assistance",
|
||||||
"accommodation_assistance",
|
"accommodation_assistance",
|
||||||
|
"agreement",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def __init__(self, *a, **k):
|
||||||
|
super(SpeakerForm, self).__init__(*a, **k)
|
||||||
|
self.fields['agreement'].required = True
|
||||||
|
|
||||||
def clean_twitter_username(self):
|
def clean_twitter_username(self):
|
||||||
value = self.cleaned_data["twitter_username"]
|
value = self.cleaned_data["twitter_username"]
|
||||||
if value.startswith("@"):
|
if value.startswith("@"):
|
||||||
|
|
|
@ -24,12 +24,40 @@ class Speaker(models.Model):
|
||||||
name = models.CharField(verbose_name=_("Name"), max_length=100,
|
name = models.CharField(verbose_name=_("Name"), max_length=100,
|
||||||
help_text=_("As you would like it to appear in the"
|
help_text=_("As you would like it to appear in the"
|
||||||
" conference program."))
|
" conference program."))
|
||||||
biography = models.TextField(blank=True, help_text=_("A little bit about you. Edit using "
|
biography = models.TextField(
|
||||||
|
blank=True,
|
||||||
|
help_text=_("This will appear on the conference website and in the "
|
||||||
|
"programme. Please write in the third person, eg 'Alice "
|
||||||
|
"is a Moblin hacker...', 150-200 words. Edit using "
|
||||||
"<a href='http://warpedvisions.org/projects/"
|
"<a href='http://warpedvisions.org/projects/"
|
||||||
"markdown-cheat-sheet/target='_blank'>"
|
"markdown-cheat-sheet/target='_blank'>"
|
||||||
"Markdown</a>."), verbose_name=_("Biography"))
|
"Markdown</a>."),
|
||||||
|
verbose_name=_("Biography"),
|
||||||
|
)
|
||||||
biography_html = models.TextField(blank=True)
|
biography_html = models.TextField(blank=True)
|
||||||
|
experience = models.TextField(
|
||||||
|
blank=True,
|
||||||
|
help_text=_("Have you had any experience presenting elsewhere? If so, "
|
||||||
|
"we'd like to know. Anything you put here will only be "
|
||||||
|
"seen by the organisers and reviewers; use it to convince "
|
||||||
|
"them why they should accept your proposal. Edit using "
|
||||||
|
"<a href='http://warpedvisions.org/projects/"
|
||||||
|
"markdown-cheat-sheet/target='_blank'>"
|
||||||
|
"Markdown</a>."),
|
||||||
|
verbose_name=_("Speaking experience"),
|
||||||
|
)
|
||||||
|
experience_html = models.TextField(blank=True)
|
||||||
photo = models.ImageField(upload_to="speaker_photos", blank=True, verbose_name=_("Photo"))
|
photo = models.ImageField(upload_to="speaker_photos", blank=True, verbose_name=_("Photo"))
|
||||||
|
telephone = models.CharField(
|
||||||
|
max_length=15,
|
||||||
|
help_text=_(u"The conference team will need this to contact you "
|
||||||
|
"during the conference week. If you don't have one, or do "
|
||||||
|
"not wish to provide it, then enter NONE in this field.")
|
||||||
|
)
|
||||||
|
homepage = models.URLField(
|
||||||
|
blank=True,
|
||||||
|
help_text=_(u"Your home page, if you have one")
|
||||||
|
)
|
||||||
twitter_username = models.CharField(
|
twitter_username = models.CharField(
|
||||||
max_length=15,
|
max_length=15,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
@ -37,8 +65,12 @@ class Speaker(models.Model):
|
||||||
)
|
)
|
||||||
accessibility = models.TextField(
|
accessibility = models.TextField(
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text=_("Please describe any special accessibility requirements that you may have."),
|
help_text=_("Please describe any special accessibility requirements "
|
||||||
|
"that you may have. Edit using "
|
||||||
|
"<a href='http://warpedvisions.org/projects/"
|
||||||
|
"markdown-cheat-sheet/target='_blank'>Markdown</a>."),
|
||||||
verbose_name=_("Accessibility requirements"))
|
verbose_name=_("Accessibility requirements"))
|
||||||
|
accessibility_html = models.TextField(blank=True)
|
||||||
travel_assistance = models.BooleanField(
|
travel_assistance = models.BooleanField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -53,6 +85,12 @@ class Speaker(models.Model):
|
||||||
"accommodation in order to present your proposed sessions."),
|
"accommodation in order to present your proposed sessions."),
|
||||||
verbose_name=_("Accommodation assistance required"),
|
verbose_name=_("Accommodation assistance required"),
|
||||||
)
|
)
|
||||||
|
agreement = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
help_text=_("I agree to the terms and confitions of attendance, and "
|
||||||
|
"I have read, understood, and agree to act according to "
|
||||||
|
"the standards set forth in our Code of Conduct ")
|
||||||
|
)
|
||||||
|
|
||||||
annotation = models.TextField(verbose_name=_("Annotation")) # staff only
|
annotation = models.TextField(verbose_name=_("Annotation")) # staff only
|
||||||
invite_email = models.CharField(max_length=200, unique=True, null=True, db_index=True, verbose_name=_("Invite_email"))
|
invite_email = models.CharField(max_length=200, unique=True, null=True, db_index=True, verbose_name=_("Invite_email"))
|
||||||
|
@ -70,6 +108,8 @@ class Speaker(models.Model):
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
self.biography_html = parse(self.biography)
|
self.biography_html = parse(self.biography)
|
||||||
|
self.experience_html = parse(self.experience)
|
||||||
|
self.accessibility_html = parse(self.accessibility)
|
||||||
return super(Speaker, self).save(*args, **kwargs)
|
return super(Speaker, self).save(*args, **kwargs)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in a new issue