Changes to CopyCamp registration form
[prawokultury.git] / prawokultury / contact_forms.py
1 # -*- coding: utf-8 -*-
2 from django.conf import settings
3 from django import forms
4 from contact.forms import ContactForm
5 from contact.models import Contact
6 from django.utils.translation import ugettext_lazy as _
7
8
9 class RegistrationForm(ContactForm):
10     form_tag = 'register'
11
12     save_as_tag = '2014'
13     conference_name = u'CopyCamp 2014' 
14     
15     form_title = _('Take part!')
16     admin_list = ['name', 'organization', 'title']
17
18     name = forms.CharField(label=_('Name'), max_length=128)
19     contact = forms.EmailField(label=_('E-mail'), max_length=128)
20     organization = forms.CharField(label=_('Organization'), 
21             max_length=256, required=False)
22     agree_data = forms.BooleanField(
23         label=_('Permission for data processing'),
24         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.')
25     )
26     agree_license = forms.BooleanField(
27         label=_('Permission for publication'),
28         help_text=_('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">CC BY-SA</a> license.')
29     )
30
31     def __init__(self, *args, **kwargs):
32         super(RegistrationForm, self).__init__(*args, **kwargs)
33         self.started = getattr(settings, 'REGISTRATION_STARTED', False)
34         self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
35
36
37 tracks = (
38     'CopyArt',
39     'Creative middle class',
40     'How to Pay?',
41     'How to Be Paid?',
42     'Copyright and Education',
43     'Technology and Innovation',
44     'Copyright and Human Rights',
45     'Self-Publishing',
46     'Future of the Book',
47     'Copyright Enforcement',
48     'Future of Copyright',
49     'Copyright Debate',
50 )
51
52 class RegisterSpeaker(RegistrationForm):
53     form_tag = 'register-speaker'
54     save_as_tag = '2014-speaker'
55
56     thematic_track = forms.ChoiceField(
57         label = _('Please select one thematic track'),
58         choices=[(t,t) for t in tracks], widget=forms.RadioSelect())
59
60     bio = forms.CharField(label=_('Short biographical note (max. 500 characters)'),
61             widget=forms.Textarea, max_length=500, required=True)
62
63     title = forms.CharField(label=_('Title of presentation'),
64             max_length=256, required=True)
65     presentation = forms.FileField(label=_('Presentation'),
66             required=True)
67     summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
68             widget=forms.Textarea, max_length=1800, required=True)
69
70     post_conference_publication = forms.BooleanField(
71         label=_('I am interested in including my paper in the post-conference publication'),
72         required=False
73     )
74
75     def __init__(self, *args, **kw):
76         super(RegisterSpeaker, self).__init__(*args, **kw)
77         self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
78         self.fields.keyOrder = [
79             'name',
80             'contact',
81             'organization',
82             'thematic_track',
83             'bio',
84             'title',
85             'presentation',
86             'summary',
87             'post_conference_publication',
88             'agree_data',
89             'agree_license'
90         ]
91
92
93 class NextForm(ContactForm):
94     form_tag = 'next'
95     form_title = _('Next CopyCamp')
96
97     name = forms.CharField(label=_('Name'), max_length=128)
98     contact = forms.EmailField(label=_('E-mail'), max_length=128)
99     organization = forms.CharField(label=_('Organization'),
100             max_length=256, required=False)
101