1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
4 from django.conf import settings
5 from django import forms
6 from contact.forms import ContactForm
7 from contact.models import Contact
8 from contact.fields import HeaderField
9 from django.utils.functional import lazy
10 from django.utils.translation import ugettext_lazy as _
11 from django.utils.safestring import mark_safe
12 from migdal.models import Entry
14 from prawokultury.countries import COUNTRIES
16 mark_safe_lazy = lazy(mark_safe, unicode)
19 class RegistrationForm(ContactForm):
23 conference_name = u'CopyCamp 2017'
25 form_title = _('Registration')
26 admin_list = ['first_name', 'last_name', 'organization']
28 first_name = forms.CharField(label=_('First name'), max_length=128)
29 last_name = forms.CharField(label=_('Last name'), max_length=128)
30 contact = forms.EmailField(label=_('E-mail'), max_length=128)
31 organization = forms.CharField(label=_('Organization'),
32 max_length=256, required=False)
33 country = forms.ChoiceField(label=_('Country'), choices=zip(COUNTRIES, COUNTRIES))
35 days = forms.ChoiceField(
36 label=_("I'm planning to show up on"),
38 ('both', _('Both days of the conference')),
39 ('only-27th', _('October 27th only')),
40 ('only-28th', _('October 28th only')),
41 ], widget=forms.RadioSelect())
44 times_attended = forms.ChoiceField(
46 label=_("1. How many times have you attended CopyCamp?"),
51 ('3', _('three times')),
52 ('4', _('four times')),
53 ('5', _('five times')),
54 ], widget=forms.RadioSelect())
55 age = forms.ChoiceField(
57 label=_("2. Please indicate your age bracket:"),
59 ('0-19', _('19 or below')),
60 ('20-25', _('20-25')),
61 ('26-35', _('26-35')),
62 ('36-45', _('36-45')),
63 ('46-55', _('46-55')),
64 ('56-65', _('56-65')),
65 ('66+', _('66 or above')),
66 ], widget=forms.RadioSelect())
67 areas = forms.MultipleChoiceField(
69 label=_("3. Please indicate up to 3 areas you feel most affiliated with"),
71 ('sztuki plastyczne', _('visual art')),
72 ('literatura', _('literature')),
73 ('muzyka', _('music')),
74 ('teatr', _('theatre')),
75 ('film', _('film production')),
76 ('wydawanie', _('publishing')),
78 ('ekonomia', _('economy')),
79 ('socjologia', _('sociology')),
80 ('technika', _('technology')),
81 ('edukacja', _('education')),
82 ('studia', _('higher education')),
83 ('nauka', _('academic research')),
84 ('biblioteki', _('library science')),
85 ('administracja', _('public administration')),
86 ('ngo', _('nonprofit organisations')),
87 ('other', _('other (please specify below)')),
88 ], widget=forms.CheckboxSelectMultiple())
89 areas_other = forms.CharField(required=False, label=_('Fill if you selected “other” above'))
90 source = forms.ChoiceField(
92 label=_("4. Please indicate how you received information about the conference:"),
94 ('znajomi', _('through friends sharing on the web')),
95 ('znajomi2', _('through friends by other means')),
96 ('prasa', _('through press')),
97 ('fnp', _('directly through the Foundation\'s facebook or website')),
98 ('www', _('through other websites (please specify below)')),
99 ('other', _('other (please specify below)')),
100 ], widget=forms.RadioSelect())
101 source_other = forms.CharField(required=False, label=_('Fill if you selected “other” or “other website” above'))
102 motivation = forms.ChoiceField(
104 label=_("6. Please indicate the most important factor for your willingness to participate:"),
106 ('speaker', _('listening to particular speaker(s)')),
107 ('networking', _('good networking occasion')),
108 ('partnering', _('partnering with organisations present at the event')),
109 ('other', _('other (please specify below)')),
110 ], widget=forms.RadioSelect())
111 motivation_other = forms.CharField(required=False, label=_('Fill if you selected “other” above'))
113 agree_mailing = forms.BooleanField(
114 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
117 agree_data = forms.BooleanField(
118 label=_('Permission for data processing'),
119 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.')
121 agree_license = forms.BooleanField(
122 label=_('Permission for publication'),
123 help_text=mark_safe_lazy(_(u'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\u00a0BY-SA</a> license and to publishing my image.')),
127 def __init__(self, *args, **kwargs):
128 super(RegistrationForm, self).__init__(*args, **kwargs)
129 self.started = getattr(settings, 'REGISTRATION_STARTED', False)
130 self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
132 url = Entry.objects.get(slug_pl='regulamin').get_absolute_url()
133 self.fields['agree_toc'] = forms.BooleanField(
135 label=mark_safe(_('I accept <a href="%s">Terms and Conditions of CopyCamp</a>') % url)
137 except Entry.DoesNotExist:
140 def clean_areas(self):
141 data = self.cleaned_data['areas']
143 raise forms.ValidationError(_('Select at most 3 areas'))
146 def main_fields(self):
147 return [self[name] for name in ('first_name', 'last_name', 'contact', 'organization', 'country', 'days')]
149 def survey_fields(self):
150 return [self[name] for name in (
151 'times_attended', 'age',
152 'areas', 'areas_other', 'source', 'source_other', 'motivation', 'motivation_other')]
154 def agreement_fields(self):
155 return [self[name] for name in ('agree_mailing', 'agree_data', 'agree_license', 'agree_toc')]
159 (_('business models, heritage digitization, remix'),
160 _('What are the boundaries of appropriation in culture? '
161 'Who owns the past and whether these exclusive rights allow to '
162 'control present and future? How to make money from creativity without selling yourself?')),
163 (_('health, food, security, and exclusive rights'),
164 _('Who owns medicines and equipment necessary to provide health care? '
165 'Who owns grain and machines used to harvest it? '
166 'To what extent exclusive rights can affect what you eat, '
167 'how you exercise, whether you can apply a specific treatment?')),
168 (_('text and data mining, machine learning, online education'),
169 _('Do you think own the data you feed to algorithms? Or maybe you think you own these algorithms? '
170 'What if you can’t mine the data because you actually don’t own any of those rights? '
171 'What does it mean to own data about someone, or data necessary for that person’s education?')),
172 (_('IoT: autonomous cars, smart homes, wearables'),
173 _('What does it mean to own exclusive rights to software and data used to construct autonomous agents? '
174 'What will it mean in a near future?')),
175 (_('hacking government data, public procurement, public aid in culture'),
176 _('Who owns information created using public money? How can this information be appropriated? '
177 'What is the role of government in the development of information infrastructure?')),
181 class RegisterSpeaker(RegistrationForm):
182 from django.utils.translation import ugettext_noop as _
183 form_tag = 'register-speaker'
184 save_as_tag = '2017-speaker'
185 form_title = _('Open call for presentations')
186 notify_on_register = False
188 # inherited fields included so they are not translated
189 first_name = forms.CharField(label=_('First name'), max_length=128)
190 last_name = forms.CharField(label=_('Last name'), max_length=128)
191 organization = forms.CharField(label=_('Organization'),
192 max_length=256, required=False)
193 agree_mailing = forms.BooleanField(
194 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
197 agree_license = forms.BooleanField(
198 label=_('Permission for publication'),
199 help_text=mark_safe_lazy(_(u'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\u00a0BY-SA</a> license and to publishing my image.')),
203 presentation_thematic_track = forms.ChoiceField(
204 label=_('Please select one thematic track'),
205 choices=[(t, mark_safe('<strong>%s</strong><p style="margin-left: 20px;">%s</p>' % (t, desc))) for t, desc in tracks],
206 widget=forms.RadioSelect())
208 bio = forms.CharField(label=_('Short biographical note in English (max. 500 characters)'), widget=forms.Textarea,
209 max_length=500, required=False)
210 photo = forms.FileField(label=_('Photo'), required=False)
211 phone = forms.CharField(label=_('Phone number'), max_length=64,
213 help_text=_('Used only for organizational purposes.'))
215 presentation_title = forms.CharField(
216 label=mark_safe_lazy(_('Title of the presentation in English')),
217 max_length=256, required=False)
218 presentation_summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
219 widget=forms.Textarea, max_length=1800)
221 # presentation_post_conference_publication = forms.BooleanField(
222 # label=_('I am interested in including my paper in the post-conference publication'),
228 agree_terms = forms.BooleanField(
229 label=mark_safe_lazy(_(u'I accept <a href="/en/info/terms-and-conditions/">'
230 u'CopyCamp Terms and Conditions</a>.'))
233 # workshop = forms.BooleanField(label=_('Workshop'), required=False)
234 # workshop_title = forms.CharField(label=_('Title of workshop'),
235 # max_length=256, required=False)
236 # workshop_summary = forms.CharField(label=_('Summary of workshop (max. 1800 characters)'),
237 # widget=forms.Textarea, max_length=1800, required=False)
239 def __init__(self, *args, **kw):
240 super(RegisterSpeaker, self).__init__(*args, **kw)
241 self.started = getattr(settings, 'REGISTRATION_SPEAKER_STARTED', False)
242 self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
243 self.fields.keyOrder = [
251 'presentation_title',
252 'presentation_summary',
253 'presentation_thematic_track',
254 # 'presentation_post_conference_publication',
257 # 'workshop_summary',
266 class RemindForm(ContactForm):
267 form_tag = 'remind-me'
268 save_as_tag = 'remind-me-2017'
269 form_title = u'CopyCamp 2017'
270 notify_on_register = False
274 class NextForm(ContactForm):
276 form_title = _('Next CopyCamp')
278 name = forms.CharField(label=_('Name'), max_length=128)
279 contact = forms.EmailField(label=_('E-mail'), max_length=128)
280 organization = forms.CharField(label=_('Organization'),
281 max_length=256, required=False)
284 class WorkshopForm(ContactForm):
285 form_tag = 'workshops'
286 save_as_tag = 'workshops-2017'
287 conference_name = u'CopyCamp 2017'
288 form_title = _('Workshop')
290 name = forms.CharField(label=_('Name'), max_length=128)
291 contact = forms.EmailField(label=_('E-mail'), max_length=128)
292 organization = forms.CharField(label=_('Organization'),
293 max_length=256, required=False)
294 country = forms.CharField(label=_('Country'), max_length=128)
296 _header = HeaderField(
297 label=mark_safe_lazy(_("<h3>I'll take a part in workshops</h3>")),
298 help_text=_('Only workshops with any spots left are visible here.'))
300 _h1 = HeaderField(label=mark_safe_lazy(_("<strong>Thursday, October 27th, 10 a.m.–12 noon</strong>")))
302 w_dimitrov = forms.BooleanField(label=_(u'Dimitar Dimitrov: Hacking Brussels'), required=False)
303 w_vangompel = forms.BooleanField(label=_(
304 u'Stef van Gompel: Methods and constraints for including evidence in IP lawmaking'), required=False)
306 _h2 = HeaderField(label=mark_safe_lazy(_("<strong>Friday, October 28th, 10 a.m.–12 noon</strong>")))
308 w_siewicz = forms.BooleanField(label=_(
309 u'dr Krzysztof Siewicz, dr Marta Hoffman-Sommer: '
310 u'Legal aspects of using research data in the age of Open Data'), required=False)
311 w_siewicz_project = forms.CharField(
313 u'<p style="margin-top: 0"><strong>Qualification for this workshop will be based on the answers '
314 u'for the following problem:</strong></p>'
315 u'Please choose a particular dataset from any research project you are involved in and provide '
316 u'a description (no more than 1800 characters). Selected datasets will be discussed during '
317 u'the workshop as case studies. In your description, please include the following information: '
318 u'What is the research goal of the project (in the context of the chosen dataset)? '
319 u'What data is being collected and how is it stored? What is the process of data collection '
320 u'or generation? Who is involved in collecting or producing the data and in what manner?'),
321 max_length=1800, widget=forms.Textarea, required=False)
322 w_google = forms.BooleanField(label=_(
323 u'Marcin Olender, Google: Prawo autorskie na YouTube (workshop in Polish)'), required=False)
325 _h3 = HeaderField(label=mark_safe_lazy(_("<strong>Friday, October 28th, 12 noon–2 p.m.</strong>")))
327 w_patronite = forms.BooleanField(label=_(
328 u'Mateusz Górski, Michał Leksiński, Patronite: Jak zarabiać i się nie sprzedać – warsztaty dla twórców '
329 u'(workshop in Polish)'),
332 w_gurionova = forms.BooleanField(label=_(
333 u'Olga Goriunova: The Lurker and the politics of knowledge in data culture'), required=False)
335 _header_1 = HeaderField(label='')
337 start_workshops = ('dimitrov', 'vangompel', 'siewicz', 'google', 'patronite', 'gurionova')
339 slots = (('_h1', 'dimitrov', 'vangompel'), ('_h2', 'siewicz', 'google'), ('_h3', 'patronite', 'gurionova'))
341 agree_mailing = forms.BooleanField(
342 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
344 agree_data = forms.BooleanField(
345 label=_('Permission for data processing'),
347 u'I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. Marszałkowska 84/92, '
348 u'00-514 Warszawa) permission to process my personal data (name, e-mail address) for purposes of '
349 u'registration for CopyCamp conference.'))
350 agree_license = forms.BooleanField(
351 label=_('Permission for publication'),
352 help_text=mark_safe_lazy(_(
353 u'I agree to having materials, recorded during the conference, released under the terms of '
354 u'<a href="http://creativecommons.org/licenses/by-sa/3.0/deed">CC\u00a0BY-SA</a> '
355 u'license and to publishing my image.')),
358 def __init__(self, *args, **kwargs):
359 super(WorkshopForm, self).__init__(*args, **kwargs)
360 # self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= 60
362 url = Entry.objects.get(slug_pl='regulamin').get_absolute_url()
363 self.fields['agree_toc'] = forms.BooleanField(
365 label=mark_safe(_('I accept <a href="%s">Terms and Conditions of CopyCamp</a>') % url)
367 except Entry.DoesNotExist:
369 counts = {k: 0 for k in self.start_workshops}
370 for contact in Contact.objects.filter(form_tag=self.save_as_tag):
371 for workshop in self.start_workshops:
372 if contact.body.get('w_%s' % workshop, False): counts[workshop] += 1
374 for k, v in counts.items():
377 if 'w_%s' % k in self.fields:
378 del self.fields['w_%s' % k]
379 # if k in self.workshops:
380 # self.workshops.remove(k)
382 self.fields['_header'].help_text = None
385 if self.cleaned_data.get('w_siewicz') and not self.cleaned_data.get('w_siewicz_project'):
386 self._errors['w_siewicz_project'] = [_("Please submit your answer to qualify for this workshop")]
387 for slot in self.slots:
388 if sum(1 for w in slot if self.cleaned_data.get('w_%s' % w)) > 1:
389 self._errors[slot[0]] = [_("You can't choose more than one workshop during the same period")]
390 if not any(self.cleaned_data.get('w_%s' % w) for w in self.start_workshops):
391 self._errors['_header'] = [_("Please choose at least one workshop.")]
392 return self.cleaned_data