Skip to content
GitLab
Menu
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
c4c927e6
Commit
c4c927e6
authored
Jun 13, 2018
by
Tom van Bussel
Browse files
Add a new filter for active committee memberships
parent
998cd827
Changes
3
Hide whitespace changes
Inline
Side-by-side
website/activemembers/admin.py
View file @
c4c927e6
...
...
@@ -3,6 +3,7 @@ import csv
import
datetime
from
django
import
forms
from
django.db.models
import
Q
from
django.contrib
import
admin
,
messages
from
django.contrib.auth.models
import
Permission
from
django.http
import
HttpResponse
...
...
@@ -138,12 +139,35 @@ class LectureYearFilter(admin.SimpleListFilter):
return
queryset
.
exclude
(
until__lt
=
first_of_september
)
class
ActiveMembershipsFilter
(
admin
.
SimpleListFilter
):
"""Filter the memberships by whether they are active or not"""
title
=
_
(
'active memberships'
)
parameter_name
=
'active'
def
lookups
(
self
,
request
,
model_name
):
return
(
(
'active'
,
_
(
'Active'
)),
(
'inactive'
,
_
(
'Inactive'
)),
)
def
queryset
(
self
,
request
,
queryset
):
now
=
timezone
.
now
()
if
self
.
value
()
==
'active'
:
return
queryset
.
filter
(
Q
(
until__isnull
=
True
)
|
Q
(
until__gte
=
now
))
if
self
.
value
()
==
'inactive'
:
return
queryset
.
filter
(
until__lt
=
now
)
@
admin
.
register
(
models
.
CommitteeMembership
)
class
CommitteeMembershipAdmin
(
TranslatedModelAdmin
):
"""Manage the committee memberships"""
form
=
CommitteeMembershipForm
list_display
=
(
'member'
,
'committee'
,
'since'
,
'until'
,
'chair'
,
'role'
)
list_filter
=
(
'committee'
,
BoardFilter
,
LectureYearFilter
)
list_filter
=
(
'committee'
,
BoardFilter
,
LectureYearFilter
,
ActiveMembershipsFilter
)
list_select_related
=
(
'member'
,
'committee'
,)
search_fields
=
(
'member__first_name'
,
'member__last_name'
,
'member__email'
)
...
...
website/activemembers/locale/nl/LC_MESSAGES/django.mo
View file @
c4c927e6
No preview for this file type
website/activemembers/locale/nl/LC_MESSAGES/django.po
View file @
c4c927e6
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
3
-1
4
2
1:3
7+0
1
00\n"
"PO-Revision-Date: 2018-0
3
-1
4
2
1:3
8+0
1
00\n"
"POT-Creation-Date: 2018-0
6
-1
3
2
0:0
7+0
2
00\n"
"PO-Revision-Date: 2018-0
6
-1
3
2
0:0
8+0
2
00\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -16,25 +16,37 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.
4
\n"
"X-Generator: Poedit 2.0.
6
\n"
#: admin.py:
95
#: admin.py:
100
msgid "board memberships"
msgstr "
B
estuurslidmaatschappen"
msgstr "
b
estuurslidmaatschappen"
#: admin.py:10
0
#: admin.py:10
5
msgid "Only board memberships"
msgstr "Alleen bestuurslidmaatschappen"
#: admin.py:10
1
#: admin.py:10
6
msgid "No board memberships"
msgstr "Geen bestuurslidmaatschappen"
#: admin.py:1
14
#: admin.py:1
20
msgid "lecture year"
msgstr "collegejaar"
#: admin.py:147
#: admin.py:143
msgid "active memberships"
msgstr "actieve lidmaatschappen"
#: admin.py:148
msgid "Active"
msgstr "Actief"
#: admin.py:149
msgid "Inactive"
msgstr "Inactief"
#: admin.py:176
msgid ""
"Do not edit existing memberships if the chair of a committee has changed, "
"add a new committeemembership instead."
...
...
@@ -42,79 +54,79 @@ msgstr ""
"Pas geen bestaande lidmaatschappen aan als de voorzitter van een commissie "
"is veranderd. Voeg in de plaats daarvan een nieuw commissielidmaatschap toe."
#: admin.py:1
60
#: admin.py:1
89
msgid "First name"
msgstr "Voornaam"
#: admin.py:1
61
#: admin.py:1
90
msgid "Last name"
msgstr "Achernaam"
#: admin.py:1
62
#: admin.py:1
91
msgid "Email"
msgstr "Email"
#: admin.py:1
63
models.py:22
2
#: admin.py:1
92
models.py:22
7
msgid "Committee"
msgstr "Commissie"
#: admin.py:1
64
models.py:2
26
#: admin.py:1
93
models.py:2
31
msgid "Committee member since"
msgstr "Commissielid sinds"
#: admin.py:1
65
models.py:23
2
#: admin.py:1
94
models.py:23
7
msgid "Committee member until"
msgstr "Commissielid tot"
#: admin.py:1
66
models.py:24
0
#: admin.py:1
95
models.py:24
5
msgid "Chair of the committee"
msgstr "Voorzitter van de commissie"
#: admin.py:16
7
#: admin.py:1
9
6
msgid "Role"
msgstr "Rol"
#: admin.py:
183
#: admin.py:
212
msgid "Export selected memberships"
msgstr "Exporteer de geselecteerde lidmaatschappen"
#: apps.py:
7
#: apps.py:
9
msgid "Active members"
msgstr "Actieve leden"
#: models.py:5
6
#: models.py:5
7
msgid "Committee name"
msgstr "Commissienaam"
#: models.py:6
2
#: models.py:6
3
msgid "Description"
msgstr "Beschrijving"
#: models.py:6
6
#: models.py:6
7
msgid "Image"
msgstr "Afbeelding"
#: models.py:
79
#: models.py:
80
msgid "permissions"
msgstr "permissies"
#: models.py:8
4
#: models.py:8
5
msgid "founded in"
msgstr "opgericht in"
#: models.py:9
0
#: models.py:9
1
msgid "existed until"
msgstr "bestond tot"
#: models.py:9
8
#: models.py:9
9
msgid "contact email address"
msgstr "contact e-mailadres"
#: models.py:10
5
#: models.py:10
6
msgid "contact mailing list"
msgstr "contact mailinglijst"
#: models.py:11
2
#: models.py:11
3
msgid "Wiki namespace"
msgstr "Wiki namespace"
...
...
@@ -130,81 +142,81 @@ msgstr "commissie"
msgid "committees"
msgstr "commissies"
#: models.py:16
4
#: models.py:16
8
msgid "Is this a board"
msgstr "Is dit een bestuur"
#: models.py:17
1
#: models.py:17
5
msgid "Access the board wiki"
msgstr "Toegang tot bestuurswiki"
#: models.py:
197
models.py:
198
#: models.py:
200
models.py:
201
msgid "A board already exists for those years"
msgstr "Er bestaat al een bestuur voor die jaren"
#: models.py:21
6
models.py:36
0
#: models.py:2
2
1 models.py:36
4
msgid "Member"
msgstr "Lid"
#: models.py:22
7
#: models.py:2
3
2
msgid "The date this member joined the committee in this role"
msgstr "De datum waarop deze persoon lid werd deze commissie in deze rol"
#: models.py:23
3
#: models.py:23
8
msgid "A member of this committee until this time (can't be in the future)."
msgstr ""
"De datum waarop deze persoon de commissie verliet (kan niet in de toekomst "
"liggen)"
#: models.py:24
1
#: models.py:24
6
msgid "There can only be one chair at a time!"
msgstr "Er kan maar één voorzitter tegelijkertijd zijn!"
#: models.py:2
47
#: models.py:2
52
msgid "role"
msgstr "rol"
#: models.py:2
48
#: models.py:2
53
msgid "The role of this member"
msgstr "De rol van dit lid binnen de commissie"
#: models.py:2
76
#: models.py:2
80
msgid "End date can't be before start date"
msgstr "De einddatum kan niet voor de startdatum liggen"
#: models.py:2
79
#: models.py:2
83
msgid "End date can't be in the future"
msgstr "De einddatum kan niet in de toekomst liggen"
#: models.py:28
4
#: models.py:28
8
msgid "Start date can't be before committee start date"
msgstr "De begindatum kan niet voor de begindatum van de commissie liggen"
#: models.py:2
8
9
#: models.py:29
3
msgid "Start date can't be after committee end date"
msgstr "De begindatum kan niet na de einddatum van de commissie liggen"
#: models.py:29
4
#: models.py:29
8
msgid "End date cannot be set for boards"
msgstr "Voor besturen kan geen einddatum worden opgegeven"
#: models.py:3
17
#: models.py:3
20
msgid "There already is a chair for this time period"
msgstr "Er is al een voorzitter voor deze periode"
#: models.py:33
4
#: models.py:33
7
msgid "This member is already in the committee for this period"
msgstr "Deze persoon is al lid van deze commissie in de aangegeven periode"
#: models.py:35
2
#: models.py:35
5
msgid "committee membership"
msgstr "commissielidmaatschap"
#: models.py:35
3
#: models.py:35
6
msgid "committee memberships"
msgstr "commissielidmaatschappen"
#: models.py:36
5
#: models.py:36
9
#, python-brace-format
msgid "{name} mentor in {year}"
msgstr "{name} mentor in {year}"
...
...
@@ -299,7 +311,7 @@ msgstr "Commissielid sinds: ?"
msgid "Committee member since: %(since)s"
msgstr "Commissielid sinds: %(since)s"
#: templates/activemembers/committee_detail.html:
68
#: templates/activemembers/committee_detail.html:
71
msgid "This committee doesn't have any members?"
msgstr "Deze commissie heeft geen leden?"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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