Commit f3e0d555 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'tc/change-mention-of-supporter' into 'master'

Change all textual mentions of supporter to benefactor

Closes #697

See merge request !960
parents 0fac9c0a 9f44e25c
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-17 10:02+0200\n" "POT-Creation-Date: 2018-09-28 13:44+0200\n"
"PO-Revision-Date: 2018-09-17 10:58+0200\n" "PO-Revision-Date: 2018-09-28 13:45+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n" "Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -154,7 +154,7 @@ msgstr "" ...@@ -154,7 +154,7 @@ msgstr ""
#: templates/admin/mailinglists/change_list.html #: templates/admin/mailinglists/change_list.html
msgid "" msgid ""
"Archived moderated list that can be used to send mail to all supporters. " "Archived moderated list that can be used to send mail to all benefactors. "
"Supports language code suffix." "Supports language code suffix."
msgstr "" msgstr ""
"Gearchiveerde en gemodereerde lijst die gebruikt kan worden om mail naar " "Gearchiveerde en gemodereerde lijst die gebruikt kan worden om mail naar "
......
...@@ -2,7 +2,7 @@ from django.conf import settings ...@@ -2,7 +2,7 @@ from django.conf import settings
from django.utils import timezone from django.utils import timezone
from activemembers.models import MemberGroupMembership, Mentorship, Board from activemembers.models import MemberGroupMembership, Mentorship, Board
from members.models import Member from members.models import Member, Membership
from utils.snippets import datetime_to_lectureyear from utils.snippets import datetime_to_lectureyear
...@@ -36,8 +36,8 @@ def get_automatic_lists(): ...@@ -36,8 +36,8 @@ def get_automatic_lists():
['leden', 'members'], '[THALIA]', ['leden', 'members'], '[THALIA]',
Member.all_with_membership('member'), True, True, True) Member.all_with_membership('member'), True, True, True)
lists += _create_automatic_list( lists += _create_automatic_list(
['begunstigers', 'supporters'], '[THALIA]', Member.all_with_membership( ['begunstigers', 'benefactors'], '[THALIA]', Member.all_with_membership(
'supporter'), multilingual=True) Membership.BENEFACTOR), multilingual=True)
lists += _create_automatic_list( lists += _create_automatic_list(
['ereleden', 'honorary'], '[THALIA]', Member.all_with_membership( ['ereleden', 'honorary'], '[THALIA]', Member.all_with_membership(
'honorary'), multilingual=True) 'honorary'), multilingual=True)
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td>begunstigers, supporters</td> <td>begunstigers, benefactors</td>
<td>{% trans "Archived moderated list that can be used to send mail to all supporters. Supports language code suffix." %}</td> <td>{% trans "Archived moderated list that can be used to send mail to all benefactors. Supports language code suffix." %}</td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
......
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-31 17:06+0200\n" "POT-Creation-Date: 2018-09-28 13:58+0200\n"
"PO-Revision-Date: 2018-09-26 20:12+0200\n" "PO-Revision-Date: 2018-09-28 13:58+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n" "Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -373,7 +373,7 @@ msgid "Member" ...@@ -373,7 +373,7 @@ msgid "Member"
msgstr "Lid" msgstr "Lid"
#: models.py #: models.py
msgid "Supporter" msgid "Benefactor"
msgstr "Begunstiger" msgstr "Begunstiger"
#: models.py #: models.py
...@@ -1020,5 +1020,5 @@ msgid "Former member" ...@@ -1020,5 +1020,5 @@ msgid "Former member"
msgstr "Oud-lid" msgstr "Oud-lid"
#: views.py #: views.py
msgid "Former supporter" msgid "Former benefactor"
msgstr "Oud-begunstiger" msgstr "Oud-begunstiger"
# Generated by Django 2.0.8 on 2018-09-28 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '0024_auto_20180907_1528'),
]
operations = [
migrations.AlterField(
model_name='membership',
name='type',
field=models.CharField(choices=[('member', 'Member'), ('supporter', 'Benefactor'), ('honorary', 'Honorary Member')], max_length=40, verbose_name='Membership type'),
),
]
...@@ -513,12 +513,12 @@ class Profile(models.Model): ...@@ -513,12 +513,12 @@ class Profile(models.Model):
class Membership(models.Model): class Membership(models.Model):
MEMBER = 'member' MEMBER = 'member'
SUPPORTER = 'supporter' BENEFACTOR = 'supporter'
HONORARY = 'honorary' HONORARY = 'honorary'
MEMBERSHIP_TYPES = ( MEMBERSHIP_TYPES = (
(MEMBER, _('Member')), (MEMBER, _('Member')),
(SUPPORTER, _('Supporter')), (BENEFACTOR, _('Benefactor')),
(HONORARY, _('Honorary Member'))) (HONORARY, _('Honorary Member')))
type = models.CharField( type = models.CharField(
......
...@@ -59,7 +59,7 @@ $(function () { ...@@ -59,7 +59,7 @@ $(function () {
name: gettext('Members'), name: gettext('Members'),
y: total_stats_member_type.member y: total_stats_member_type.member
},{ },{
name: gettext('Supporters'), name: gettext('Benefactors'),
y: total_stats_member_type.supporter y: total_stats_member_type.supporter
},{ },{
name: gettext('Honorary Members'), name: gettext('Honorary Members'),
...@@ -139,12 +139,12 @@ $(function () { ...@@ -139,12 +139,12 @@ $(function () {
}); });
$('#supportersYearChart').highcharts({ $('#benefactorsYearChart').highcharts({
chart: { chart: {
type: 'pie' type: 'pie'
}, },
title: { title: {
text: gettext("Supporters per year"), text: gettext("Benefactors per year"),
}, },
plotOptions: { plotOptions: {
pie: pieOptions pie: pieOptions
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div id="membersTypeChart" style="width:100%; height:400px;"></div> <div id="membersTypeChart" style="width:100%; height:400px;"></div>
<div id="totalYearChart" style="width:100%; height:400px;"></div> <div id="totalYearChart" style="width:100%; height:400px;"></div>
<div id="membersYearChart" style="width:100%; height:400px;"></div> <div id="membersYearChart" style="width:100%; height:400px;"></div>
<div id="supportersYearChart" style="width:100%; height:400px;"></div> <div id="benefactorsYearChart" style="width:100%; height:400px;"></div>
<div id="pizzaTotalTypeChart" style="width:100%; height:400px;"></div> <div id="pizzaTotalTypeChart" style="width:100%; height:400px;"></div>
{% if current_pizza_orders != 'null' %} {# None is json-serialized to 'null' #} {% if current_pizza_orders != 'null' %} {# None is json-serialized to 'null' #}
<div id="pizzaCurrentTypeChart" style="width:100%; height:400px;"></div> <div id="pizzaCurrentTypeChart" style="width:100%; height:400px;"></div>
......
...@@ -112,20 +112,20 @@ class EmailsTest(TestCase): ...@@ -112,20 +112,20 @@ class EmailsTest(TestCase):
since=timezone.now().replace(year=2017, month=9, day=6), since=timezone.now().replace(year=2017, month=9, day=6),
until=None until=None
) )
cls.supporter = Member.objects.create( cls.benefactor = Member.objects.create(
username='test6', username='test6',
first_name='Test6', first_name='Test6',
last_name='Example', last_name='Example',
email='test6@example.org' email='test6@example.org'
) )
Membership.objects.create( Membership.objects.create(
user=cls.supporter, user=cls.benefactor,
type=Membership.SUPPORTER, type=Membership.BENEFACTOR,
since=timezone.now().replace(year=2017, month=9, day=1), since=timezone.now().replace(year=2017, month=9, day=1),
until=timezone.now().replace(year=2018, month=9, day=1) until=timezone.now().replace(year=2018, month=9, day=1)
) )
Profile.objects.create( Profile.objects.create(
user=cls.supporter, user=cls.benefactor,
language='nl', language='nl',
) )
cls.honorary_member = Member.objects.create( cls.honorary_member = Member.objects.create(
......
...@@ -156,26 +156,26 @@ class MembershipFilterTest(TestCase): ...@@ -156,26 +156,26 @@ class MembershipFilterTest(TestCase):
profiles = [Profile(user_id=i) for i in range(7)] profiles = [Profile(user_id=i) for i in range(7)]
Profile.objects.bulk_create(profiles) Profile.objects.bulk_create(profiles)
Membership(user_id=0, type='honorary', Membership(user_id=0, type=Membership.HONORARY,
until=date.today() + timedelta(days=1)).save() until=date.today() + timedelta(days=1)).save()
Membership(user_id=1, type='supporter', Membership(user_id=1, type=Membership.BENEFACTOR,
until=date.today() + timedelta(days=1)).save() until=date.today() + timedelta(days=1)).save()
Membership(user_id=2, type='member', Membership(user_id=2, type=Membership.MEMBER,
until=date.today() + timedelta(days=1)).save() until=date.today() + timedelta(days=1)).save()
Membership(user_id=3, type='member', Membership(user_id=3, type=Membership.MEMBER,
until=date.today() + timedelta(days=1)).save() until=date.today() + timedelta(days=1)).save()
Membership(user_id=3, type='member', Membership(user_id=3, type=Membership.MEMBER,
until=date.today() - timedelta(days=365*10)).save() until=date.today() - timedelta(days=365*10)).save()
Membership(user_id=4, type='supporter', Membership(user_id=4, type=Membership.BENEFACTOR,
until=date.today() + timedelta(days=1)).save() until=date.today() + timedelta(days=1)).save()
Membership(user_id=4, type='member', Membership(user_id=4, type=Membership.MEMBER,
until=date.today() - timedelta(days=365*10)).save() until=date.today() - timedelta(days=365*10)).save()
Membership(user_id=5, type='member', Membership(user_id=5, type=Membership.MEMBER,
until=date.today() - timedelta(days=365*10)).save() until=date.today() - timedelta(days=365*10)).save()
# user_id=6 has no memberships at all # user_id=6 has no memberships at all
......
...@@ -19,7 +19,7 @@ class StatisticsTest(TestCase): ...@@ -19,7 +19,7 @@ class StatisticsTest(TestCase):
# Add 10 members with default membership # Add 10 members with default membership
members = [Member(id=i, username=i) for i in range(10)] members = [Member(id=i, username=i) for i in range(10)]
Member.objects.bulk_create(members) Member.objects.bulk_create(members)
memberships = [Membership(user_id=i, type="member") memberships = [Membership(user_id=i, type=Membership.MEMBER)
for i in range(10)] for i in range(10)]
Membership.objects.bulk_create(memberships) Membership.objects.bulk_create(memberships)
profiles = [Profile(user_id=i) for i in range(10)] profiles = [Profile(user_id=i) for i in range(10)]
...@@ -35,7 +35,7 @@ class StatisticsTest(TestCase): ...@@ -35,7 +35,7 @@ class StatisticsTest(TestCase):
return sum(members.values()) return sum(members.values())
def test_gen_stats_year_no_members(self): def test_gen_stats_year_no_members(self):
member_types = ["member", "supporter", "honorary"] member_types = [t[0] for t in Membership.MEMBERSHIP_TYPES]
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(0, self.sum_members(result)) self.assertEqual(0, self.sum_members(result))
...@@ -43,7 +43,7 @@ class StatisticsTest(TestCase): ...@@ -43,7 +43,7 @@ class StatisticsTest(TestCase):
""" """
Testing if active and non-active objects are counted correctly Testing if active and non-active objects are counted correctly
""" """
member_types = ["member", "supporter", "honorary"] member_types = [t[0] for t in Membership.MEMBERSHIP_TYPES]
current_year = datetime_to_lectureyear(date.today()) current_year = datetime_to_lectureyear(date.today())
# Set start date to current year - 1: # Set start date to current year - 1:
...@@ -52,42 +52,42 @@ class StatisticsTest(TestCase): ...@@ -52,42 +52,42 @@ class StatisticsTest(TestCase):
m.profile.save() m.profile.save()
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(10, self.sum_members(result)) self.assertEqual(10, self.sum_members(result))
self.assertEqual(10, self.sum_members(result, "member")) self.assertEqual(10, self.sum_members(result, Membership.MEMBER))
result = gen_stats_member_type(member_types) result = gen_stats_member_type(member_types)
self.assertEqual(10, self.sum_member_types(result)) self.assertEqual(10, self.sum_member_types(result))
# Change one membership to supporter should decrease amount of members # Change one membership to benefactor should decrease amount of members
m = Membership.objects.all()[0] m = Membership.objects.all()[0]
m.type = "supporter" m.type = Membership.BENEFACTOR
m.save() m.save()
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(10, self.sum_members(result)) self.assertEqual(10, self.sum_members(result))
self.assertEqual(9, self.sum_members(result, "member")) self.assertEqual(9, self.sum_members(result, Membership.MEMBER))
self.assertEqual(1, self.sum_members(result, "supporter")) self.assertEqual(1, self.sum_members(result, Membership.BENEFACTOR))
result = gen_stats_member_type(member_types) result = gen_stats_member_type(member_types)
self.assertEqual(10, self.sum_member_types(result)) self.assertEqual(10, self.sum_member_types(result))
self.assertEqual(9, result["member"]) self.assertEqual(9, result[Membership.MEMBER])
self.assertEqual(1, result["supporter"]) self.assertEqual(1, result[Membership.BENEFACTOR])
# Same for honorary members # Same for honorary members
m = Membership.objects.all()[1] m = Membership.objects.all()[1]
m.type = "honorary" m.type = Membership.HONORARY
m.save() m.save()
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(10, self.sum_members(result)) self.assertEqual(10, self.sum_members(result))
self.assertEqual(8, self.sum_members(result, "member")) self.assertEqual(8, self.sum_members(result, Membership.MEMBER))
self.assertEqual(1, self.sum_members(result, "supporter")) self.assertEqual(1, self.sum_members(result, Membership.BENEFACTOR))
self.assertEqual(1, self.sum_members(result, "honorary")) self.assertEqual(1, self.sum_members(result, Membership.HONORARY))
result = gen_stats_member_type(member_types) result = gen_stats_member_type(member_types)
self.assertEqual(10, self.sum_member_types(result)) self.assertEqual(10, self.sum_member_types(result))
self.assertEqual(8, result["member"]) self.assertEqual(8, result[Membership.MEMBER])
self.assertEqual(1, result["supporter"]) self.assertEqual(1, result[Membership.BENEFACTOR])
self.assertEqual(1, result["honorary"]) self.assertEqual(1, result[Membership.HONORARY])
# Terminate one membership by setting end date to current_year -1, # Terminate one membership by setting end date to current_year -1,
# should decrease total amount and total members # should decrease total amount and total members
...@@ -96,18 +96,18 @@ class StatisticsTest(TestCase): ...@@ -96,18 +96,18 @@ class StatisticsTest(TestCase):
m.save() m.save()
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(9, self.sum_members(result)) self.assertEqual(9, self.sum_members(result))
self.assertEqual(7, self.sum_members(result, "member")) self.assertEqual(7, self.sum_members(result, Membership.MEMBER))
self.assertEqual(1, self.sum_members(result, "supporter")) self.assertEqual(1, self.sum_members(result, Membership.BENEFACTOR))
self.assertEqual(1, self.sum_members(result, "honorary")) self.assertEqual(1, self.sum_members(result, Membership.HONORARY))
result = gen_stats_member_type(member_types) result = gen_stats_member_type(member_types)
self.assertEqual(9, self.sum_member_types(result)) self.assertEqual(9, self.sum_member_types(result))
self.assertEqual(7, result["member"]) self.assertEqual(7, result[Membership.MEMBER])
self.assertEqual(1, result["supporter"]) self.assertEqual(1, result[Membership.BENEFACTOR])
self.assertEqual(1, result["honorary"]) self.assertEqual(1, result[Membership.HONORARY])
def test_gen_stats_different_years(self): def test_gen_stats_different_years(self):
member_types = ["member", "supporter", "honorary"] member_types = [t[0] for t in Membership.MEMBERSHIP_TYPES]
current_year = datetime_to_lectureyear(date.today()) current_year = datetime_to_lectureyear(date.today())
# postgres does not define random access directly on unsorted querysets # postgres does not define random access directly on unsorted querysets
...@@ -140,25 +140,25 @@ class StatisticsTest(TestCase): ...@@ -140,25 +140,25 @@ class StatisticsTest(TestCase):
# 4 active members # 4 active members
result = gen_stats_year(member_types) result = gen_stats_year(member_types)
self.assertEqual(4, self.sum_members(result)) self.assertEqual(4, self.sum_members(result))
self.assertEqual(4, self.sum_members(result, "member")) self.assertEqual(4, self.sum_members(result, Membership.MEMBER))
# one first year student # one first year student
self.assertEqual(1, result[0]['member']) self.assertEqual(1, result[0][Membership.MEMBER])
# one second year student # one second year student
self.assertEqual(1, result[1]['member']) self.assertEqual(1, result[1][Membership.MEMBER])
# no third year students # no third year students
self.assertEqual(0, result[2]['member']) self.assertEqual(0, result[2][Membership.MEMBER])
# one fourth year student # one fourth year student
self.assertEqual(1, result[3]['member']) self.assertEqual(1, result[3][Membership.MEMBER])
# no fifth year students # no fifth year students
self.assertEqual(0, result[4]['member']) self.assertEqual(0, result[4][Membership.MEMBER])
# one >5 year student # one >5 year student
self.assertEqual(1, result[5]['member']) self.assertEqual(1, result[5][Membership.MEMBER])
class EmailChangeTest(TestCase): class EmailChangeTest(TestCase):
......
...@@ -17,7 +17,7 @@ from rest_framework.response import Response ...@@ -17,7 +17,7 @@ from rest_framework.response import Response
import pizzas.services import pizzas.services
from members import services, emails from members import services, emails
from members.models import EmailChange from members.models import EmailChange, Membership
from . import models from . import models
from .forms import ProfileForm, EmailChangeForm from .forms import ProfileForm, EmailChangeForm
from .services import member_achievements from .services import member_achievements
...@@ -150,7 +150,7 @@ def profile(request, pk=None): ...@@ -150,7 +150,7 @@ def profile(request, pk=None):
elif member.has_been_member(): elif member.has_been_member():
membership_type = _("Former member") membership_type = _("Former member")
elif member.latest_membership: elif member.latest_membership:
membership_type = _("Former supporter") membership_type = _("Former benefactor")
return render(request, 'members/profile.html', return render(request, 'members/profile.html',
{ {
...@@ -212,7 +212,7 @@ def iban_export(request): ...@@ -212,7 +212,7 @@ def iban_export(request):
@login_required @login_required
def statistics(request): def statistics(request):
member_types = ("member", "supporter", "honorary") member_types = (t[0] for t in Membership.MEMBERSHIP_TYPES)
# The numbers # The numbers
total = models.Member.current_members.count() total = models.Member.current_members.count()
......
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-28 16:51+0200\n" "POT-Creation-Date: 2018-09-28 14:01+0200\n"
"PO-Revision-Date: 2018-08-28 16:51+0200\n" "PO-Revision-Date: 2018-09-28 14:02+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n" "Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -16,7 +16,7 @@ msgstr "" ...@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.4\n" "X-Generator: Poedit 2.1.1\n"
#: admin.py #: admin.py
msgid "Application information" msgid "Application information"
...@@ -136,7 +136,7 @@ msgstr "Voltooid" ...@@ -136,7 +136,7 @@ msgstr "Voltooid"
msgid "status" msgid "status"
msgstr "status" msgstr "status"
#: models.py #: models.py templates/registrations/renewal.html
msgid "One year" msgid "One year"
msgstr "Één jaar" msgstr "Één jaar"
...@@ -144,7 +144,7 @@ msgstr "Één jaar" ...@@ -144,7 +144,7 @@ msgstr "Één jaar"
msgid "Until graduation" msgid "Until graduation"
msgstr "Tot afstuderen"