From: Jan Szejko Date: Wed, 14 Jun 2017 07:48:36 +0000 (+0200) Subject: remind me form X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/caeac0d2d5df635b21719c5e5db1980532537464 remind me form --- diff --git a/contact/forms.py b/contact/forms.py index e8195b9..6bb49fe 100644 --- a/contact/forms.py +++ b/contact/forms.py @@ -36,7 +36,7 @@ class ContactForm(forms.Form): notify_on_register = True required_css_class = 'required' - contact = forms.CharField(max_length=128) + contact = forms.EmailField(label=_('E-mail'), max_length=128) def __init__(self, *args, **kwargs): key = kwargs.pop('key', None) diff --git a/prawokultury/contact_forms.py b/prawokultury/contact_forms.py index 7f55feb..3848a68 100644 --- a/prawokultury/contact_forms.py +++ b/prawokultury/contact_forms.py @@ -269,6 +269,12 @@ class RegisterSpeaker(RegistrationForm): ] +class RemindForm(ContactForm): + form_tag = 'remind-me' + save_as_tag = 'remind-me-2017' + form_title = u'CopyCamp 2017' + + class NextForm(ContactForm): form_tag = '/next' form_title = _('Next CopyCamp') diff --git a/prawokultury/context_processors.py b/prawokultury/context_processors.py index 7e8713c..cb671da 100644 --- a/prawokultury/context_processors.py +++ b/prawokultury/context_processors.py @@ -1,12 +1,17 @@ # -*- coding: utf-8 -*- from django.core.urlresolvers import reverse + +from prawokultury.contact_forms import RegistrationForm from .contact_forms import RegisterSpeaker def registration_url(request): speaker_form = RegisterSpeaker() + registration_form = RegistrationForm() if speaker_form.started and not speaker_form.closed: url = reverse("contact_form", args=["register-speaker"]) + elif speaker_form.closed and not registration_form.started: + url = reverse("contact_form", args=["remind-me"]) else: url = reverse("contact_form", args=["register"]) return {'REGISTRATION_URL': url}