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 _
9 class RegistrationForm(ContactForm):
11 form_title = _('Take part!')
13 name = forms.CharField(label=_('Name'), max_length=128)
14 contact = forms.EmailField(label=_('E-mail'), max_length=128)
15 organization = forms.CharField(label=_('Organization'),
16 max_length=256, required=False)
17 title = forms.CharField(label=_('Title of presentation'),
18 max_length=256, required=False)
19 presentation = forms.FileField(label=_('Presentation'),
21 summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
22 widget=forms.Textarea, max_length=1800, required=False)
23 agree_data = forms.BooleanField(
24 label=_('Permission for data processing'),
25 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.')
27 agree_license = forms.BooleanField(
28 label=_('Permission for publication'),
29 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.')
32 def __init__(self, *args, **kwargs):
33 super(RegistrationForm, self).__init__(*args, **kwargs)
34 self.limit_reached = Contact.objects.all().count() >= settings.REGISTRATION_LIMIT
35 if self.limit_reached:
36 for field in ('title', 'summary'):
37 self.fields[field].required = True