X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/af43c872d053f7b589ae2be58ba0ea47511a9064..2e008ebe7ee77a359366823d1604e111fab98ca3:/edumed/contact_forms.py
diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py
index 3ffdded..0ff8415 100644
--- a/edumed/contact_forms.py
+++ b/edumed/contact_forms.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from django import forms
from contact.forms import ContactForm
+from django.utils.translation import ugettext_lazy as _
class RegistrationForm(ContactForm):
@@ -100,6 +101,8 @@ class NoEmptyFormsAllowedBaseFormSet(forms.formsets.BaseFormSet):
raise forms.ValidationError(u"ProszÄ podaÄ dane przynajmniej jednego ucznia.")
class WTEMForm(ContactForm):
+ disabled = True
+ disabled_template = 'wtem/disabled_contact_form.html'
form_tag = "wtem"
form_title = u"WTEM - rejestracja uczestników"
submit_label = u"WyÅlij zgÅoszenie"
@@ -117,8 +120,13 @@ class WTEMForm(ContactForm):
zgoda_regulamin = forms.BooleanField(
label=u'Znam i akceptujÄ regulamin Wielkiego Turnieju Edukacji Medialnej.',
- help_text=u'Zobacz regulamin Wielkiego Turnieju Edukacji Medialnej.'
+ help_text=u'Zobacz regulamin Wielkiego Turnieju Edukacji Medialnej.'
)
+ zgoda_dane = forms.BooleanField(
+ label=u'Wyrażam zgodÄ na przetwarzanie moich danych osobowych oraz danych osobowych moich podopiecznych, a także na publikacjÄ prac na wolnej licencji.',
+ help_text=u'Zobacz peÅnÄ
treÅÄ oÅwiadczenia.'
+ )
+
potw_uczniowie = forms.BooleanField(
label=u'Potwierdzam, że zgÅoszeni Uczestnicy/Uczestniczki w chwili rejestracji sÄ
uczniami/uczennicami szkoÅy ponadgimnazjalnej.',
)
@@ -127,3 +135,73 @@ class WTEMForm(ContactForm):
required=False
)
+ extract_types = (dict(slug='extended', label=_('extended')),)
+
+ @staticmethod
+ def get_extract_fields(contact, extract_type_slug):
+ fields = contact.body.keys()
+ fields.pop(fields.index('student'))
+ fields.extend(['contact', 'student_first_name', 'student_last_name', 'student_email'])
+ return fields
+
+ @staticmethod
+ def get_extract_records(keys, contact, extract_type_slug):
+ toret = [dict()]
+ for field_name in keys:
+ if field_name.startswith('student_'):
+ continue
+ if field_name == 'contact':
+ val = contact.contact
+ else:
+ val = contact.body[field_name]
+ toret[0][field_name] = val
+
+ current = toret[0]
+ for student in contact.body['student']:
+ for attr in ('first_name', 'last_name', 'email'):
+ current['student_' + attr] = student[attr]
+ if not current in toret:
+ toret.append(current)
+ current = dict()
+ return toret
+
+
+class MILForm(ContactForm):
+ form_tag = 'mil'
+ form_title = _('Share your thoughts on the "Media and information literacy competencies catalogue"')
+ submit_label = _('Submit')
+ base_template = 'base_mil.html'
+ site_name = site_domain = 'katalog.nowoczesnapolska.org.pl'
+
+ name = forms.CharField(label = _('Name and Surname'), max_length = 255)
+ contact = forms.EmailField(label = _('E-mail'), max_length = 255)
+
+ institution = forms.CharField(label =_('Institution'), widget = forms.Textarea, max_length = 8192)
+
+ question_stages = forms.CharField(
+ label = _('What do you think about the proposed educational stages classification?'),
+ widget = forms.Textarea,
+ max_length = 255,
+ required = False
+ )
+
+ question_fields = forms.CharField(
+ label = _('What do you think about the proposed thematic fields?'),
+ widget = forms.Textarea,
+ max_length = 255,
+ required = False
+ )
+
+ question_left_out = forms.CharField(
+ label = _('What important areas of media and information literacy have been left out?'),
+ widget = forms.Textarea,
+ max_length = 255,
+ required = False
+ )
+
+ other = forms.CharField(
+ label = _('Other suggestions and comments'),
+ widget = forms.Textarea,
+ max_length = 255,
+ required = False
+ )