A little more readable text.
[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     
23     agree_mailing = forms.BooleanField(
24         label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
25         required=False
26     )
27     agree_data = forms.BooleanField(
28         label=_('Permission for data processing'),
29         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.')
30     )
31     agree_license = forms.BooleanField(
32         label=_('Permission for publication'),
33         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 and to publishing my image.'),
34         required=False
35     )
36
37     def __init__(self, *args, **kwargs):
38         super(RegistrationForm, self).__init__(*args, **kwargs)
39         self.started = getattr(settings, 'REGISTRATION_STARTED', False)
40         self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
41
42
43 tracks = (
44     _('CopyArt'),
45     _('Creative Middle Class'),
46     _('How to Pay?'),
47     _('How to Be Paid?'),
48     _('Copyright and Education'),
49     _('Technology and Innovation'),
50     _('Copyright and Human Rights'),
51     _('Self-Publishing'),
52     _('Future of the Book'),
53     _('Copyright Enforcement'),
54     _('Future of Copyright'),
55     _('Copyright Debate')
56 )
57
58 class RegisterSpeaker(RegistrationForm):
59     form_tag = 'register-speaker'
60     save_as_tag = '2014-speaker'
61
62     thematic_track = forms.ChoiceField(
63         label = _('Please select one thematic track'),
64         choices=[(t,t) for t in tracks], widget=forms.RadioSelect())
65
66     bio = forms.CharField(label=_('Short biographical note (max. 500 characters)'),
67             widget=forms.Textarea, max_length=500, required=True)
68
69     title = forms.CharField(label=_('Title of presentation'),
70             max_length=256, required=True)
71     presentation = forms.FileField(label=_('Presentation'),
72             required=True)
73     summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
74             widget=forms.Textarea, max_length=1800, required=True)
75
76     post_conference_publication = forms.BooleanField(
77         label=_('I am interested in including my paper in the post-conference publication'),
78         required=False
79     )
80
81     def __init__(self, *args, **kw):
82         super(RegisterSpeaker, self).__init__(*args, **kw)
83         self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
84         self.fields.keyOrder = [
85             'name',
86             'contact',
87             'organization',
88             'thematic_track',
89             'bio',
90             'title',
91             'presentation',
92             'summary',
93             'post_conference_publication',
94             'agree_mailing',
95             'agree_data',
96             'agree_license'
97         ]
98
99
100 class NextForm(ContactForm):
101     form_tag = 'next'
102     form_title = _('Next CopyCamp')
103
104     name = forms.CharField(label=_('Name'), max_length=128)
105     contact = forms.EmailField(label=_('E-mail'), max_length=128)
106     organization = forms.CharField(label=_('Organization'),
107             max_length=256, required=False)
108