Commit 692e7ba4 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Sébastiaan Versteeg

Reference implementation of the first contribution wiki

parent 4beb598f
......@@ -29,7 +29,7 @@ class ProfileInline(admin.StackedInline):
'receive_optin', 'receive_newsletter', 'birthday',
'show_birthday', 'auto_renew', 'initials',
'nickname', 'display_name_preference', 'profile_description',
'website', 'photo', 'emergency_contact',
'shoe_size', 'website', 'photo', 'emergency_contact',
'emergency_contact_phone_number', 'language',
'event_permissions')
model = models.Profile
......
......@@ -54,7 +54,7 @@ class ProfileRetrieveSerializer(serializers.ModelSerializer):
model = Profile
fields = ('pk', 'display_name', 'avatar', 'profile_description',
'birthday', 'starting_year', 'programme', 'website',
'membership_type', 'achievements', 'societies')
'membership_type', 'shoe_size', 'achievements', 'societies')
pk = serializers.SerializerMethodField('_pk')
avatar = serializers.SerializerMethodField('_avatar')
......@@ -129,7 +129,8 @@ class ProfileEditSerializer(serializers.ModelSerializer):
'nickname', 'display_name_preference',
'language', 'receive_optin', 'receive_newsletter',
'display_name', 'avatar', 'birthday', 'starting_year',
'programme', 'membership_type', 'achievements', 'societies')
'programme', 'membership_type', 'achievements', 'societies',
'shoe_size')
read_only_fields = ('display_name', 'starting_year', 'programme',
'birthday')
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-06-07 16:35+0200\n"
"POT-Creation-Date: 2019-09-11 21:14+0200\n"
"PO-Revision-Date: 2019-06-07 16:37+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
......@@ -188,7 +188,7 @@ msgstr "Informatica (Computing Science)"
msgid "Information Sciences"
msgstr "Informatiekunde (Information Sciences)"
#: models.py templates/members/profile.html
#: models.py templates/members/user/profile.html
msgid "Study programme"
msgstr "Studie"
......@@ -244,7 +244,11 @@ msgstr "Telefoonnummer noodcontact"
msgid "The phone number for the emergency contact"
msgstr "Het telefoonummer van de noodcontact"
#: models.py templates/members/profile.html
#: models.py templates/members/user/profile.html
msgid "Shoe size"
msgstr "Schoenmaat"
#: models.py templates/members/user/profile.html
msgid "Birthday"
msgstr "Verjaardag"
......@@ -260,7 +264,7 @@ msgstr ""
"Toon je verjaardag aan andere leden op je profielpagina en in de "
"verjaardagskalender"
#: models.py templates/members/profile.html
#: models.py templates/members/user/profile.html
msgid "Website"
msgstr "Website"
......@@ -401,7 +405,7 @@ msgstr "Begunstiger"
msgid "Honorary Member"
msgstr "Erelid"
#: models.py templates/members/profile.html
#: models.py templates/members/user/profile.html
msgid "Membership type"
msgstr "Lidtype"
......@@ -490,46 +494,6 @@ msgstr "Ouder"
msgid "Export IBANs for Direct Debit"
msgstr "Exporteer IBANs voor automatische incasso"
#: templates/members/edit_profile.html templates/members/user.html
msgid "edit profile"
msgstr "profiel bewerken"
#: templates/members/edit_profile.html templates/members/email_change.html
#: templates/members/email_change_confirmed.html
#: templates/members/email_change_requested.html
#: templates/members/email_change_verified.html templates/members/index.html
#: templates/members/profile.html templates/members/user.html
msgid "members"
msgstr "leden"
#: templates/members/edit_profile.html
msgid "Your profile has been updated successfully."
msgstr "Je profiel is succesvol opgeslagen."
#: templates/members/edit_profile.html
msgid "Please check your profile for errors."
msgstr "Controleer je profiel op fouten."
#: templates/members/edit_profile.html
msgid "First Name"
msgstr "Voornaam"
#: templates/members/edit_profile.html
msgid "Last Name"
msgstr "Achternaam"
#: templates/members/edit_profile.html
msgid "Email Address"
msgstr "E-mailadres"
#: templates/members/edit_profile.html
msgid "Click here to change your email address."
msgstr "Klik hier om je e-mailadres aan te passen."
#: templates/members/edit_profile.html
msgid "save"
msgstr "opslaan"
#: templates/members/email/email_change_completed.txt
#, python-format
msgid ""
......@@ -872,40 +836,14 @@ msgstr ""
"\n"
"Deze e-mail is automatisch gegenereerd."
#: templates/members/email_change.html
#: templates/members/email_change_confirmed.html
#: templates/members/email_change_requested.html
#: templates/members/email_change_verified.html
msgid "change email"
msgstr "e-mailadres veranderen"
#: templates/members/email_change.html
msgid "change"
msgstr "verander"
#: templates/members/email_change_confirmed.html
msgid ""
"The confirmation of your email change was successful. Check your new inbox "
"for the verification email."
msgstr ""
"De verandering van je e-mailadres is bevestigd. Controleer je nieuwe inbox "
"voor de verificatie e-mail."
#: templates/members/email_change_requested.html
msgid ""
"We have received the request to change your email address. You should "
"receive a message in both your new and old mailboxes to verify the change."
msgstr ""
"We hebben je verzoek tot verandering van je e-mailadres ontvangen. "
"Controleer je oude en nieuwe mailboxen om de verandering te bevestigen."
#: templates/members/email_change_verified.html
msgid ""
"The verification of your email change was successful. Check your old inbox "
"for the confirmation email."
msgstr ""
"Het nieuwe e-mailadres van je account is geverifieerd. Controleer je oude "
"inbox voor de bevestigingse-mail."
#: templates/members/index.html templates/members/user/edit_profile.html
#: templates/members/user/email_change.html
#: templates/members/user/email_change_confirmed.html
#: templates/members/user/email_change_requested.html
#: templates/members/user/email_change_verified.html
#: templates/members/user/index.html templates/members/user/profile.html
msgid "members"
msgstr "leden"
#: templates/members/index.html
msgid ""
......@@ -945,103 +883,166 @@ msgstr "Oud-leden"
msgid "No members found"
msgstr "Geen leden gevonden"
#: templates/members/profile.html
msgid "profile"
msgstr "profiel"
#: templates/members/statistics.html
msgid "Statistics"
msgstr "Statistieken"
#: templates/members/profile.html
msgid "About"
msgstr "Over"
#: templates/members/statistics.html
msgid "Total amount of Thalia members"
msgstr "Totaal aantal Thalialeden"
#: templates/members/profile.html
msgid "This member has not written a description yet."
msgstr "Dit lid heeft nog geen beschrijving geschreven."
#: templates/members/user/edit_profile.html templates/members/user/index.html
msgid "edit profile"
msgstr "profiel bewerken"
#: templates/members/profile.html
msgid "Personal information"
msgstr "Persoonlijke gegevens"
#: templates/members/user/edit_profile.html
msgid "Please check your profile for errors."
msgstr "Controleer je profiel op fouten."
#: templates/members/profile.html templatetags/member_card.py
msgid "Cohort"
msgstr "Cohort"
#: templates/members/user/edit_profile.html
msgid "First Name"
msgstr "Voornaam"
#: templates/members/profile.html
msgid "Achievements for Thalia"
msgstr "Verdiensten voor Thalia"
#: templates/members/user/edit_profile.html
msgid "Last Name"
msgstr "Achternaam"
#: templates/members/profile.html
msgid "Chair"
msgstr "Voorzitter"
#: templates/members/user/edit_profile.html
msgid "Email Address"
msgstr "E-mailadres"
#: templates/members/profile.html
msgid "today"
msgstr "heden"
#: templates/members/user/edit_profile.html
msgid "Click here to change your email address."
msgstr "Klik hier om je e-mailadres aan te passen."
#: templates/members/profile.html
msgid "Societies"
msgstr "Gezelschappen"
#: templates/members/user/edit_profile.html
msgid "save"
msgstr "opslaan"
#: templates/members/statistics.html
msgid "Statistics"
msgstr "Statistieken"
#: templates/members/user/email_change.html
#: templates/members/user/email_change_confirmed.html
#: templates/members/user/email_change_requested.html
#: templates/members/user/email_change_verified.html
msgid "change email"
msgstr "e-mailadres veranderen"
#: templates/members/statistics.html
msgid "Total amount of Thalia members"
msgstr "Totaal aantal Thalialeden"
#: templates/members/user/email_change.html
msgid "change"
msgstr "verander"
#: templates/members/user/email_change_confirmed.html
msgid ""
"The confirmation of your email change was successful. Check your new inbox "
"for the verification email."
msgstr ""
"De verandering van je e-mailadres is bevestigd. Controleer je nieuwe inbox "
"voor de verificatie e-mail."
#: templates/members/user/email_change_requested.html
msgid ""
"We have received the request to change your email address. You should "
"receive a message in both your new and old mailboxes to verify the change."
msgstr ""
"We hebben je verzoek tot verandering van je e-mailadres ontvangen. "
"Controleer je oude en nieuwe mailboxen om de verandering te bevestigen."
#: templates/members/user/email_change_verified.html
msgid ""
"The verification of your email change was successful. Check your old inbox "
"for the confirmation email."
msgstr ""
"Het nieuwe e-mailadres van je account is geverifieerd. Controleer je oude "
"inbox voor de bevestigingse-mail."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Account"
msgstr "Account"
#: templates/members/user.html
#: templates/members/user/index.html
#, python-format
msgid "You’re currently logged in as <strong>%(user)s</strong>"
msgstr "U bent momenteel ingelogd als <strong>%(user)s</strong>"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "show public profile"
msgstr "bekijk publieke profielpagina"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Take a look at your own profile."
msgstr "Bekijk je eigen profielpagina."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "manage membership"
msgstr "lidmaatschap beheren"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Get information about your membership or renew it."
msgstr "Bekijk je lidmaatschap of vernieuw deze indien nodig."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Edit your profile and avatar."
msgstr "Bewerk je profiel en profielafbeelding."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "manage bank account(s)"
msgstr "bankrekening(en) beheren"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Change the financial information known to Thalia."
msgstr "Verander de financiële informatie bekend bij Thalia."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "change password"
msgstr "wachtwoord wijzigen"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Change your accounts' password."
msgstr "Wijzig het wachtwoord van je account."
#: templates/members/user.html
#: templates/members/user/index.html
msgid "logout"
msgstr "uitloggen"
#: templates/members/user.html
#: templates/members/user/index.html
msgid "Leave the restricted area of the website."
msgstr "Verlaat het beveiligde gedeelte van de website."
#: templates/members/user/profile.html
msgid "profile"
msgstr "profiel"
#: templates/members/user/profile.html
msgid "About"
msgstr "Over"
#: templates/members/user/profile.html
msgid "This member has not written a description yet."
msgstr "Dit lid heeft nog geen beschrijving geschreven."
#: templates/members/user/profile.html
msgid "Personal information"
msgstr "Persoonlijke gegevens"
#: templates/members/user/profile.html templatetags/member_card.py
msgid "Cohort"
msgstr "Cohort"
#: templates/members/user/profile.html
msgid "Achievements for Thalia"
msgstr "Verdiensten voor Thalia"
#: templates/members/user/profile.html
msgid "Chair"
msgstr "Voorzitter"
#: templates/members/user/profile.html
msgid "today"
msgstr "heden"
#: templates/members/user/profile.html
msgid "Societies"
msgstr "Gezelschappen"
#: views.py
msgid "Unknown membership history"
msgstr "Onbekende lidmaatschap geschiedenis"
......@@ -1057,3 +1058,7 @@ msgstr "Oud-lid"
#: views.py
msgid "Former benefactor"
msgstr "Oud-begunstiger"
#: views.py
msgid "Your profile has been updated successfully."
msgstr "Je profiel is succesvol opgeslagen."
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-22 13:50
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '0033_auto_20190428_1255'),
]
operations = [
migrations.AddField(
model_name='profile',
name='shoe_size',
field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(39), django.core.validators.MaxValueValidator(47)], verbose_name='Shoe size'),
),
]
......@@ -12,6 +12,7 @@ from django.contrib.auth.models import User, UserManager
from django.core import validators
from django.core.exceptions import ValidationError
from django.core.files.storage import DefaultStorage
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.db.models import Q
from django.urls import reverse
......@@ -325,6 +326,13 @@ class Profile(models.Model):
# ---- Personal information ------
shoe_size = models.IntegerField(
verbose_name=_('Shoe size'),
validators=[MinValueValidator(39), MaxValueValidator(47)],
blank=True,
null=True,
)
birthday = models.DateField(
verbose_name=_('Birthday'),
null=True
......
......@@ -64,6 +64,10 @@
</li>
{% endif %}
{% if member.profile.shoe_size %}
<li><span>{% trans "Shoe size" %}: </span> {{ member.profile.shoe_size }}</li>
{% endif %}
{% if member.profile.show_birthday and member.profile.birthday %}
<li><strong>{% trans "Birthday" %}: </strong> {{ member.profile.birthday }}</li>
{% endif %}
......
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