Commit 80c6d138 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Thom Wiggers

Migrate registration to new template

parent b89f7160
......@@ -6,13 +6,6 @@ registrations package
:undoc-members:
:show-inheritance:
Subpackages
-----------
.. toctree::
registrations.templatetags
Submodules
----------
......
registrations.templatetags package
==================================
.. automodule:: registrations.templatetags
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
registrations.templatetags.form\_field module
---------------------------------------------
.. automodule:: registrations.templatetags.form_field
:members:
:undoc-members:
:show-inheritance:
{% extends "base.html" %}
{% load static i18n fieldtype form_field bootstrap4 %}
{% load static i18n fieldtype bootstrap4 %}
{% block title %}{% trans "change email"|capfirst %} — {% trans "members"|capfirst %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "change email"|capfirst %} — {% trans "members"|capfirst %} —
......
This diff was suppressed by a .gitattributes entry.
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-03 19:55+0200\n"
"PO-Revision-Date: 2018-10-03 19:56+0200\n"
"POT-Creation-Date: 2018-10-10 12:55+0200\n"
"PO-Revision-Date: 2018-10-10 12:56+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -416,17 +416,13 @@ msgstr "bevestig e-mailadres"
#: templates/registrations/confirm_email.html
msgid ""
"\n"
" Your email address has been confirmed.\n"
" We'll review your membership registration as soon as possible.\n"
" Please send us an email (info@thalia.nu) if you have any questions.\n"
" "
"Your email address has been confirmed. We'll review your membership "
"registration as soon as possible. Please send us an email (info@thalia.nu) "
"if you have any questions."
msgstr ""
"\n"
" Je e-mailadres is bevestigd.\n"
" We bekijken je registratie zo snel mogelijk beoordelen.\n"
" Mocht je vragen hebben, stuur dan een mailtje naar info@thalia.nu.\n"
" "
"Je e-mailadres is bevestigd. We bekijken je registratie zo snel mogelijk "
"beoordelen. Mocht je vragen hebben, stuur dan een mailtje naar info@thalia."
"nu."
#: templates/registrations/email/registration_accepted.txt
#, python-format
......@@ -692,22 +688,22 @@ msgstr ""
#, python-format
msgid ""
"A membership costs € %(year_fees)s per year, or € %(study_fees)s for your "
"entire study duration.<br/> Note: Only Computing Science and Information "
"entire study duration. <br/> Note: Only Computing Science and Information "
"Sciences students at the Radboud University can become a member.<br/><br/> "
"It is still possible to be associated with Thalia, even if you do not study "
"Computing Science or Information Sciences (anymore): You can become a "
"benefactor. For at least € %(year_fees)s per year, you too can enjoy "
"everything Thalia has to offer.<br /> <em>Note that this form is only for "
"everything Thalia has to offer.<br/> <em>Note that this form is only for "
"member registration. Please visit the board room if you want to become a "
"benefactor.</em>"
msgstr ""
"Een lidmaatschap kost € %(year_fees)s per jaar, of € %(study_fees)s voor je "
"hele studieperiode.<br/>Let wel op: Je kunt alleen lid worden wanneer je "
"hele studieperiode. <br/> Let wel op: Je kunt alleen lid worden wanneer je "
"informatica of informatiekunde studeert aan de Radboud Universiteit.<br/><br/"
">Mocht je nu geen Informatica of Informatiekunde (meer) studeren, maar toch "
"verbonden willen zijn, dan kan dat ook. Hiervoor kun je begunstiger van "
"Thalia worden. Voor minimaal € %(year_fees)s per jaar kun je ook genieten "
"van alles wat Thalia je te bieden heeft.<br/><em>Let op dat dit formulier "
"van alles wat Thalia je te bieden heeft.<br/> <em>Let op dat dit formulier "
"alleen gebruikt kan worden voor registratie van leden. Neem contact op met "
"het bestuur als je begunstiger wilt worden.</em>"
......@@ -754,38 +750,30 @@ msgstr "registratie gelukt"
#: templates/registrations/register_success.html
msgid ""
"\n"
" Thank you!\n"
" Before we can review your membership registration we need "
"Thank you! Before we can review your membership registration we need "
"confirmation that the email address you entered during the registration "
"process is valid.\n"
" Please check your mailbox for the confirmation email.\n"
" "
"process is valid. Please check your mailbox for the confirmation email."
msgstr ""
"\n"
" Bedankt!\n"
" Voordat we je registratie kunnen beoordelen moeten we eerst "
"Bedankt! Voordat we je registratie kunnen beoordelen moeten we eerst "
"controleren of het e-mailadres dat je hebt ingevuld tijdens de registratie "
"geldig is.\n"
" Controleer je inbox voor de verificatie e-mail.\n"
" "
"geldig is. Controleer je inbox voor de verificatie e-mail."
#: templates/registrations/renewal.html
#, python-format
msgid ""
"A membership costs € %(year_fees)s per year, or € %(study_fees)s for your "
"entire study duration.<br/> Note: Only Computing Science and Information "
"Sciences students at the Radboud University can become a member.<br/> <br/> "
"entire study duration. <br/> Note: Only Computing Science and Information "
"Sciences students at the Radboud University can become a member. <br/><br/> "
"It is still possible to be associated with Thalia, even if you do not study "
"Computing Science or Information Sciences (anymore): You can become a "
"benefactor. For at least € %(year_fees)s per year, you too can enjoy "
"everything Thalia has to offer."
msgstr ""
"Een lidmaatschap kost € %(year_fees)s per jaar, of € %(study_fees)s voor je "
"hele studieperiode.<br/>Let wel op: Je kunt alleen lid worden wanneer je "
"informatica of informatiekunde studeert aan de Radboud Universiteit.<br/><br/"
">Mocht je nu geen Informatica of Informatiekunde (meer) studeren, maar toch "
"verbonden willen zijn, dan kan dat ook. Hiervoor kun je begunstiger van "
"hele studieperiode. <br/> Let wel op: Je kunt alleen lid worden wanneer je "
"informatica of informatiekunde studeert aan de Radboud Universiteit. <br/"
"><br/> Mocht je nu geen Informatica of Informatiekunde (meer) studeren, maar "
"toch verbonden willen zijn, dan kan dat ook. Hiervoor kun je begunstiger van "
"Thalia worden. Voor minimaal € %(year_fees)s per jaar kun je ook genieten "
"van alles wat Thalia je te bieden heeft."
......@@ -795,15 +783,15 @@ msgid ""
"year you're allowed to change your membership to one for your entire study "
"duration without paying a double fee. Choose 'until graduation' option in "
"the form below and click send. Just make you currently have an active "
"membership.<br/><br/> If your membership is almost expiring or has expired "
"membership. <br/><br/> If your membership is almost expiring or has expired "
"you can renew it starting one month before expiration."
msgstr ""
"Betaal je op dit moment per jaar voor je lidmaatschap? Dan kun je tijdens "
"het studiejaar je lidmaatschap aanpassen naar een die geldig is tot je "
"afstuderen zonder dat je dubbel betaalt. Kies voor ‘tot afstuderen’ in het "
"onderstaande formulier en klik op ‘versturen’. Zorg er alleen voor dat je op "
"dit moment een geldig lidmaatschap hebt.<br/><br/>Als je lidmaatschap bijna "
"afloopt of net is afgelopen kun je het vanaf één maand voor aflopen "
"dit moment een geldig lidmaatschap hebt. <br/><br/> Als je lidmaatschap "
"bijna afloopt of net is afgelopen kun je het vanaf één maand voor aflopen "
"verlengen."
#: templates/registrations/renewal.html
......@@ -864,16 +852,8 @@ msgid "success"
msgstr "gelukt"
#: templates/registrations/renewal_success.html
msgid ""
"\n"
" Thank you!\n"
" We'll review your submission as soon as possible.\n"
" "
msgstr ""
"\n"
" Bedankt!\n"
" We beoordelen je verzoek zo snel mogelijk.\n"
" "
msgid "Thank you! We'll review your submission as soon as possible."
msgstr "Bedankt! We beoordelen je verzoek zo snel mogelijk."
#: tests/test_views.py views.py
#, python-format
......
.thimbus-page {
.birthday-field {
select {
width: inherit;
}
}
}
{% extends "old-base.html" %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Become a Member" %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Become a Member" %} — {{ block.super }}{% endblock %}
{% block body %}
<h1>{% trans "Become a Member" %}</h1>
<p>{% trans "Thalia is the study association for Computing Science and Information Sciences students at the Radboud University in Nijmegen. Thalia organises a wide variety of activities, such as bowling events, go cart racing, lunch lectures, drinks and much more! Furthermore, members get access to our tests and summaries database, as well as discounts on books. There's no reason not to become a member!" %}</p>
<h4>{% trans "How do I become a member?" %}</h4>
<p>{% blocktrans %}You can become a member of Thalia at any time during the year. A membership costs € {{ year_fees }} per year, or € {{ study_fees }} for your entire study duration. Click on the button below to go to the registration form. Note: Only Computing Science and Information Sciences students at the Radboud University can become a member.{% endblocktrans %}</p>
<p class="clearfix text-center"><a href="{{ member_form_url }}" class="clearfix btn btn-primary btn-large btn-style1 btn-block">{% trans "Register now" %}</a></p>
<h4>{% trans "I'm not a Computing Science and Information Sciences student at the Radboud University, but I do want to attend your events. Now what?" %}</h4>
<p>{% blocktrans %}It is still possible to be associated with Thalia, even if you do not study Computing Science or Information Sciences (anymore): You can become a benefactor. For at least € {{ year_fees }} per year, you too can enjoy everything Thalia has to offer. If you are not a former Thalia member, ICIS staff member or alumni, you must submit a written along with two signatures of current Thalia members. You can fill all of this in on the benefactor form, which you can get at the board room (M1.0.08, ground floor of Mercator 1).{% endblocktrans %}</p>
<p>{% blocktrans %}Payment can be made both in cash or by card. If you have any other questions about Thalia and/or your membership, feel free to email <a href="mailto:info@thalia.nu" target="_blank">info@thalia.nu</a>!{% endblocktrans %}</p>
<section class="page-section">
<div class="container">
<h1 class="text-center section-title">{% trans "Become a Member" %}</h1>
<p>{% trans "Thalia is the study association for Computing Science and Information Sciences students at the Radboud University in Nijmegen. Thalia organises a wide variety of activities, such as bowling events, go cart racing, lunch lectures, drinks and much more! Furthermore, members get access to our tests and summaries database, as well as discounts on books. There's no reason not to become a member!" %}</p>
<h4>{% trans "How do I become a member?" %}</h4>
<p>
{% blocktrans trimmed %}
You can become a member of Thalia at any time during the year. A membership costs €
{{ year_fees }} per year, or € {{ study_fees }} for your entire study duration. Click on the button
below to go to the registration form. Note: Only Computing Science and Information Sciences students
at the Radboud University can become a member.
{% endblocktrans %}
</p>
<p class="text-center my-4">
<a href="{{ member_form_url }}" class="btn btn-primary btn-lg btn-block">
{% trans "Register now" %}
</a>
</p>
<h4>{% trans "I'm not a Computing Science and Information Sciences student at the Radboud University, but I do want to attend your events. Now what?" %}</h4>
<p>
{% blocktrans trimmed %}
It is still possible to be associated with Thalia, even if you do not study Computing
Science or Information Sciences (anymore): You can become a benefactor. For at least €
{{ year_fees }} per year, you too can enjoy everything Thalia has to offer.
If you are not a former Thalia member, ICIS staff member or alumni, you must submit a written along
with two signatures of current Thalia members. You can fill all of this in on the benefactor form,
which you can get at the board room (M1.0.08, ground floor of Mercator 1).
{% endblocktrans %}
</p>
<p>
{% blocktrans trimmed %}
Payment can be made both in cash or by card. If you have any other questions about Thalia
and/or your membership, feel free to email
<a href="mailto:info@thalia.nu" target="_blank">info@thalia.nu</a>!
{% endblocktrans %}
</p>
</div>
</section>
{% endblock %}
{% extends "old-base.html" %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "confirm email address"|capfirst %} - {% trans "registration"|capfirst %} — {{ block.super }}{% endblock %}
{% block title %}{% trans "confirm email address"|capfirst %} - {% trans "registration"|capfirst %} —
{{ block.super }}{% endblock %}
{% block body %}
<h1>{% trans "registration" %}</h1>
<p class="tcenter">
{% blocktrans %}
Your email address has been confirmed.
We'll review your membership registration as soon as possible.
Please send us an email (info@thalia.nu) if you have any questions.
{% endblocktrans %}
</p>
<section class="page-section">
<div class="container">
<h1 class="text-center section-title">{% trans "registration" %}</h1>
<p class="text-center">
{% blocktrans trimmed %}
Your email address has been confirmed.
We'll review your membership registration as soon as possible.
Please send us an email (info@thalia.nu) if you have any questions.
{% endblocktrans %}
</p>
</div>
</section>
{% endblock %}
<div class="control-group row {% if field.errors %}error{% endif %}">
<label class="control-label" for="id_{{ field.name }}">{{ field.label|capfirst }}:</label>
<div class="controls">
{{ field }}
{% for error in field.errors %}
<span class="help-block">{{ error|escape }}</span>
{% endfor %}
{% if field.help_text %}
<span class="help-block">{{ field.help_text|safe }}</span>
{% endif %}
</div>
</div>
{% extends "old-base.html" %}
{% load i18n form_field static compress %}
{% extends "base.html" %}
{% load i18n static compress bootstrap4 %}
{% block title %}{% trans "registration"|capfirst %} — {{ block.super }}{% endblock %}
{% block css_head %}
{{ block.super }}
{% compress css %}
<link href="{% static 'registrations/css/style.scss' %}" rel="stylesheet" type="text/x-scss">
{% endcompress %}
{% endblock %}
{% block body %}
<h1>{% trans "registration" %}</h1>
<p class="tcenter">
{% blocktrans trimmed %}
A membership costs € {{ year_fees }} per year, or € {{ study_fees }} for your entire study duration.<br/>
Note: Only Computing Science and Information Sciences students at the Radboud University can become a member.<br/><br/>
It is still possible to be associated with Thalia, even if you do not study Computing Science or Information Sciences (anymore): You can become a benefactor. For at least € {{ year_fees }} per year, you too can enjoy everything Thalia has to offer.<br />
<em>Note that this form is only for member registration. Please visit the board room if you want to become a benefactor.</em>
{% endblocktrans %}
</p>
<p class="tcenter">
{% blocktrans trimmed %}
If you've been a member before you should login using your existing account and renew your membership by visiting the account settings.
You'll be unable to re-register using this form.
{% endblocktrans %}
</p>
<hr/>
<form method="post" enctype="multipart/form-data" class="form-horizontal span8 offset2">
{% csrf_token %}
<fieldset>
{% form_field form 'length' %}
</fieldset>
<fieldset>
{% form_field form 'first_name' %}
{% form_field form 'last_name' %}
<span class="birthday-field">
{% form_field form 'birthday' %}
</span>
<div class="control-group row">
<div class="controls">
<label class="checkbox">
<input type="checkbox" name="optin_birthday" id="id_optin_birthday">
{% trans "Display birthday in calendar" %}.
</label>
</div>
</div>
{% form_field form 'email' %}
<div class="control-group row">
<div class="controls">
<label class="checkbox">
<input type="checkbox" name="optin_mailinglist" id="id_optin_mailinglist">
{% trans "Receive emails about (amongst others) job opportunities and in-house days from partners of Thalia." %}.
</label>
</div>
</div>
{% form_field form 'phone_number' %}
</fieldset>
<fieldset>
{% form_field form 'address_street' %}
{% form_field form 'address_street2' %}
{% form_field form 'address_postal_code' %}
{% form_field form 'address_city' %}
</fieldset>
<fieldset>
{% form_field form 'student_number' %}
{% form_field form 'programme' %}
{% form_field form 'starting_year' %}
</fieldset>
<fieldset>
<div class="control-group row">
<div class="controls">
<label class="checkbox">
<input type="checkbox" name="privacy_policy" required="" id="id_privacy_policy">
{% blocktrans trimmed %}I accept the <a target="_blank" href="{{ privacy_policy_url }}">privacy policy</a>{% endblocktrans %}.
</label>
</div>
</div>
</fieldset>
<input type="submit" value="{% trans 'send'|capfirst %}" class="btn btn-style1 pull-right login" />
</form>
<section class="page-section">
<div class="container">
<h1 class="text-center section-title">{% trans "registration" %}</h1>
<p class="text-center">
{% blocktrans trimmed %}
A membership costs € {{ year_fees }} per year, or € {{ study_fees }} for your entire study duration.
<br/>
Note: Only Computing Science and Information Sciences students at the Radboud University can become
a member.<br/><br/>
It is still possible to be associated with Thalia, even if you do not study Computing Science or
Information Sciences (anymore): You can become a benefactor. For at least € {{ year_fees }} per
year, you too can enjoy everything Thalia has to offer.<br/>
<em>Note that this form is only for member registration. Please visit the board room if you want to
become a benefactor.</em>
{% endblocktrans %}
</p>
<p class="text-center">
{% blocktrans trimmed %}
If you've been a member before you should login using your existing account and renew your
membership by visiting the account settings.
You'll be unable to re-register using this form.
{% endblocktrans %}
</p>
<hr/>
<form method="post" enctype="multipart/form-data" class="col-lg-6 offset-lg-3">
{% csrf_token %}
<fieldset>
{% bootstrap_field form.length %}
</fieldset>
<fieldset>
{% bootstrap_field form.first_name %}
{% bootstrap_field form.last_name %}
{% bootstrap_field form.birthday %}
<div class="form-group">
<div class="form-check">
<input name="optin_birthday" class="form-check-input" id="id_optin_birthday"
type="checkbox">
<label class="form-check-label"
for="id_optin_birthday">{% trans "Display birthday in calendar" %}</label>
</div>
</div>
{% bootstrap_field form.email %}
<div class="form-group">
<div class="form-check">
<input name="optin_mailinglist" class="form-check-input" id="id_optin_mailinglist"
type="checkbox">
<label class="form-check-label"
for="id_optin_mailinglist">{% trans "Receive emails about (amongst others) job opportunities and in-house days from partners of Thalia." %}</label>
</div>
</div>
{% bootstrap_field form.phone_number %}
</fieldset>
<fieldset>
{% bootstrap_field form.address_street %}
{% bootstrap_field form.address_street2 %}
{% bootstrap_field form.address_postal_code %}
{% bootstrap_field form.address_city %}
</fieldset>
<fieldset>
{% bootstrap_field form.student_number %}
{% bootstrap_field form.programme %}
{% bootstrap_field form.starting_year %}
</fieldset>
<fieldset>
<div class="form-group">
<div class="form-check">
<input name="privacy_policy" class="form-check-input" id="id_privacy_policy"
type="checkbox">
<label class="form-check-label"
for="id_privacy_policy">{% blocktrans trimmed %}I accept the
<a target="_blank" href="{{ privacy_policy_url }}">privacy
policy</a>{% endblocktrans %}.</label>
</div>
</div>
</fieldset>
<input type="submit" value="{% trans 'send'|capfirst %}" class="btn btn-primary float-right"/>
</form>
</div>
</section>
{% endblock %}
{% extends "old-base.html" %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "registration success"|capfirst %} - {% trans "registration"|capfirst %} — {{ block.super }}{% endblock %}
{% block title %}{% trans "registration success"|capfirst %} - {% trans "registration"|capfirst %} —
{{ block.super }}{% endblock %}
{% block body %}
<h1>{% trans "registration" %}</h1>
<p class="tcenter">
{% blocktrans %}
Thank you!
Before we can review your membership registration we need confirmation that the email address you entered during the registration process is valid.
Please check your mailbox for the confirmation email.
{% endblocktrans %}
</p>
<section class="page-section">
<div class="container">
<h1 class="text-center section-title">{% trans "registration" %}</h1>
<p class="text-center">
{% blocktrans trimmed %}
Thank you!
Before we can review your membership registration we need confirmation that the email address you
entered during the registration process is valid.
Please check your mailbox for the confirmation email.
{% endblocktrans %}
</p>
</div>
</section>
{% endblock %}
{% extends "old-base.html" %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "success"|capfirst %} - {% trans "renewal"|capfirst %} — {{ block.super }}{% endblock %}
{% block body %}
<h1>{% trans "renewal" %}</h1>
<p class="tcenter">
{% blocktrans %}
Thank you!
We'll review your submission as soon as possible.
{% endblocktrans %}
</p>
<section class="page-section">
<div class="container">
<h1 class="text-center section-title">{% trans "renewal" %}</h1>
<p class="text-center">
{% blocktrans trimmed %}
Thank you!
We'll review your submission as soon as possible.
{% endblocktrans %}
</p>
</div>
</section>
{% endblock %}
from django import template
register = template.Library()
@register.inclusion_tag('registrations/form_field.html')
def form_field(form, field_name):
return {'field': form.__getitem__(field_name)}
from unittest.mock import MagicMock
from django.test import TestCase
from registrations.templatetags.form_field import form_field
class FormFieldTemplateTagTest(TestCase):
def test_tag(self):
form = MagicMock()
form.__getitem__.return_value = 'test_result'
return_value = form_field(form, 'name')
form.__getitem__.assert_called_once_with('name')
self.assertEqual(return_value, {'field': 'test_result'})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment