Changes to CopyCamp registration form
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 7 Apr 2014 14:32:21 +0000 (16:32 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 7 Apr 2014 14:32:21 +0000 (16:32 +0200)
- two separate forms for participants and speakers
- removing introduction chunk above the form

prawokultury/contact_forms.py
prawokultury/locale/pl/LC_MESSAGES/django.mo
prawokultury/locale/pl/LC_MESSAGES/django.po
prawokultury/menu_items.py
prawokultury/static/css/forms.css
prawokultury/static/css/forms.scss
prawokultury/templates/contact/register-speaker/form.html [new file with mode: 0644]
prawokultury/templates/contact/register-speaker/mail_body.txt [new file with mode: 0644]
prawokultury/templates/contact/register-speaker/mail_subject.txt [new file with mode: 0644]
prawokultury/templates/contact/register-speaker/thanks.html [new file with mode: 0644]
prawokultury/templates/contact/register/form.html

index 53d23d2..a53501c 100644 (file)
@@ -19,12 +19,6 @@ class RegistrationForm(ContactForm):
     contact = forms.EmailField(label=_('E-mail'), max_length=128)
     organization = forms.CharField(label=_('Organization'), 
             max_length=256, required=False)
-    title = forms.CharField(label=_('Title of presentation'), 
-            max_length=256, required=False)
-    presentation = forms.FileField(label=_('Presentation'),
-            required=False)
-    summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
-            widget=forms.Textarea, 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.')
@@ -36,17 +30,65 @@ class RegistrationForm(ContactForm):
 
     def __init__(self, *args, **kwargs):
         super(RegistrationForm, self).__init__(*args, **kwargs)
-
         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]
-            
+
+
+tracks = (
+    'CopyArt',
+    'Creative middle class',
+    'How to Pay?',
+    'How to Be Paid?',
+    'Copyright and Education',
+    'Technology and Innovation',
+    'Copyright and Human Rights',
+    'Self-Publishing',
+    'Future of the Book',
+    'Copyright Enforcement',
+    'Future of Copyright',
+    'Copyright Debate',
+)
+
+class RegisterSpeaker(RegistrationForm):
+    form_tag = 'register-speaker'
+    save_as_tag = '2014-speaker'
+
+    thematic_track = forms.ChoiceField(
+        label = _('Please select one thematic track'),
+        choices=[(t,t) for t in tracks], widget=forms.RadioSelect())
+
+    bio = forms.CharField(label=_('Short biographical note (max. 500 characters)'),
+            widget=forms.Textarea, max_length=500, required=True)
+
+    title = forms.CharField(label=_('Title of presentation'),
+            max_length=256, required=True)
+    presentation = forms.FileField(label=_('Presentation'),
+            required=True)
+    summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
+            widget=forms.Textarea, max_length=1800, required=True)
+
+    post_conference_publication = forms.BooleanField(
+        label=_('I am interested in including my paper in the post-conference publication'),
+        required=False
+    )
+
+    def __init__(self, *args, **kw):
+        super(RegisterSpeaker, self).__init__(*args, **kw)
+        self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
+        self.fields.keyOrder = [
+            'name',
+            'contact',
+            'organization',
+            'thematic_track',
+            'bio',
+            'title',
+            'presentation',
+            'summary',
+            'post_conference_publication',
+            'agree_data',
+            'agree_license'
+        ]
+
 
 class NextForm(ContactForm):
     form_tag = 'next'
index f5344dc..694a971 100644 (file)
Binary files a/prawokultury/locale/pl/LC_MESSAGES/django.mo and b/prawokultury/locale/pl/LC_MESSAGES/django.mo differ
index 2f92a5b..0a403b7 100644 (file)
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: prawokultury\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-04-02 16:10+0200\n"
+"POT-Creation-Date: 2014-04-07 15:50+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"
@@ -18,39 +19,27 @@ msgstr ""
 "|| n%100>=20) ? 1 : 2);\n"
 "X-Generator: Poedit 1.5.4\n"
 
-#: contact_forms.py:16 menu_items.py:22
+#: contact_forms.py:15
 msgid "Take part!"
 msgstr "Weź udział!"
 
-#: contact_forms.py:19 contact_forms.py:49
+#: contact_forms.py:18 contact_forms.py:95
 msgid "Name"
 msgstr "Imię i nazwisko"
 
-#: contact_forms.py:20 contact_forms.py:50
+#: contact_forms.py:19 contact_forms.py:96
 msgid "E-mail"
 msgstr "E-mail"
 
-#: contact_forms.py:21 contact_forms.py:51
+#: contact_forms.py:20 contact_forms.py:97
 msgid "Organization"
 msgstr "Organizacja"
 
 #: contact_forms.py:23
-msgid "Title of presentation"
-msgstr "Tytuł prezentacji"
-
-#: contact_forms.py:25
-msgid "Presentation"
-msgstr "Prezentacja"
-
-#: contact_forms.py:27
-msgid "Summary of presentation (max. 1800 characters)"
-msgstr "Krótki opis prezentacji (maks. 1800 znaków)"
-
-#: contact_forms.py:30
 msgid "Permission for data processing"
 msgstr "Zgoda na przetwarzanie danych"
 
-#: contact_forms.py:31
+#: contact_forms.py:24
 msgid ""
 "I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. "
 "Marszałkowska 84/92, 00-514 Warszawa) permission to process my personal data "
@@ -60,11 +49,11 @@ msgstr ""
 "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:34
+#: contact_forms.py:27
 msgid "Permission for publication"
 msgstr "Zgoda na publikację"
 
-#: contact_forms.py:35
+#: contact_forms.py:28
 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"
@@ -74,7 +63,34 @@ msgstr ""
 "licencji <a href=\"http://creativecommons.org/licenses/by-sa/3.0/deed.pl"
 "\">CC BY-SA</a>."
 
-#: contact_forms.py:47
+#: contact_forms.py:42
+msgid "Please select one thematic track"
+msgstr "Proszę wybrać jedną ścieżkę tematyczną"
+
+#: contact_forms.py:58
+msgid "Short biographical note (max. 500 characters)"
+msgstr "Krótka notka biograficzna (maks. 500 znaków)"
+
+#: contact_forms.py:61
+msgid "Title of presentation"
+msgstr "Tytuł prezentacji"
+
+#: contact_forms.py:63
+msgid "Presentation"
+msgstr "Prezentacja"
+
+#: contact_forms.py:65
+msgid "Summary of presentation (max. 1800 characters)"
+msgstr "Krótki opis prezentacji (maks. 1800 znaków)"
+
+#: contact_forms.py:69
+msgid ""
+"I am interested in including my paper in the post-conference publication"
+msgstr ""
+"Jestem zainteresowana/y umieszczeniem pisemnej wersji mojego wystąpienia w "
+"publikacji pokonferencyjnej"
+
+#: contact_forms.py:93
 msgid "Next CopyCamp"
 msgstr "Kolejny CopyCamp"
 
index bca8da5..dadddcc 100644 (file)
@@ -19,7 +19,7 @@ add_entry(slug_pl='co')
 add_entry(slug_pl='gdzie')
 add_entry(slug_pl='program')
 add_entry(slug_pl='media')
-ITEMS.append(MenuItem(reverse_lazy('contact_form', args=['register']), _('Take part!')))
+add_entry(slug_pl='wez-udzial')
 add_entry(slug_pl='materialy')
 add_entry(slug_pl='poprzednie')
 add_entry(slug_pl='kontakt')
index 6cd9a5c..bbd8360 100644 (file)
@@ -38,3 +38,5 @@
     font-weight: bold; }
   .submit-form .required label:before {
     content: '* '; }
+  .submit-form input[type="radio"] {
+    width: auto; }
index 61b095f..3a6f6d4 100644 (file)
@@ -58,4 +58,8 @@
     .required label:before {
         content: '* ';
     }
+
+    input[type="radio"] {
+        width: auto;
+    }
 }
diff --git a/prawokultury/templates/contact/register-speaker/form.html b/prawokultury/templates/contact/register-speaker/form.html
new file mode 100644 (file)
index 0000000..d35e3c9
--- /dev/null
@@ -0,0 +1,47 @@
+{% extends "base.html" %}
+{% load i18n chunks %}
+
+{% block "titleextra" %}{{ form.form_title }} :: {% endblock %}
+
+{% block "body" %}
+    <style>
+        #id_thematic_track {
+            list-style: none;
+        }
+        #id_thematic_track label {
+            font-weight: normal;
+        }
+        #id_thematic_track label:before {
+            content: '';
+        }
+    </style>
+
+    <h1>{% block contact_form_title %}{{ form.form_title }}{% endblock %}</h1>
+
+    {% if not form.started %}
+        <div class="form-info">
+            {% chunk "contact_form__"|add:form.form_tag|add:"__not_started" %}
+        </div>
+    {% else %}
+        {% if form.closed %}
+            <div class="form-info">
+                {% chunk "contact_form__"|add:form.form_tag|add:"__closed" %}
+            </div>
+        {% else %}
+             <div class="form-info">
+                {% chunk "contact_form__"|add:form.form_tag|add:"__running" %}
+            </div>
+
+            <form method="POST" action="." enctype="multipart/form-data" class="submit-form">
+              {% csrf_token %}
+              <table>
+                {{ form.as_table }}
+                <tr><td></td><td><button>{% block contact_form_submit %}{{ form.submit_label }}{% endblock %}</button></td></tr>
+              </table>
+            </form>
+        {% endif %}
+    {% endif %}
+
+<script type="text/javascript" src="/static/js/prefill.js"></script>
+
+{% endblock %}
diff --git a/prawokultury/templates/contact/register-speaker/mail_body.txt b/prawokultury/templates/contact/register-speaker/mail_body.txt
new file mode 100644 (file)
index 0000000..ba1ee10
--- /dev/null
@@ -0,0 +1 @@
+{% extends "contact/register/mail_body.txt" %}
\ No newline at end of file
diff --git a/prawokultury/templates/contact/register-speaker/mail_subject.txt b/prawokultury/templates/contact/register-speaker/mail_subject.txt
new file mode 100644 (file)
index 0000000..7ecb3bd
--- /dev/null
@@ -0,0 +1 @@
+{% extends "contact/register/mail_subject.txt" %}
\ No newline at end of file
diff --git a/prawokultury/templates/contact/register-speaker/thanks.html b/prawokultury/templates/contact/register-speaker/thanks.html
new file mode 100644 (file)
index 0000000..2654563
--- /dev/null
@@ -0,0 +1 @@
+{% extends "contact/register/thanks.html" %}
\ No newline at end of file
index 516fcfe..bd70ef1 100644 (file)
@@ -6,44 +6,24 @@
 {% block "body" %}
     <h1>{% block contact_form_title %}{{ form.form_title }}{% endblock %}</h1>
 
-    <div class="form-info">
-    {% block contact_form_description %}
-        {% chunk "contact_form__"|add:form.form_tag %}
-    {% endblock %}
-    </div>
 
 {% if not form.started %}
   {# Not yet started. #}
-  <div class="warning">
+  <div class="form-info">
     {% chunk "contact_form__"|add:form.form_tag|add:"__not_started" %}
   </div>
 {% else %}
   {# Already started. #}
-  {% if form.limit_reached and not form.open_call %}
+  {% if form.limit_reached %}
     {# Already closed. #}
-    <div class="warning">
+    <div class="form-info">
       {% 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 %}
-
+    <div class="form-info">
+        {% chunk "contact_form__"|add:form.form_tag|add:"__running" %}
+    </div>
     <form method="POST" action="." enctype="multipart/form-data" class="submit-form">
       {% csrf_token %}
       <table>