1 # -*- coding: utf-8 -*-
2 from django.core.urlresolvers import reverse
3 from django.utils.translation import ugettext as _
5 from prawokultury.contact_forms import RegistrationForm
6 from .contact_forms import RegisterSpeaker
9 def registration_url(request):
10 speaker_form = RegisterSpeaker()
11 registration_form = RegistrationForm()
12 if speaker_form.started and not speaker_form.closed:
13 url = reverse("contact_form", args=["register-speaker"])
14 label = _('Registration')
15 elif not speaker_form.started or (speaker_form.closed and not registration_form.started):
16 url = reverse("contact_form", args=["remind-me"])
17 label = _('Remind me')
19 url = reverse("contact_form", args=["register"])
20 label = _('Registration')
21 return {'REGISTRATION_URL': url, 'REGISTRATION_BUTTON_LABEL': label}