From 30fcc4b9ac45921f639771eff3300a1c1c171e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastiaan=20Versteeg?= Date: Wed, 4 Jul 2018 23:39:06 +0200 Subject: [PATCH] Add optins to members registration form --- .../locale/nl/LC_MESSAGES/django.mo | Bin 21497 -> 21943 bytes .../locale/nl/LC_MESSAGES/django.po | 172 ++++++++++-------- .../migrations/0009_auto_20180704_2338.py | 23 +++ website/registrations/models.py | 12 ++ website/registrations/services.py | 4 +- .../templates/registrations/form_field.html | 2 +- .../registrations/register_member.html | 22 ++- website/registrations/tests/test_admin.py | 6 +- website/registrations/tests/test_views.py | 23 ++- 9 files changed, 174 insertions(+), 90 deletions(-) create mode 100644 website/registrations/migrations/0009_auto_20180704_2338.py diff --git a/website/registrations/locale/nl/LC_MESSAGES/django.mo b/website/registrations/locale/nl/LC_MESSAGES/django.mo index 6d5f96ef40a87081596cc2245f95f6b91880a974..39a051cb29311006ed47fff97b4f2fe21c0e15c7 100644 GIT binary patch delta 2909 zcmYk;drXyO9Ki7(;sp^*L{!Ynt0;0i3Lz0jDufq6)Ci3X%=f?x94_yR=N!CDw_{67 zYhIRF)5^-U*2;yWl(m(v+|;J_N2_%)+gdeR(?6Q&tl9eh&ifwonLj?y^Io3&^B!-# z6L<2xxX6{!gZB$5NK7Q&j~96jONa4?)H__{PdtvbcqCEeEZ)TL;zUl35NQ}Bav)jc zIj-NhN91{YYLrMeCZ~uD#bTU<^DqG$kR~Exkr~H@E_|B`x8uE(^HN2qOO_yQOFgEc zAIIQE%)?z?`D47q`(NU2JjBC0(MRPk(!rDCMc%-rRGz@~tMq0f?aPhH^pc8Fr-&@W zsmS1@8`E(!uE71M9s3QR!9j*dKkmc?DlVVucCw#~w_=Z&645tLHzc9Zi|xHZTQsN;6R#s6ef!21nx>oQdl&2M?eQ=!{ps zf)TwiJX53^Gf=0@!9vQncw6;lxl3fCj%X9I?6McN!B;T>kD(6W1QuaB8=#u{mSaBU zSLnq>yns9+2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*Df2!)WY9O>78f;~tE_Pf;C=qB1jqbMX@9VMc><>>4nK`UX`0{m7hc zA9j<8bLeG!yT6e%;yb90|8NcGs}xB+4Yhf4T`TZ5>PxT~_hKs@eu*r<6*ZatiW{*I z8&~rA#z*+kb7MFSb2y7W4KSaJP^?0|kr!jI1=+aPhRVcF)PuWF_w7bKcM!D%hcR#} zFrNBxjKvA`;007ana$1~$ZID5Q8bj(pa&MCQoq{0p$#>`PS@=iN4*=>(IAH5Zq(Ae zf|}r)s0qG@dXdlF_LHtZq9%O0nf&X9-)SI&fv+0`I%!39u8FC06@5(ZBjyr!5jw*v znvBZr#1caPz>*0qt4cAUy~Uxhn+f)$Q?&j$M7CSsh^8plc*(12u_r7%8XAz zpeV&P?zPaV;egmuVgtc)+iF6YyoYEfT8MiI-<|xF6Dnndj@}|d-*5g?2FfOWJBU<5 zC*eBc|0UC{Xs;|LlzJ_riZ=9A$>O4Js^X~kcQ%7|F8jk8)!>%(IFFd)*4H5`WqfPw zCgKjFg1Cjy&YmjT^=k-i&J02yDitr0OO&cYsWwJf!9^QUuNKN?LVKc06^b@oKA{bx zl1D5jwh$>q0x?z6x!_nkA0lk>ABb3%=ub#*5A%PQwIh7MSK#xEcTH!xhIF{spyKW@RKi+UId|;y4=YOcBI_O`I7z+CU diff --git a/website/registrations/locale/nl/LC_MESSAGES/django.po b/website/registrations/locale/nl/LC_MESSAGES/django.po index a7d95819..9745b0ed 100644 --- a/website/registrations/locale/nl/LC_MESSAGES/django.po +++ b/website/registrations/locale/nl/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-09 20:43+0200\n" -"PO-Revision-Date: 2018-05-09 20:48+0200\n" +"POT-Creation-Date: 2018-07-09 11:35+0200\n" +"PO-Revision-Date: 2018-07-09 11:35+0200\n" "Last-Translator: Sébastiaan Versteeg \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:30 admin.py:132 +#: admin.py:34 admin.py:148 msgid "Application information" msgstr "Registratieinformatie" -#: admin.py:39 +#: admin.py:43 msgid "Personal information" msgstr "Persoonlijke informatie" -#: admin.py:46 +#: admin.py:50 msgid "Address" msgstr "Adres" -#: admin.py:52 +#: admin.py:56 msgid "University information" msgstr "Unversiteitsinformatie" -#: admin.py:94 tests/test_admin.py:220 +#: admin.py:106 tests/test_admin.py:222 msgid "Processed" msgstr "Verwerkt" -#: admin.py:95 tests/test_admin.py:212 +#: admin.py:107 tests/test_admin.py:214 msgid "Unprocessed" msgstr "Onverwerkt" -#: admin.py:106 tests/test_admin.py:138 tests/test_admin.py:273 +#: admin.py:119 tests/test_admin.py:138 tests/test_admin.py:275 #, python-format msgid "Successfully rejected %(count)d %(items)s." msgstr "%(count)d %(items)s succesvol afgekeurd." -#: admin.py:107 +#: admin.py:120 msgid "The selected registration(s) could not be rejected." msgstr "De geselecteerde registratie(s) konden niet worden afgekeurd." -#: admin.py:109 +#: admin.py:122 msgid "Reject selected registrations" msgstr "Keur geselecteerde registraties af" -#: admin.py:116 tests/test_admin.py:115 tests/test_admin.py:250 +#: admin.py:130 tests/test_admin.py:115 tests/test_admin.py:252 #, python-format msgid "Successfully accepted %(count)d %(items)s." msgstr "%(count)d %(items)s succesvol goedgekeurd." -#: admin.py:117 +#: admin.py:131 msgid "The selected registration(s) could not be accepted." msgstr "De geselecteerde registratie(s) konden niet worden goedgekeurd." -#: admin.py:119 +#: admin.py:133 msgid "Accept selected registrations" msgstr "Keur geselecteerde registraties goed" -#: apps.py:7 +#: apps.py:9 msgid "Registrations" msgstr "Registraties" -#: emails.py:16 tests/test_emails.py:37 +#: emails.py:21 tests/test_emails.py:37 msgid "Confirm email address" msgstr "Bevestig e-mailadres" -#: emails.py:33 tests/test_emails.py:68 +#: emails.py:43 tests/test_emails.py:68 msgid "Registration accepted" msgstr "Registratie goedgekeurd" -#: emails.py:46 emails.py:87 tests/test_emails.py:91 tests/test_emails.py:179 +#: emails.py:60 emails.py:114 tests/test_emails.py:91 tests/test_emails.py:179 msgid "Registration rejected" msgstr "Registratie afgekeurd" -#: emails.py:74 tests/test_emails.py:150 +#: emails.py:97 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:13 models.py:139 +#: forms.py:15 models.py:142 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:19 +#: models.py:21 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:30 +#: models.py:32 msgid "Rejected" msgstr "Afgekeurd" -#: models.py:31 +#: models.py:33 msgid "Accepted" msgstr "Goedgekeurd" -#: models.py:32 +#: models.py:34 msgid "Completed" msgstr "Voltooid" -#: models.py:36 +#: models.py:38 msgid "status" msgstr "status" -#: models.py:46 +#: models.py:48 msgid "One year" msgstr "Één jaar" -#: models.py:47 +#: models.py:49 msgid "Until graduation" msgstr "Tot afstuderen" -#: models.py:51 +#: models.py:53 msgid "membership length" msgstr "lengte lidmaatschap" -#: models.py:60 templates/registrations/renewal.html:30 +#: models.py:62 templates/registrations/renewal.html:30 msgid "membership type" msgstr "soort lidmaatschap" -#: models.py:67 +#: models.py:69 msgid "remarks" msgstr "opmerkingen" -#: models.py:107 +#: models.py:109 msgid "entry" msgstr "invoer" -#: models.py:108 +#: models.py:110 msgid "entries" msgstr "invoeren" -#: models.py:110 +#: models.py:112 msgid "Review registration and renewal entries" msgstr "Beoordeel registraties en verlengingen" -#: models.py:118 +#: models.py:121 msgid "Username" msgstr "Gebruikersnaam" -#: models.py:122 +#: models.py:125 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:127 +#: models.py:130 msgid "First name" msgstr "Voornaam" -#: models.py:133 +#: models.py:136 msgid "Last name" msgstr "Achternaam" -#: models.py:144 +#: models.py:147 msgid "language" msgstr "taal" -#: models.py:153 +#: models.py:156 msgid "Email address" msgstr "E-mailadres" -#: models.py:159 +#: models.py:162 msgid "phone number" msgstr "telefoonnummer" -#: models.py:162 +#: models.py:165 msgid "please enter a valid phone number" msgstr "voer alstublieft een geldig telefoonnummer in" -#: models.py:170 +#: models.py:173 msgid "student number" msgstr "studentnummer" -#: models.py:174 +#: models.py:177 msgid "enter a valid student- or e/z/u-number." msgstr "voer een geldig student- of e/z/u-nummer in." -#: models.py:182 +#: models.py:185 msgid "study programme" msgstr "studie" -#: models.py:188 +#: models.py:191 msgid "starting year" msgstr "startjaar" -#: models.py:199 +#: models.py:202 msgid "include the house number" msgstr "inclusief huisnummer" -#: models.py:201 +#: models.py:204 msgid "street and house number" msgstr "straat en huisnummer" -#: models.py:207 +#: models.py:210 msgid "second address line" msgstr "tweede adresregel" -#: models.py:214 +#: models.py:217 msgid "postal code" msgstr "postcode" -#: models.py:220 +#: models.py:223 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:246 +#: models.py:261 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:253 +#: models.py:268 msgid "A user with that username already exists." msgstr "Er bestaat al een gebruiker met deze gebruikersnaam." -#: models.py:258 models.py:263 +#: models.py:273 models.py:278 msgid "This field is required." msgstr "Dit veld is verplicht." -#: models.py:278 +#: models.py:293 msgid "registation" msgstr "registratie" -#: models.py:279 +#: models.py:294 msgid "registrations" msgstr "registraties" -#: models.py:286 +#: models.py:302 msgid "member" msgstr "lid" -#: models.py:303 tests/test_models.py:209 +#: models.py:319 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:311 models.py:312 +#: models.py:327 models.py:328 msgid "You currently have an active membership." msgstr "Je hebt op dit moment een actief lidmaatschap." -#: models.py:325 +#: models.py:341 msgid "You cannot renew your membership at this moment." msgstr "Je kunt je lidmaatschap op dit moment niet verlengen." -#: models.py:331 +#: models.py:347 msgid "" "Supporters cannot have a membership that lasts their entire study duration." msgstr "Begunstigers kunnen geen lidmaatschap hebben dat loopt tot afstuderen." -#: models.py:344 templates/registrations/renewal.html:4 +#: models.py:360 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:345 +#: models.py:361 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 privacy " @@ -721,7 +741,7 @@ msgstr "" "Ik ga akkoord met het privacybeleid" -#: 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:51 +#: tests/test_views.py:157 views.py:56 #, 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:62 +#: tests/test_views.py:193 views.py:67 #, 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:409 +#: tests/test_views.py:413 msgid "Member" msgstr "Lid" diff --git a/website/registrations/migrations/0009_auto_20180704_2338.py b/website/registrations/migrations/0009_auto_20180704_2338.py new file mode 100644 index 00000000..de47b55c --- /dev/null +++ b/website/registrations/migrations/0009_auto_20180704_2338.py @@ -0,0 +1,23 @@ +# 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'), + ), + ] diff --git a/website/registrations/models.py b/website/registrations/models.py index 595c2c19..1672eb54 100644 --- a/website/registrations/models.py +++ b/website/registrations/models.py @@ -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() diff --git a/website/registrations/services.py b/website/registrations/services.py index e8361aab..3b8e8f7a 100644 --- a/website/registrations/services.py +++ b/website/registrations/services.py @@ -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 diff --git a/website/registrations/templates/registrations/form_field.html b/website/registrations/templates/registrations/form_field.html index 926ad18b..1fc29ae7 100644 --- a/website/registrations/templates/registrations/form_field.html +++ b/website/registrations/templates/registrations/form_field.html @@ -1,5 +1,5 @@
- +
{{ field }} diff --git a/website/registrations/templates/registrations/register_member.html b/website/registrations/templates/registrations/register_member.html index a8616899..782c3933 100644 --- a/website/registrations/templates/registrations/register_member.html +++ b/website/registrations/templates/registrations/register_member.html @@ -34,13 +34,33 @@
{% csrf_token %} +
+ {% form_field form 'length' %} +
+
{% form_field form 'first_name' %} {% form_field form 'last_name' %} {% form_field form 'birthday' %} +
+
+ +
+
{% form_field form 'email' %} +
+
+ +
+
{% form_field form 'phone_number' %}
@@ -58,8 +78,6 @@
- {% form_field form 'length' %} -