remind me form
authorJan Szejko <janek37@gmail.com>
Wed, 14 Jun 2017 07:48:36 +0000 (09:48 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 14 Jun 2017 07:48:36 +0000 (09:48 +0200)
contact/forms.py
prawokultury/contact_forms.py
prawokultury/context_processors.py

index e8195b9..6bb49fe 100644 (file)
@@ -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)
index 7f55feb..3848a68 100644 (file)
@@ -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')
index 7e8713c..cb671da 100644 (file)
@@ -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}