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 from django.utils.safestring import mark_safe
8 from migdal.models import Entry
11 class RegistrationForm(ContactForm):
15 conference_name = u'CopyCamp 2014'
17 form_title = _('Take part!')
18 admin_list = ['name', 'organization', 'title']
20 name = forms.CharField(label=_('Name'), max_length=128)
21 contact = forms.EmailField(label=_('E-mail'), max_length=128)
22 organization = forms.CharField(label=_('Organization'),
23 max_length=256, required=False)
25 agree_mailing = forms.BooleanField(
26 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
29 agree_data = forms.BooleanField(
30 label=_('Permission for data processing'),
31 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.')
33 agree_license = forms.BooleanField(
34 label=_('Permission for publication'),
35 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.'),
39 def __init__(self, *args, **kwargs):
40 super(RegistrationForm, self).__init__(*args, **kwargs)
41 self.started = getattr(settings, 'REGISTRATION_STARTED', False)
42 self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
44 url = Entry.objects.get(slug_pl='regulamin').get_absolute_url()
45 self.fields['agree_toc'] = forms.BooleanField(
47 label = mark_safe(_('I accept <a href="%s">Terms and Conditions of CopyCamp</a>') % url)
49 except Entry.DoesNotExist:
55 _('Creative Middle Class'),
58 _('Copyright and Education'),
59 _('Technology and Innovation'),
60 _('Copyright and Human Rights'),
62 _('Future of the Book'),
63 _('Copyright Enforcement'),
64 _('Future of Copyright'),
68 class RegisterSpeaker(RegistrationForm):
69 form_tag = 'register-speaker'
70 save_as_tag = '2014-speaker'
72 thematic_track = forms.ChoiceField(
73 label = _('Please select one thematic track'),
74 choices=[(t,t) for t in tracks], widget=forms.RadioSelect())
76 bio = forms.CharField(label=_('Short biographical note (max. 500 characters)'),
77 widget=forms.Textarea, max_length=500, required=True)
79 title = forms.CharField(label=_('Title of presentation'),
80 max_length=256, required=True)
81 presentation = forms.FileField(label=_('Presentation'),
83 summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
84 widget=forms.Textarea, max_length=1800, required=True)
86 post_conference_publication = forms.BooleanField(
87 label=_('I am interested in including my paper in the post-conference publication'),
91 def __init__(self, *args, **kw):
92 super(RegisterSpeaker, self).__init__(*args, **kw)
93 self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
94 self.fields.keyOrder = [
103 'post_conference_publication',
110 class NextForm(ContactForm):
112 form_title = _('Next CopyCamp')
114 name = forms.CharField(label=_('Name'), max_length=128)
115 contact = forms.EmailField(label=_('E-mail'), max_length=128)
116 organization = forms.CharField(label=_('Organization'),
117 max_length=256, required=False)