Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
52978a47
Verified
Commit
52978a47
authored
Jul 04, 2018
by
Sébastiaan Versteeg
Browse files
Add optins to members registration form
parent
786d5596
Changes
9
Hide whitespace changes
Inline
Side-by-side
website/registrations/locale/nl/LC_MESSAGES/django.mo
View file @
52978a47
No preview for this file type
website/registrations/locale/nl/LC_MESSAGES/django.po
View file @
52978a47
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
5
-09
20:43
+0200\n"
"PO-Revision-Date: 2018-0
5
-09
20:48
+0200\n"
"POT-Creation-Date: 2018-0
7
-09
11:35
+0200\n"
"PO-Revision-Date: 2018-0
7
-09
11:35
+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -18,157 +18,157 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.4\n"
#: admin.py:3
0
admin.py:1
32
#: admin.py:3
4
admin.py:1
48
msgid "Application information"
msgstr "Registratieinformatie"
#: admin.py:3
9
#: admin.py:
4
3
msgid "Personal information"
msgstr "Persoonlijke informatie"
#: admin.py:
46
#: admin.py:
50
msgid "Address"
msgstr "Adres"
#: admin.py:5
2
#: admin.py:5
6
msgid "University information"
msgstr "Unversiteitsinformatie"
#: admin.py:
94
tests/test_admin.py:22
0
#: admin.py:
106
tests/test_admin.py:22
2
msgid "Processed"
msgstr "Verwerkt"
#: admin.py:
95
tests/test_admin.py:21
2
#: admin.py:
107
tests/test_admin.py:21
4
msgid "Unprocessed"
msgstr "Onverwerkt"
#: admin.py:1
06
tests/test_admin.py:138 tests/test_admin.py:27
3
#: admin.py:1
19
tests/test_admin.py:138 tests/test_admin.py:27
5
#, python-format
msgid "Successfully rejected %(count)d %(items)s."
msgstr "%(count)d %(items)s succesvol afgekeurd."
#: admin.py:10
7
#: admin.py:1
2
0
msgid "The selected registration(s) could not be rejected."
msgstr "De geselecteerde registratie(s) konden niet worden afgekeurd."
#: admin.py:1
09
#: admin.py:1
22
msgid "Reject selected registrations"
msgstr "Keur geselecteerde registraties af"
#: admin.py:1
16
tests/test_admin.py:115 tests/test_admin.py:25
0
#: admin.py:1
30
tests/test_admin.py:115 tests/test_admin.py:25
2
#, python-format
msgid "Successfully accepted %(count)d %(items)s."
msgstr "%(count)d %(items)s succesvol goedgekeurd."
#: admin.py:11
7
#: admin.py:1
3
1
msgid "The selected registration(s) could not be accepted."
msgstr "De geselecteerde registratie(s) konden niet worden goedgekeurd."
#: admin.py:1
19
#: admin.py:1
33
msgid "Accept selected registrations"
msgstr "Keur geselecteerde registraties goed"
#: apps.py:
7
#: apps.py:
9
msgid "Registrations"
msgstr "Registraties"
#: emails.py:1
6
tests/test_emails.py:37
#: emails.py:
2
1 tests/test_emails.py:37
msgid "Confirm email address"
msgstr "Bevestig e-mailadres"
#: emails.py:
3
3 tests/test_emails.py:68
#: emails.py:
4
3 tests/test_emails.py:68
msgid "Registration accepted"
msgstr "Registratie goedgekeurd"
#: emails.py:
4
6 emails.py:
87
tests/test_emails.py:91 tests/test_emails.py:179
#: emails.py:6
0
emails.py:
114
tests/test_emails.py:91 tests/test_emails.py:179
msgid "Registration rejected"
msgstr "Registratie afgekeurd"
#: emails.py:7
4
tests/test_emails.py:150
#: emails.py:
9
7 tests/test_emails.py:150
msgid "Renewal accepted"
msgstr "Verlenging goedgekeurd"
#: emails.py:
99
tests/test_emails.py:207
#: emails.py:
130
tests/test_emails.py:207
msgid "Renewal successful"
msgstr "Verlenging afgekeurd"
#: forms.py:1
3
models.py:1
39
#: forms.py:1
5
models.py:1
42
msgid "birthday"
msgstr "verjaardag"
#: forms.py:
18
#: forms.py:
20
msgid "I accept the privacy policy"
msgstr "Ik accepteer het privacybeleid"
#: models.py:
18
#: models.py:
20
msgid "created at"
msgstr "aangemaakt op"
#: models.py:1
9
#: models.py:
2
1
msgid "updated at"
msgstr "bijgewerkt op"
#: models.py:
28
#: models.py:
30
msgid "Awaiting email confirmation"
msgstr "In afwachting van e-mail confirmatie"
#: models.py:
29
#: models.py:
31
msgid "Ready for review"
msgstr "Klaar voor beoordeling"
#: models.py:3
0
#: models.py:3
2
msgid "Rejected"
msgstr "Afgekeurd"
#: models.py:3
1
#: models.py:3
3
msgid "Accepted"
msgstr "Goedgekeurd"
#: models.py:3
2
#: models.py:3
4
msgid "Completed"
msgstr "Voltooid"
#: models.py:3
6
#: models.py:3
8
msgid "status"
msgstr "status"
#: models.py:4
6
#: models.py:4
8
msgid "One year"
msgstr "Één jaar"
#: models.py:4
7
#: models.py:4
9
msgid "Until graduation"
msgstr "Tot afstuderen"
#: models.py:5
1
#: models.py:5
3
msgid "membership length"
msgstr "lengte lidmaatschap"
#: models.py:6
0
templates/registrations/renewal.html:30
#: models.py:6
2
templates/registrations/renewal.html:30
msgid "membership type"
msgstr "soort lidmaatschap"
#: models.py:6
7
#: models.py:6
9
msgid "remarks"
msgstr "opmerkingen"
#: models.py:10
7
#: models.py:10
9
msgid "entry"
msgstr "invoer"
#: models.py:10
8
#: models.py:1
1
0
msgid "entries"
msgstr "invoeren"
#: models.py:11
0
#: models.py:11
2
msgid "Review registration and renewal entries"
msgstr "Beoordeel registraties en verlengingen"
#: models.py:11
8
#: models.py:1
2
1
msgid "Username"
msgstr "Gebruikersnaam"
#: models.py:12
2
#: models.py:12
5
msgid ""
"Enter value to override the auto-generated username (e.g. if it is not "
"unique)"
...
...
@@ -176,67 +176,75 @@ msgstr ""
"Voer waarde in om de automatisch gegenereerde gebruikersnaam te "
"overschrijven (bijv. als deze niet uniek is)"
#: models.py:1
27
#: models.py:1
30
msgid "First name"
msgstr "Voornaam"
#: models.py:13
3
#: models.py:13
6
msgid "Last name"
msgstr "Achternaam"
#: models.py:14
4
#: models.py:14
7
msgid "language"
msgstr "taal"
#: models.py:15
3
#: models.py:15
6
msgid "Email address"
msgstr "E-mailadres"
#: models.py:1
59
#: models.py:1
62
msgid "phone number"
msgstr "telefoonnummer"
#: models.py:16
2
#: models.py:16
5
msgid "please enter a valid phone number"
msgstr "voer alstublieft een geldig telefoonnummer in"
#: models.py:17
0
#: models.py:17
3
msgid "student number"
msgstr "studentnummer"
#: models.py:17
4
#: models.py:17
7
msgid "enter a valid student- or e/z/u-number."
msgstr "voer een geldig student- of e/z/u-nummer in."
#: models.py:18
2
#: models.py:18
5
msgid "study programme"
msgstr "studie"
#: models.py:1
88
#: models.py:1
91
msgid "starting year"
msgstr "startjaar"
#: models.py:
199
#: models.py:
202
msgid "include the house number"
msgstr "inclusief huisnummer"
#: models.py:20
1
#: models.py:20
4
msgid "street and house number"
msgstr "straat en huisnummer"
#: models.py:20
7
#: models.py:2
1
0
msgid "second address line"
msgstr "tweede adresregel"
#: models.py:21
4
#: models.py:21
7
msgid "postal code"
msgstr "postcode"
#: models.py:22
0
#: models.py:22
3
msgid "city"
msgstr "stad"
#: models.py:234
#: models.py:230
msgid "mailinglist opt-in"
msgstr "Mailinglijst opt-in"
#: models.py:235
msgid "birthday calendar opt-in"
msgstr "Verjaardagskalender opt-in"
#: models.py:249
msgid ""
"A user with that email address already exists. Login using the existing "
"account and renew the membership by visiting the account settings."
...
...
@@ -244,7 +252,7 @@ msgstr ""
"Er bestaat al een gebruiker met dit e-mailadres. Login met het bestaande "
"account en vernieuw het lidmaatschap in de accountinstellingen."
#: models.py:2
4
6
#: models.py:26
1
msgid ""
"A user with that student number already exists. Login using the existing "
"account and renew the membership by visiting the account settings."
...
...
@@ -252,51 +260,51 @@ msgstr ""
"Er bestaat al een gebruiker met dit studentnummer. Login met het bestaande "
"account en vernieuw het lidmaatschap in de accountinstellingen."
#: models.py:2
53
#: models.py:2
68
msgid "A user with that username already exists."
msgstr "Er bestaat al een gebruiker met deze gebruikersnaam."
#: models.py:2
58
models.py:2
63
#: models.py:2
73
models.py:2
78
msgid "This field is required."
msgstr "Dit veld is verplicht."
#: models.py:2
78
#: models.py:2
93
msgid "registation"
msgstr "registratie"
#: models.py:2
7
9
#: models.py:29
4
msgid "registrations"
msgstr "registraties"
#: models.py:
286
#: models.py:
302
msgid "member"
msgstr "lid"
#: models.py:3
03
tests/test_models.py:209
#: models.py:3
19
tests/test_models.py:209
msgid "You already have a renewal request queued for review."
msgstr "Je hebt al een aanvraag tot verlenging openstaan."
#: models.py:3
11
models.py:3
1
2
#: models.py:3
27
models.py:32
8
msgid "You currently have an active membership."
msgstr "Je hebt op dit moment een actief lidmaatschap."
#: models.py:3
25
#: models.py:3
41
msgid "You cannot renew your membership at this moment."
msgstr "Je kunt je lidmaatschap op dit moment niet verlengen."
#: models.py:3
31
#: models.py:3
47
msgid ""
"Supporters cannot have a membership that lasts their entire study duration."
msgstr "Begunstigers kunnen geen lidmaatschap hebben dat loopt tot afstuderen."
#: models.py:3
44
templates/registrations/renewal.html:4
#: models.py:3
60
templates/registrations/renewal.html:4
#: templates/registrations/renewal.html:7
#: templates/registrations/renewal_success.html:4
#: templates/registrations/renewal_success.html:7
msgid "renewal"
msgstr "verlenging"
#: models.py:3
45
#: models.py:3
61
msgid "renewals"
msgstr "verlenging"
...
...
@@ -712,7 +720,19 @@ msgstr ""
"en vernieuw je lidmaatschap in de accountinstellingen. Je kunt je niet "
"opnieuw registreren via dit formulier."
#: templates/registrations/register_member.html:67
#: templates/registrations/register_member.html:51
msgid "Display birthday in calendar"
msgstr "Toon verjaardag in de kalender"
#: templates/registrations/register_member.html:60
msgid ""
"Receive emails about (amongst others) job opportunities and in-house days "
"from sponsors of Thalia."
msgstr ""
"Ik wil e-mails ontvangen over (onder andere) baankansen en in-house dagen "
"van sponsoren van Thalia."
#: templates/registrations/register_member.html:85
#, python-format
msgid ""
"I accept the <a target=\"_blank\" href=\"%(privacy_policy_url)s\">privacy "
...
...
@@ -721,7 +741,7 @@ msgstr ""
"Ik ga akkoord met het <a target=\"_blank\" href=\"%(privacy_policy_url)s"
"\">privacybeleid</a>"
#: templates/registrations/register_member.html:
73
#: templates/registrations/register_member.html:
91
#: templates/registrations/renewal.html:78
msgid "send"
msgstr "verstuur"
...
...
@@ -849,31 +869,31 @@ msgstr ""
" We beoordelen je verzoek zo snel mogelijk.\n"
" "
#: tests/test_views.py:142 views.py:
55
#: tests/test_views.py:142 views.py:
60
#, python-format
msgid "Successfully accepted %s."
msgstr "%s succesvol goedgekeurd."
#: tests/test_views.py:149 views.py:
58
#: tests/test_views.py:149 views.py:
63
#, python-format
msgid "Could not accept %s."
msgstr "%s kon niet worden goedgekeurd."
#: tests/test_views.py:157 views.py:5
1
#: tests/test_views.py:157 views.py:5
6
#, python-format
msgid "Could not accept %s. Username is not unique."
msgstr "%s kon niet worden goedgekeurd. De gebruikersnaam is niet uniek."
#: tests/test_views.py:193 views.py:6
2
#: tests/test_views.py:193 views.py:6
7
#, python-format
msgid "Successfully rejected %s."
msgstr "%s succesvol afgekeurd."
#: tests/test_views.py:200 views.py:
65
#: tests/test_views.py:200 views.py:
70
#, python-format
msgid "Could not reject %s."
msgstr "%s kon niet worden afgekeurd."
#: tests/test_views.py:4
09
#: tests/test_views.py:4
13
msgid "Member"
msgstr "Lid"
website/registrations/migrations/0009_auto_20180704_2338.py
0 → 100644
View file @
52978a47
# Generated by Django 2.0.2 on 2018-07-04 21:38
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'registrations'
,
'0008_auto_20180704_2309'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'registration'
,
name
=
'optin_birthday'
,
field
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'birthday calendar opt-in'
),
),
migrations
.
AddField
(
model_name
=
'registration'
,
name
=
'optin_mailinglist'
,
field
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'mailinglist opt-in'
),
),
]
website/registrations/models.py
View file @
52978a47
...
...
@@ -225,6 +225,18 @@ class Registration(Entry):
blank
=
False
,
)
# ---- Opt-ins -----
optin_mailinglist
=
models
.
BooleanField
(
verbose_name
=
_
(
'mailinglist opt-in'
),
default
=
False
)
optin_birthday
=
models
.
BooleanField
(
verbose_name
=
_
(
'birthday calendar opt-in'
),
default
=
False
)
def
get_full_name
(
self
):
full_name
=
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
return
full_name
.
strip
()
...
...
website/registrations/services.py
View file @
52978a47
...
...
@@ -223,7 +223,9 @@ def _create_member_from_registration(registration):
address_city
=
registration
.
address_city
,
phone_number
=
registration
.
phone_number
,
birthday
=
registration
.
birthday
,
language
=
registration
.
language
language
=
registration
.
language
,
show_birthday
=
registration
.
optin_birthday
,
receive_optin
=
registration
.
optin_mailinglist
)
# Send welcome message to new member
...
...
website/registrations/templates/registrations/form_field.html
View file @
52978a47
<div
class=
"control-group row {% if field.errors %}error{% endif %}"
>
<label
class=
"control-label"
for=
"id_{{ field.name }}"
>
{{ field.label }}:
</label>
<label
class=
"control-label"
for=
"id_{{ field.name }}"
>
{{ field.label
|capfirst
}}:
</label>
<div
class=
"controls"
>
{{ field }}
...
...
website/registrations/templates/registrations/register_member.html
View file @
52978a47
...
...
@@ -34,13 +34,33 @@
<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"
required
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"
required
id=
"id_optin_mailinglist"
>
{% trans "Receive emails about (amongst others) job opportunities and in-house days from sponsors of Thalia." %}.
</label>
</div>
</div>
{% form_field form 'phone_number' %}
</fieldset>
...
...
@@ -58,8 +78,6 @@
</fieldset>
<fieldset>
{% form_field form 'length' %}
<div
class=
"control-group row"
>
<div
class=
"controls"
>
<label
class=
"checkbox"
>
...
...
website/registrations/tests/test_admin.py
View file @
52978a47
...
...
@@ -164,7 +164,8 @@ class RegistrationAdminTest(TestCase):
'programme'
,
'starting_year'
,
'address_street'
,
'address_street2'
,
'address_postal_code'
,
'address_city'
,
'payment'
,
'membership'
])
'payment'
,
'membership'
,
'optin_mailinglist'
,
'optin_birthday'
])
fields
=
self
.
admin
.
get_readonly_fields
(
request
,
Registration
(
status
=
Entry
.
STATUS_ACCEPTED
...
...
@@ -178,7 +179,8 @@ class RegistrationAdminTest(TestCase):
'programme'
,
'starting_year'
,
'address_street'
,
'address_street2'
,
'address_postal_code'
,
'address_city'
,
'payment'
,
'membership'
])
'payment'
,
'membership'
,
'optin_mailinglist'
,
'optin_birthday'
])
def
test_get_actions
(
self
):
actions
=
self
.
admin
.
get_actions
(
_get_mock_request
([]))
...
...
website/registrations/tests/test_views.py
View file @
52978a47
...
...
@@ -397,7 +397,6 @@ class RenewalFormViewTest(TestCase):
type
=
Membership
.
MEMBER
)
self
.
view
.
request
=
MagicMock
()
self
.
view
.
request
.
member
.
latest_membership
=
membership
context
=
self
.
view
.
get_context_data
(
form
=
MagicMock
())
self
.
assertEqual
(
len
(
context
),
7
)
...
...
@@ -405,14 +404,22 @@ class RenewalFormViewTest(TestCase):
settings
.
MEMBERSHIP_PRICES
[
Entry
.
MEMBERSHIP_YEAR
],
2
))
self
.
assertEqual
(
context
[
'study_fees'
],
floatformat
(
settings
.
MEMBERSHIP_PRICES
[
Entry
.
MEMBERSHIP_STUDY
],
2
))
self
.
assertEqual
(
context
[
'membership'
],
membership
)
self
.
assertEqual
(
context
[
'membership_type'
],
_
(
'Member'
))
self
.
assertEqual
(
context
[
'privacy_policy_url'
],
reverse
(
'privacy-policy'
))
self
.
view
.
request
.
member
.
latest_membership
=
None
context
=
self
.
view
.
get_context_data
(
form
=
MagicMock
())
self
.
assertFalse
(
'membership_type'
in
context
)
with
self
.
subTest
(
"With latest membership"
):
self
.
view
.
request
.
member
.
latest_membership
=
membership
context
=
self
.
view
.
get_context_data
(
form
=
MagicMock
())
self
.
assertEqual
(
context
[
'membership'
],
membership
)
self
.
assertEqual
(
context
[
'membership_type'
],
_
(
'Member'
))
self
.
assertEqual
(
context
[
'privacy_policy_url'
],
reverse
(
'privacy-policy'
))
with
self
.
subTest
(
'Without latest membership'
):
self
.
view
.
request
.
member
.
latest_membership
=
None
context
=
self
.
view
.
get_context_data
(
form
=
MagicMock
())
self
.
assertEqual
(
context
[
'membership'
],
None
)
self
.
assertFalse
(
'membership_type'
in
context
)
def
test_get_form
(
self
):
self
.
view
.
request
=
_get_mock_request
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment