From: Jan Szejko Date: Wed, 1 Aug 2018 14:31:09 +0000 (+0200) Subject: add reminder form X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/3f06621595592d106f0071e379026f73709360a0 add reminder form --- diff --git a/contact/forms.py b/contact/forms.py index 97fc027..0d09334 100644 --- a/contact/forms.py +++ b/contact/forms.py @@ -41,6 +41,7 @@ class ContactForm(forms.Form): required_css_class = 'required' contact = NotImplemented + data_processing = None def save(self, request, formsets=None): from .models import Attachment, Contact diff --git a/contact/templates/contact/form.html b/contact/templates/contact/form.html index 584629a..7b38415 100644 --- a/contact/templates/contact/form.html +++ b/contact/templates/contact/form.html @@ -19,6 +19,7 @@ {% render_honeypot_field %} {{ form.as_table }} + {% if form.data_processing %}{% endif %}
{{ form.data_processing }}
diff --git a/contact/views.py b/contact/views.py index 84578dc..86c8417 100644 --- a/contact/views.py +++ b/contact/views.py @@ -24,7 +24,7 @@ def form(request, form_tag, force_enabled=False): raise Http404 if not (force_enabled and request.user.is_superuser): disabled = getattr(form_class, 'disabled', False) - end_tuple = getattr(form_class, 'ends_on') + end_tuple = getattr(form_class, 'ends_on', None) end_time = localtime_to_utc(datetime(*end_tuple)) if end_tuple else None expired = end_time and end_time < timezone.now() if disabled or expired: diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index 022b02d..01f3276 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django import forms from django.forms.formsets import BaseFormSet +from django.utils.safestring import mark_safe from contact.forms import ContactForm from django.utils.translation import ugettext_lazy as _ @@ -27,6 +28,23 @@ WOJEWODZTWA = ( WOJEWODZTWO_CHOICES = [(u'', u'(wybierz)')] + [(w, w) for w in WOJEWODZTWA] +def make_data_processing(middle_text): + return mark_safe(u'''\ +Administratorem danych osobowych jest Fundacja Nowoczesna Polska (ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa). \ +Podanie danych osobowych jest dobrowolne. %s Osobom, których dane są zbierane, przysługuje prawo dostępu do treści \ +swoich danych oraz ich poprawiania. Więcej informacji w \ +polityce prywatności.''' % middle_text) + + +class ReminderForm(ContactForm): + form_tag = 'nie-przegap-2018' + form_title = u'Rejestracja. Nie przegap terminu!' + email = forms.EmailField(label=u'Adres e-mail', max_length=128) + data_processing = make_data_processing( + u'Dane są przetwarzane w zakresie niezbędnym do wysłania powiadomienia odbiorcom.') + submit_label = u'Wyślij' + + class WTEMStudentForm(forms.Form): first_name = forms.CharField(label=u'Imię', max_length=128) last_name = forms.CharField(label=u'Nazwisko', max_length=128) diff --git a/edumed/static/css/main.css b/edumed/static/css/main.css index e9c2ac1..08fb109 100644 --- a/edumed/static/css/main.css +++ b/edumed/static/css/main.css @@ -10,10 +10,6 @@ margin-bottom: 1em; width: 10em; float: left; } - #main-promobox a:first-of-type { - padding-top: 0; - border-top-right-radius: 0; - border-top-left-radius: 0; } #main-promobox a:last-of-type { margin-bottom: 0; } #main-promobox h1 { @@ -171,3 +167,5 @@ margin: 1.1em 0 0 0; font-size: .9em; line-height: 1.15em; } + +/*# sourceMappingURL=main.css.map */ diff --git a/edumed/static/css/main.scss b/edumed/static/css/main.scss index 7d95145..d06205f 100755 --- a/edumed/static/css/main.scss +++ b/edumed/static/css/main.scss @@ -20,11 +20,6 @@ $px: .0625em; width: 220*$px - 3 * 20*$px; float: left; - &:first-of-type { - padding-top: 0; - border-top-right-radius: 0; - border-top-left-radius: 0; - } &:last-of-type { margin-bottom: 0; } diff --git a/edumed/templates/flatpages/default.html b/edumed/templates/flatpages/default.html index 1ab012c..f26cc8a 100755 --- a/edumed/templates/flatpages/default.html +++ b/edumed/templates/flatpages/default.html @@ -1,9 +1,14 @@ {% extends "base.html" %} {% load textile_pl from fnp_markup %} +{% load chunk from chunks %} {% block title %}{{ flatpage.title }}{% endblock %} {% block body %} +
+ {% chunk "promobox" %} +
+
{{ flatpage.content|textile_pl }}