"""Subclass and define some fields."""
__metaclass__ = ContactFormMeta
+ started = False
form_tag = None
+ save_as_tag = None
form_title = _('Contact form')
submit_label = _('Submit')
admin_list = None
for name, value in self.cleaned_data.items():
if not isinstance(value, UploadedFile) and name != 'contact':
body[name] = value
+ save_as_tag = self.save_as_tag or self.form_tag
contact = Contact.objects.create(body=body,
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
- form_tag=self.form_tag)
+ form_tag=self.save_as_tag)
for name, value in self.cleaned_data.items():
if isinstance(value, UploadedFile):
attachment = Attachment(contact=contact, tag=name)
'site_name': site.name,
'site_domain': site.domain,
'contact': contact,
+ 'form': self,
}
context = RequestContext(request)
mail_managers_subject = render_to_string([
class RegistrationForm(ContactForm):
form_tag = 'register'
+
+ save_as_tag = '2014'
+ conference_name = u'CopyCamp 2014'
+
form_title = _('Take part!')
admin_list = ['name', 'organization', 'title']
organization = forms.CharField(label=_('Organization'),
max_length=256, required=False)
title = forms.CharField(label=_('Title of presentation'),
- max_length=256, required=False, widget = forms.HiddenInput)
+ max_length=256, required=False)
presentation = forms.FileField(label=_('Presentation'),
- required=False, widget = forms.HiddenInput)
+ required=False)
summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
- widget=forms.HiddenInput, max_length=1800, required=False)
+ max_length=1800, required=False)
agree_data = forms.BooleanField(
label=_('Permission for data processing'),
help_text=_(u'I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. Marszałkowska 84/92, 00-514 Warszawa) permission to process my personal data (name, e-mail address) for purposes of registration for CopyCamp conference.')
def __init__(self, *args, **kwargs):
super(RegistrationForm, self).__init__(*args, **kwargs)
- self.limit_reached = Contact.objects.filter(form_tag=self.form_tag).count() >= settings.REGISTRATION_LIMIT
+
+ self.started = getattr(settings, 'REGISTRATION_STARTED', False)
+ self.open_call = getattr(settings, 'REGISTRATION_OPEN_CALL', False)
+ self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
if self.limit_reached:
for field in ('title', 'summary'):
self.fields[field].required = True
+ if not self.open_call:
+ for field in ('title', 'summary', 'presentation'):
+ del self.fields[field]
+
class NextForm(ContactForm):
form_tag = 'next'
msgstr ""
"Project-Id-Version: prawokultury\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-12 12:00+0200\n"
-"PO-Revision-Date: 2012-11-08 11:22+0100\n"
+"POT-Creation-Date: 2014-04-02 16:10+0200\n"
+"PO-Revision-Date: 2014-04-02 16:11+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: FNP <fundacja@nowoczesnapolska.org.pl>\n"
-"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
-"|| n%100>=20) ? 1 : 2)\n"
+"|| n%100>=20) ? 1 : 2);\n"
+"X-Generator: Poedit 1.5.4\n"
-#: contact_forms.py:11 menu_items.py:22
+#: contact_forms.py:16 menu_items.py:22
msgid "Take part!"
msgstr "Weź udział!"
-#: contact_forms.py:14
+#: contact_forms.py:19 contact_forms.py:49
msgid "Name"
msgstr "Imię i nazwisko"
-#: contact_forms.py:15
+#: contact_forms.py:20 contact_forms.py:50
msgid "E-mail"
msgstr "E-mail"
-#: contact_forms.py:16
+#: contact_forms.py:21 contact_forms.py:51
msgid "Organization"
msgstr "Organizacja"
-#: contact_forms.py:18
+#: contact_forms.py:23
msgid "Title of presentation"
msgstr "Tytuł prezentacji"
-#: contact_forms.py:20
+#: contact_forms.py:25
msgid "Presentation"
msgstr "Prezentacja"
-#: contact_forms.py:22
+#: contact_forms.py:27
msgid "Summary of presentation (max. 1800 characters)"
msgstr "Krótki opis prezentacji (maks. 1800 znaków)"
-#: contact_forms.py:25
+#: contact_forms.py:30
msgid "Permission for data processing"
msgstr "Zgoda na przetwarzanie danych"
-#: contact_forms.py:26
+#: contact_forms.py:31
msgid ""
"I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. "
"Marszałkowska 84/92, 00-514 Warszawa) permission to process my personal data "
"poczty elektronicznej) przez Fundację Nowoczesna Polska (ul. Marszałkowska "
"84/92, 00-514 Warszawa) w związku z rejestracją na konferencję CopyCamp."
-#: contact_forms.py:29
+#: contact_forms.py:34
msgid "Permission for publication"
msgstr "Zgoda na publikację"
-#: contact_forms.py:30
+#: contact_forms.py:35
msgid ""
"I agree to having materials recorded during the conference released under "
"the terms of <a href=\"http://creativecommons.org/licenses/by-sa/3.0/deed"
"licencji <a href=\"http://creativecommons.org/licenses/by-sa/3.0/deed.pl"
"\">CC BY-SA</a>."
+#: contact_forms.py:47
+msgid "Next CopyCamp"
+msgstr "Kolejny CopyCamp"
+
#: settings.d/60-custom.py:5
msgid "info"
-msgstr ""
+msgstr "info"
#: templates/404.html:5 templates/404.html.py:10
msgid "Page not found"
"href='http://creativecommons.org/licenses/by-sa/3.0/deed.pl'>Creative "
"Commons Uznanie autorstwa – Na tych samych warunkach</a>."
-#: templates/contact/register/mail_body.txt:2
-#: templates/contact/register/mail_subject.txt:1
+#: templates/contact/register/mail_body.txt:4
#, python-format
-msgid "Thank you for submitting the registration form at %(site_name)s."
-msgstr ""
-"Dziękujemy za wypełnienie formularza rejestracyjnego na stronie "
-"%(site_name)s."
-
-#: templates/contact/register/mail_body.txt:3
msgid ""
-"Thank you for registering to the CopyCamp 2013 conference.\n"
+"Thank you for registering to the %(conf)s conference.\n"
"Please arrive early to obtain your name badge and conference materials."
msgstr ""
-"Dziękujemy za rejestrację na konferencję CopyCamp 2013."
-"Prosimy o wcześniejsze przybycie w celu otrzymania identyfikatora i materiałów konferencyjnych."
+"Dziękujemy za rejestrację na konferencję %(conf)s.\n"
+"Prosimy o wcześniejsze przybycie w celu otrzymania identyfikatora i "
+"materiałów konferencyjnych."
-#: templates/contact/register/mail_body.txt:7
+#: templates/contact/register/mail_body.txt:8
msgid "Message sent automatically. Please do not reply to it."
msgstr "Wiadomość wysłana automatycznie, prosimy nie odpowiadać."
+#: templates/contact/register/mail_subject.txt:1
+#, python-format
+msgid "Thank you for submitting the registration form at %(site_name)s."
+msgstr ""
+"Dziękujemy za wypełnienie formularza rejestracyjnego na stronie "
+"%(site_name)s."
+
#: templates/contact/register/thanks.html:5
msgid "Thank you for submitting the registration form."
msgstr "Dziękujemy za wypełnienie formularza rejestracyjnego."
{% endblock %}
</div>
- {% if form.limit_reached %}
+{% if not form.started %}
+ {# Not yet started. #}
+ <div class="warning">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__not_started" %}
+ </div>
+{% else %}
+ {# Already started. #}
+ {% if form.limit_reached and not form.open_call %}
+ {# Already closed. #}
<div class="warning">
- {% chunk "contact_form__"|add:form.form_tag|add:"__full" %}
+ {% chunk "contact_form__"|add:form.form_tag|add:"__closed" %}
</div>
{% else %}
+ {# Still running. #}
+ {% if form.limit_reached %}
+ {# Only taking presentation submissions. #}
+ <div class="warning">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__presentations_only" %}
+ </div>
+ {% else %}
+ {% if not form.open_call %}
+ {# Not taking presentations any more. #}
+ <div class="warning">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__no_presentations" %}
+ </div>
+ {% else %}
+ <div class="warning">
+ {% chunk "contact_form__"|add:form.form_tag|add:"__running" %}
+ </div>
+ {% endif %}
+ {% endif %}
+
<form method="POST" action="." enctype="multipart/form-data" class="submit-form">
- {% csrf_token %}
- <table>
+ {% csrf_token %}
+ <table>
{{ form.as_table }}
<tr><td></td><td><button>{% block contact_form_submit %}{{ form.submit_label }}{% endblock %}</button></td></tr>
- </table>
+ </table>
</form>
{% endif %}
- <script type="text/javascript" src="/static/js/prefill.js"></script>
+{% endif %}
+
+<script type="text/javascript" src="/static/js/prefill.js"></script>
{% endblock %}
{% load i18n %}
{% comment %}{% blocktrans %}Thank you for submitting the registration form at {{ site_name }}.{% endblocktrans %}{% endcomment %}
-{% blocktrans %}Thank you for registering to the CopyCamp 2013 conference.
+{% blocktrans with conf=form.conference_name %}Thank you for registering to the {{conf}} conference.
Please arrive early to obtain your name badge and conference materials.{% endblocktrans %}
--