Skip to content

Commit

Permalink
Merge pull request #344 from CTPUG/talk-submission-form-docs
Browse files Browse the repository at this point in the history
Describe our approach to authors
  • Loading branch information
stefanor committed Jan 31, 2017
2 parents 75e0668 + 066af22 commit 9c7e902
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions wafer/talks/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext, ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import lazy
from django.template.defaultfilters import slugify

from markitup.fields import MarkupField
Expand All @@ -24,6 +25,25 @@ def render_author(author):
return '%s (%s)' % (author.userprofile.display_name(), author)


def authors_help():
_ = ugettext # This function will be wrapped for lazy evaluation
text = []
text.append(_("The speakers presenting the talk."))
if not settings.WAFER_PUBLIC_ATTENDEE_LIST:
text.append(_(
"To ensure attendee privacy, you will only be able to see "
"yourself and authors that have been added to the talk by the "
"conference organisers. "
"If you will have other co-authors, add a note in the notes "
"field, so the organisers can add them to your talk."
))
text.append(_(
"<strong>You, as the talk submitter, will be the talk's corresponding "
"author.</strong>"
))
return ' '.join(text)


@python_2_unicode_compatible
class TalkType(models.Model):
"""A type of talk."""
Expand Down Expand Up @@ -123,8 +143,7 @@ class Meta:

authors = models.ManyToManyField(
settings.AUTH_USER_MODEL, related_name='talks',
help_text=_(
"The speakers presenting the talk."))
help_text=lazy(authors_help, str))

kv = models.ManyToManyField(KeyValue)

Expand Down

0 comments on commit 9c7e902

Please sign in to comment.