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_noop 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'
24 notify_on_register = False
26 form_title = _('Registration')
27 admin_list = ['first_name', 'last_name', 'organization']
29 first_name = forms.CharField(label=_('First name'), max_length=128)
30 last_name = forms.CharField(label=_('Last name'), max_length=128)
31 contact = forms.EmailField(label=_('E-mail'), max_length=128)
32 organization = forms.CharField(label=_('Organization'),
33 max_length=256, required=False)
34 country = forms.ChoiceField(label=_('Country'), choices=zip(COUNTRIES, COUNTRIES))
36 days = forms.ChoiceField(
37 label=_("I'm planning to show up on"),
39 ('both', _('Both days of the conference')),
40 ('only-28th', _('September 28th only')),
41 ('only-29th', _('September 29th only')),
42 ], widget=forms.RadioSelect())
45 times_attended = forms.ChoiceField(
47 label=_("1. How many times have you attended CopyCamp?"),
52 ('3', _('three times')),
53 ('4', _('four times')),
54 ('5', _('five times')),
55 ], widget=forms.RadioSelect())
56 age = forms.ChoiceField(
58 label=_("2. Please indicate your age bracket:"),
60 ('0-19', _('19 or below')),
61 ('20-25', _('20-25')),
62 ('26-35', _('26-35')),
63 ('36-45', _('36-45')),
64 ('46-55', _('46-55')),
65 ('56-65', _('56-65')),
66 ('66+', _('66 or above')),
67 ], widget=forms.RadioSelect())
68 areas = forms.MultipleChoiceField(
70 label=_("3. Please indicate up to 3 areas you feel most affiliated with"),
72 ('sztuki plastyczne', _('visual art')),
73 ('literatura', _('literature')),
74 ('muzyka', _('music')),
75 ('teatr', _('theatre')),
76 ('film', _('film production')),
77 ('wydawanie', _('publishing')),
79 ('ekonomia', _('economy')),
80 ('socjologia', _('sociology')),
81 ('technika', _('technology')),
82 ('edukacja', _('education')),
83 ('studia', _('higher education')),
84 ('nauka', _('academic research')),
85 ('biblioteki', _('library science')),
86 ('administracja', _('public administration')),
87 ('ngo', _('nonprofit organisations')),
88 ('other', _('other (please specify below)')),
89 ], widget=forms.CheckboxSelectMultiple())
90 areas_other = forms.CharField(required=False, label=_('Fill if you selected “other” above'))
91 source = forms.ChoiceField(
93 label=_("4. Please indicate how you received information about the conference:"),
95 ('znajomi', _('through friends sharing on the web')),
96 ('znajomi2', _('through friends by other means')),
97 ('prasa', _('through press')),
98 ('fnp', _('directly through the Foundation\'s facebook or website')),
99 ('www', _('through other websites (please specify below)')),
100 ('other', _('other (please specify below)')),
101 ], widget=forms.RadioSelect())
102 source_other = forms.CharField(required=False, label=_('Fill if you selected “other” or “other website” above'))
103 motivation = forms.ChoiceField(
105 label=_("6. Please indicate the most important factor for your willingness to participate:"),
107 ('speaker', _('listening to particular speaker(s)')),
108 ('networking', _('good networking occasion')),
109 ('partnering', _('partnering with organisations present at the event')),
110 ('other', _('other (please specify below)')),
111 ], widget=forms.RadioSelect())
112 motivation_other = forms.CharField(required=False, label=_('Fill if you selected “other” above'))
114 agree_mailing = forms.BooleanField(
115 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
118 agree_data = forms.BooleanField(
119 label=_('Permission for data processing'),
120 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.')
122 agree_license = forms.BooleanField(
123 label=_('Permission for publication'),
124 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.')),
128 def __init__(self, *args, **kwargs):
129 super(RegistrationForm, self).__init__(*args, **kwargs)
130 self.started = getattr(settings, 'REGISTRATION_STARTED', False)
131 self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= settings.REGISTRATION_LIMIT
133 url = Entry.objects.get(slug_pl='regulamin').get_absolute_url()
134 self.fields['agree_toc'] = forms.BooleanField(
136 label=mark_safe(_('I accept <a href="%s">Terms and Conditions of CopyCamp</a>') % url)
138 except Entry.DoesNotExist:
141 def clean_areas(self):
142 data = self.cleaned_data['areas']
144 raise forms.ValidationError(_('Select at most 3 areas'))
147 def main_fields(self):
148 return [self[name] for name in ('first_name', 'last_name', 'contact', 'organization', 'country', 'days')]
150 def survey_fields(self):
151 return [self[name] for name in (
152 'times_attended', 'age',
153 'areas', 'areas_other', 'source', 'source_other', 'motivation', 'motivation_other')]
155 def agreement_fields(self):
156 return [self[name] for name in ('agree_mailing', 'agree_data', 'agree_license', 'agree_toc')]
160 (_('business models, heritage digitization, remix'),
161 _('What are the boundaries of appropriation in culture? '
162 'Who owns the past and whether these exclusive rights allow to '
163 'control present and future? How to make money from creativity without selling yourself?')),
164 (_('health, food, security, and exclusive rights'),
165 _('Who owns medicines and equipment necessary to provide health care? '
166 'Who owns grain and machines used to harvest it? '
167 'To what extent exclusive rights can affect what you eat, '
168 'how you exercise, whether you can apply a specific treatment?')),
169 (_('text and data mining, machine learning, online education'),
170 _('Do you think own the data you feed to algorithms? Or maybe you think you own these algorithms? '
171 'What if you can’t mine the data because you actually don’t own any of those rights? '
172 'What does it mean to own data about someone, or data necessary for that person’s education?')),
173 (_('IoT: autonomous cars, smart homes, wearables'),
174 _('What does it mean to own exclusive rights to software and data used to construct autonomous agents? '
175 'What will it mean in a near future?')),
176 (_('hacking government data, public procurement, public aid in culture'),
177 _('Who owns information created using public money? How can this information be appropriated? '
178 'What is the role of government in the development of information infrastructure?')),
182 class RegisterSpeaker(RegistrationForm):
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