X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/4a5465903e5c24822b1d9f68c69f71b5daf4bc45..8bf64e144b5eb0367f8d5da19765ea0dabd66bfb:/edumed/contact_forms.py diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index 89e5121..7271558 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 as _ class RegistrationForm(ContactForm): @@ -81,3 +82,83 @@ class UdzialForm(ContactForm): contact = forms.EmailField(label=u'Adres e-mail', max_length=128) telefon = forms.CharField(label=u'Telefon', max_length=32) uczestnicy = forms.IntegerField(label=u'Przewidywana liczba uczestników zajęć') + + +class WTEMStudentForm(forms.Form): + first_name = forms.CharField(label=u'Imię', max_length=128) + last_name = forms.CharField(label=u'Nazwisko', max_length=128) + email = forms.EmailField(label=u'Adres e-mail', max_length=128) + form_tag = "student" + +class NoEmptyFormsAllowedBaseFormSet(forms.formsets.BaseFormSet): + """ + Won't allow formset_factory to be submitted with no forms + """ + def clean(self): + for form in self.forms: + if form.cleaned_data: + return + raise forms.ValidationError(u"Proszę podać dane przynajmniej jednego ucznia.") + +class WTEMForm(ContactForm): + form_tag = "wtem" + form_title = u"WTEM - rejestracja uczestników" + submit_label = u"Wyślij zgłoszenie" + form_formsets = (forms.formsets.formset_factory(WTEMStudentForm, formset=NoEmptyFormsAllowedBaseFormSet),) + + contact = forms.EmailField(label=u'Adres e-mail opiekuna/opiekunki', max_length=128) + imie = forms.CharField(label=u'Imię', max_length=128) + nazwisko = forms.CharField(label=u'Nazwisko', max_length=128) + function = forms.CharField(label=u'Pełniona funkcja', max_length=255) + institution = forms.CharField(label=u'Nazwa instytucji', max_length=255) + institution_address = forms.CharField(label=u'Adres instytucji', widget=forms.Textarea, max_length=1000) + institution_email = forms.EmailField(label=u'Adres e-mail instytucji', max_length=128) + institution_phone = forms.CharField(label=u'Telefon do instytucji', max_length=32) + institution_www = forms.URLField(label=u'Strona WWW instytucji', max_length=255, required=False) + + zgoda_regulamin = forms.BooleanField( + label=u'Znam i akceptuję regulamin Wielkiego Turnieju Edukacji Medialnej.', + help_text=u'Zobacz regulamin Wielkiego Turnieju Edukacji Medialnej.' + ) + potw_uczniowie = forms.BooleanField( + label=u'Potwierdzam, że zgłoszeni Uczestnicy/Uczestniczki w chwili rejestracji są uczniami/uczennicami szkoły ponadgimnazjalnej.', + ) + zgoda_informacje = forms.BooleanField( + label=u'Wyrażam zgodę na otrzymywanie informacji od Fundacji Nowoczesna Polska związanych z edukacją medialną.', + required=False + ) + +class MILForm(ContactForm): + form_tag = 'mil' + from_title = 'Mil' + submit_label = _('Submit') + base_template = 'base_mil.html' + + 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 + ) + + question_fields = forms.CharField( + label = _('What do you think about the proposed thematic fields?'), + widget = forms.Textarea, + max_length = 255 + ) + + question_left_out = forms.CharField( + label = _('What important areas of media and information literacy have been left out?'), + widget = forms.Textarea, + max_length = 255 + ) + + other = forms.CharField( + label = _('Other suggestions and comments'), + widget = forms.Textarea, + max_length = 255 + )