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
b28cb05d
Unverified
Commit
b28cb05d
authored
Jan 24, 2017
by
Joost Rijneveld
Browse files
Use years in board urls rather than primary keys
parent
1a4a89ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
website/activemembers/locale/nl/LC_MESSAGES/django.mo
View file @
b28cb05d
No preview for this file type
website/activemembers/locale/nl/LC_MESSAGES/django.po
View file @
b28cb05d
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-
1
4 1
6
:3
0
+0100\n"
"PO-Revision-Date: 2017-01-
1
4 1
6
:3
1
+0100\n"
"POT-Creation-Date: 2017-01-
2
4
2
1:3
6
+0100\n"
"PO-Revision-Date: 2017-01-
2
4
2
1:3
6
+0100\n"
"Last-Translator: Joost Rijneveld <joost@joostrijneveld.nl>\n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -18,117 +18,121 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8.11\n"
#: models.py:
4
3
#: models.py:
5
3
msgid "Committee name"
msgstr "Commissienaam"
#: models.py:
4
9
#: models.py:
5
9
msgid "Description"
msgstr "Beschrijving"
#: models.py:
5
3
#: models.py:
6
3
msgid "Image"
msgstr "Afbeelding"
#: models.py:
6
6
#: models.py:
7
6
msgid "permissions"
msgstr "permissies"
#: models.py:
7
1
#: models.py:
8
1
msgid "founded in"
msgstr "opgericht in"
#: models.py:
7
7
#: models.py:
8
7
msgid "existed until"
msgstr "bestond tot"
#: models.py:
8
4
#: models.py:
9
4
msgid "contact email address"
msgstr "contact e-mailadres"
#: models.py:
8
7
#: models.py:
9
7
msgid "Wiki namespace"
msgstr "Wiki namespace"
#: models.py:
9
9
#: models.py:
10
9
msgid "committee"
msgstr "commissie"
#: models.py:1
0
0 templates/activemembers/committee_index.html:6
#: models.py:1
1
0 templates/activemembers/committee_index.html:6
msgid "committees"
msgstr "commissies"
#: models.py:11
7
#: models.py:1
3
1
msgid "Is this a board"
msgstr "Is dit een bestuur"
#: models.py:142 models.py:257
#: models.py:149 models.py:150
msgid "A board already exists for those years"
msgstr "Er bestaat al een bestuur voor die jaren"
#: models.py:167 models.py:296
msgid "Member"
msgstr "Lid"
#: models.py:1
48
#: models.py:1
73
msgid "Committee"
msgstr "Commissie"
#: models.py:1
52
#: models.py:1
77
msgid "Committee member since"
msgstr "Commissielid sinds"
#: models.py:1
53
#: models.py:1
78
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:1
5
8
#: models.py:18
3
msgid "Committee member until"
msgstr "Commissielid tot"
#: models.py:1
59
#: models.py:1
84
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:1
66
#: models.py:1
91
msgid "Chair of the committee"
msgstr "Voorzitter van de commissie"
#: models.py:1
67
#: models.py:1
92
msgid "There can only be one chair at a time!"
msgstr "Er kan maar één voorzitter tegelijkertijd zijn!"
#: models.py:1
73
#: models.py:1
98
msgid "role"
msgstr "rol"
#: models.py:1
74
#: models.py:1
99
msgid "The role of this member"
msgstr "De rol van dit lid binnen de commissie"
#: models.py:
189
#: models.py:
225
msgid "End date can't be before start date"
msgstr "De einddatum kan niet voor de startdatum liggen"
#: models.py:
192
#: models.py:
229
msgid "End date cannot be set for boards"
msgstr "Voor besturen kan geen einddatum worden opgegeven"
#: models.py:2
13
#: models.py:2
52
msgid "There already is a chair for this time period"
msgstr "Er is al een voorzitter voor deze periode"
#: models.py:2
29
#: models.py:2
68
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:2
49
#: models.py:2
88
msgid "committee membership"
msgstr "commissielidmaatschap"
#: models.py:2
50
#: models.py:2
89
msgid "committee memberships"
msgstr "commissielidmaatschappen"
#: models.py:
262
#: models.py:
301
#, python-brace-format
msgid "{name} mentor in {year}"
msgstr "{name} mentor in {year}"
...
...
website/activemembers/models.py
View file @
b28cb05d
...
...
@@ -136,7 +136,18 @@ class Board(Committee):
ordering
=
[
'-since'
]
def
get_absolute_url
(
self
):
return
reverse
(
'activemembers:board'
,
args
=
[
str
(
self
.
pk
)])
return
reverse
(
'activemembers:board'
,
args
=
[
'{}-{}'
.
format
(
self
.
since
.
year
,
self
.
until
.
year
)])
def
validate_unique
(
self
,
*
args
,
**
kwargs
):
""" Check uniqueness"""
super
().
validate_unique
(
*
args
,
**
kwargs
)
for
board
in
Board
.
objects
.
filter
(
since__year
=
self
.
since
.
year
,
until__year
=
self
.
until
.
year
):
if
board
is
not
self
:
raise
ValidationError
({
'since'
:
_
(
'A board already exists for those years'
),
'until'
:
_
(
'A board already exists for those years'
)})
class
ActiveMembershipManager
(
models
.
Manager
):
...
...
website/activemembers/urls.py
View file @
b28cb05d
...
...
@@ -13,6 +13,6 @@ urlpatterns = [
url
(
r
'committees/$'
,
views
.
committee_index
,
name
=
'committees'
),
url
(
r
'^committees/(?P<id>\d+)/$'
,
views
.
committee_detail
,
name
=
'committee'
),
url
(
r
'^boards/$'
,
views
.
board_index
,
name
=
'boards'
),
url
(
r
'^board
s
/(?P<
id>\d+)?
$'
,
views
.
board_detail
,
name
=
'board'
),
url
(
r
'^board/(?P<
year>\d{4}-\d{4})
$'
,
views
.
board_detail
,
name
=
'board'
),
url
(
r
'^board$'
,
views
.
current_board
,
name
=
'current-board'
),
]
website/activemembers/views.py
View file @
b28cb05d
...
...
@@ -44,9 +44,10 @@ def board_index(request):
{
'boards'
:
boards
})
def
board_detail
(
request
,
id
):
def
board_detail
(
request
,
year
):
"""View the details of a board"""
board
=
get_object_or_404
(
Board
,
pk
=
id
)
since
,
until
=
year
.
split
(
'-'
)
board
=
get_object_or_404
(
Board
,
since__year
=
since
,
until__year
=
until
)
members
=
[]
memberships
=
(
CommitteeMembership
.
objects
...
...
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