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'
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-28th', _('September 28th only')),
40 ('only-29th', _('September 29th 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 form_tag = 'register-speaker'
183 save_as_tag = '2017-speaker'
184 form_title = _('Open call for presentations')
185 notify_on_register = False
187 # inherited fields included so they are not translated
188 first_name = forms.CharField(label=_('First name'), max_length=128)
189 last_name = forms.CharField(label=_('Last name'), max_length=128)
190 organization = forms.CharField(label=_('Organization'),
191 max_length=256, required=False)
192 agree_mailing = forms.BooleanField(
193 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
196 agree_license = forms.BooleanField(
197 label=_('Permission for publication'),
198 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.')),
202 presentation_thematic_track = forms.ChoiceField(
203 label=_('Please select one thematic track'),
204 choices=[(t, mark_safe('<strong>%s</strong><p style="margin-left: 20px;">%s</p>' % (t, desc))) for t, desc in tracks],
205 widget=forms.RadioSelect())
207 bio = forms.CharField(label=_('Short biographical note in English (max. 500 characters)'), widget=forms.Textarea,
208 max_length=500, required=False)
209 photo = forms.FileField(label=_('Photo'), required=False)
210 phone = forms.CharField(label=_('Phone number'), max_length=64,
212 help_text=_('Used only for organizational purposes.'))
214 presentation_title = forms.CharField(
215 label=mark_safe_lazy(_('Title of the presentation in English')),
216 max_length=256, required=False)
217 presentation_summary = forms.CharField(label=_('Summary of presentation (max. 1800 characters)'),
218 widget=forms.Textarea, max_length=1800)
220 # presentation_post_conference_publication = forms.BooleanField(
221 # label=_('I am interested in including my paper in the post-conference publication'),
227 agree_terms = forms.BooleanField(
228 label=mark_safe_lazy(_(u'I accept <a href="/en/info/terms-and-conditions/">'
229 u'CopyCamp Terms and Conditions</a>.'))
232 # workshop = forms.BooleanField(label=_('Workshop'), required=False)
233 # workshop_title = forms.CharField(label=_('Title of workshop'),
234 # max_length=256, required=False)
235 # workshop_summary = forms.CharField(label=_('Summary of workshop (max. 1800 characters)'),
236 # widget=forms.Textarea, max_length=1800, required=False)
238 def __init__(self, *args, **kw):
239 super(RegisterSpeaker, self).__init__(*args, **kw)
240 self.started = getattr(settings, 'REGISTRATION_SPEAKER_STARTED', False)
241 self.closed = getattr(settings, 'REGISTRATION_SPEAKER_CLOSED', False)
242 self.fields.keyOrder = [
250 'presentation_title',
251 'presentation_summary',
252 'presentation_thematic_track',
253 # 'presentation_post_conference_publication',
256 # 'workshop_summary',
265 class RemindForm(ContactForm):
266 form_tag = 'remind-me'
267 save_as_tag = 'remind-me-2017'
268 form_title = u'CopyCamp 2017'
269 notify_on_register = False
273 class NextForm(ContactForm):
275 form_title = _('Next CopyCamp')
277 name = forms.CharField(label=_('Name'), max_length=128)
278 contact = forms.EmailField(label=_('E-mail'), max_length=128)
279 organization = forms.CharField(label=_('Organization'),
280 max_length=256, required=False)
283 class WorkshopForm(ContactForm):
284 form_tag = 'workshops'
285 save_as_tag = 'workshops-2017'
286 conference_name = u'CopyCamp 2017'
287 form_title = _('Workshop')
289 name = forms.CharField(label=_('Name'), max_length=128)
290 contact = forms.EmailField(label=_('E-mail'), max_length=128)
291 organization = forms.CharField(label=_('Organization'),
292 max_length=256, required=False)
293 country = forms.CharField(label=_('Country'), max_length=128)
295 _header = HeaderField(
296 label=mark_safe_lazy(_("<h3>I'll take a part in workshops</h3>")),
297 help_text=_('Only workshops with any spots left are visible here.'))
299 _h1 = HeaderField(label=mark_safe_lazy(_("<strong>Thursday, October 27th, 10 a.m.–12 noon</strong>")))
301 w_dimitrov = forms.BooleanField(label=_(u'Dimitar Dimitrov: Hacking Brussels'), required=False)
302 w_vangompel = forms.BooleanField(label=_(
303 u'Stef van Gompel: Methods and constraints for including evidence in IP lawmaking'), required=False)
305 _h2 = HeaderField(label=mark_safe_lazy(_("<strong>Friday, October 28th, 10 a.m.–12 noon</strong>")))
307 w_siewicz = forms.BooleanField(label=_(
308 u'dr Krzysztof Siewicz, dr Marta Hoffman-Sommer: '
309 u'Legal aspects of using research data in the age of Open Data'), required=False)
310 w_siewicz_project = forms.CharField(
312 u'<p style="margin-top: 0"><strong>Qualification for this workshop will be based on the answers '
313 u'for the following problem:</strong></p>'
314 u'Please choose a particular dataset from any research project you are involved in and provide '
315 u'a description (no more than 1800 characters). Selected datasets will be discussed during '
316 u'the workshop as case studies. In your description, please include the following information: '
317 u'What is the research goal of the project (in the context of the chosen dataset)? '
318 u'What data is being collected and how is it stored? What is the process of data collection '
319 u'or generation? Who is involved in collecting or producing the data and in what manner?'),
320 max_length=1800, widget=forms.Textarea, required=False)
321 w_google = forms.BooleanField(label=_(
322 u'Marcin Olender, Google: Prawo autorskie na YouTube (workshop in Polish)'), required=False)
324 _h3 = HeaderField(label=mark_safe_lazy(_("<strong>Friday, October 28th, 12 noon–2 p.m.</strong>")))
326 w_patronite = forms.BooleanField(label=_(
327 u'Mateusz Górski, Michał Leksiński, Patronite: Jak zarabiać i się nie sprzedać – warsztaty dla twórców '
328 u'(workshop in Polish)'),
331 w_gurionova = forms.BooleanField(label=_(
332 u'Olga Goriunova: The Lurker and the politics of knowledge in data culture'), required=False)
334 _header_1 = HeaderField(label='')
336 start_workshops = ('dimitrov', 'vangompel', 'siewicz', 'google', 'patronite', 'gurionova')
338 slots = (('_h1', 'dimitrov', 'vangompel'), ('_h2', 'siewicz', 'google'), ('_h3', 'patronite', 'gurionova'))
340 agree_mailing = forms.BooleanField(
341 label=_('I am interested in receiving information about the Modern Poland Foundation\'s activities by e-mail'),
343 agree_data = forms.BooleanField(
344 label=_('Permission for data processing'),
346 u'I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. Marszałkowska 84/92, '
347 u'00-514 Warszawa) permission to process my personal data (name, e-mail address) for purposes of '
348 u'registration for CopyCamp conference.'))
349 agree_license = forms.BooleanField(
350 label=_('Permission for publication'),
351 help_text=mark_safe_lazy(_(
352 u'I agree to having materials, recorded during the conference, released under the terms of '
353 u'<a href="http://creativecommons.org/licenses/by-sa/3.0/deed">CC\u00a0BY-SA</a> '
354 u'license and to publishing my image.')),
357 def __init__(self, *args, **kwargs):
358 super(WorkshopForm, self).__init__(*args, **kwargs)
359 # self.limit_reached = Contact.objects.filter(form_tag=self.save_as_tag).count() >= 60
361 url = Entry.objects.get(slug_pl='regulamin').get_absolute_url()
362 self.fields['agree_toc'] = forms.BooleanField(
364 label=mark_safe(_('I accept <a href="%s">Terms and Conditions of CopyCamp</a>') % url)
366 except Entry.DoesNotExist:
368 counts = {k: 0 for k in self.start_workshops}
369 for contact in Contact.objects.filter(form_tag=self.save_as_tag):
370 for workshop in self.start_workshops:
371 if contact.body.get('w_%s' % workshop, False): counts[workshop] += 1
373 for k, v in counts.items():
376 if 'w_%s' % k in self.fields:
377 del self.fields['w_%s' % k]
378 # if k in self.workshops:
379 # self.workshops.remove(k)
381 self.fields['_header'].help_text = None
384 if self.cleaned_data.get('w_siewicz') and not self.cleaned_data.get('w_siewicz_project'):
385 self._errors['w_siewicz_project'] = [_("Please submit your answer to qualify for this workshop")]
386 for slot in self.slots:
387 if sum(1 for w in slot if self.cleaned_data.get('w_%s' % w)) > 1:
388 self._errors[slot[0]] = [_("You can't choose more than one workshop during the same period")]
389 if not any(self.cleaned_data.get('w_%s' % w) for w in self.start_workshops):
390 self._errors['_header'] = [_("Please choose at least one workshop.")]
391 return self.cleaned_data