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
08bccd98
Verified
Commit
08bccd98
authored
Jul 05, 2017
by
Sébastiaan Versteeg
Browse files
Add option to have contact email address as string next to mailing list
parent
2d34b6fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
website/activemembers/admin.py
View file @
08bccd98
...
@@ -36,7 +36,8 @@ class CommitteeAdmin(TranslatedModelAdmin):
...
@@ -36,7 +36,8 @@ class CommitteeAdmin(TranslatedModelAdmin):
filter_horizontal
=
(
'permissions'
,)
filter_horizontal
=
(
'permissions'
,)
fields
=
(
'name'
,
'description'
,
'photo'
,
'permissions'
,
'since'
,
fields
=
(
'name'
,
'description'
,
'photo'
,
'permissions'
,
'since'
,
'until'
,
'contact_mailinglist'
,
'wiki_namespace'
,
'active'
)
'until'
,
'contact_mailinglist'
,
'contact_email'
,
'wiki_namespace'
,
'active'
)
def
get_queryset
(
self
,
request
):
def
get_queryset
(
self
,
request
):
qs
=
super
().
get_queryset
(
request
)
qs
=
super
().
get_queryset
(
request
)
...
@@ -49,8 +50,8 @@ class BoardAdmin(TranslatedModelAdmin):
...
@@ -49,8 +50,8 @@ class BoardAdmin(TranslatedModelAdmin):
exclude
=
(
'is_board'
,)
exclude
=
(
'is_board'
,)
filter_horizontal
=
(
'permissions'
,)
filter_horizontal
=
(
'permissions'
,)
fields
=
(
'name'
,
'photo'
,
'permissions'
,
fields
=
(
'name'
,
'photo'
,
'permissions'
,
'contact_mailinglist'
,
'since'
,
'until'
,)
'contact_email'
,
'since'
,
'until'
,)
@
admin
.
register
(
models
.
CommitteeMembership
)
@
admin
.
register
(
models
.
CommitteeMembership
)
...
...
website/activemembers/locale/nl/LC_MESSAGES/django.mo
View file @
08bccd98
No preview for this file type
website/activemembers/locale/nl/LC_MESSAGES/django.po
View file @
08bccd98
...
@@ -7,170 +7,185 @@ msgid ""
...
@@ -7,170 +7,185 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: \n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-0
3-13 21:12
+0
1
00\n"
"POT-Creation-Date: 2017-0
7-05 19:09
+0
2
00\n"
"PO-Revision-Date: 2017-0
1-30 18:54
+0
1
00\n"
"PO-Revision-Date: 2017-0
8-17 11:41
+0
2
00\n"
"Last-Translator:
Joost Rijneveld <joost@joostrijneveld.nl
>\n"
"Last-Translator:
Sébastiaan Versteeg <se_bastiaan@outlook.com
>\n"
"Language-Team: \n"
"Language-Team: \n"
"Language: nl\n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"MIME-Version: 1.0\n"
"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
1.8.11
\n"
"X-Generator: Poedit
2.0.3
\n"
#: models.py:5
3
#: models.py:5
5
msgid "Committee name"
msgid "Committee name"
msgstr "Commissienaam"
msgstr "Commissienaam"
#: models.py:
59
#: models.py:
61
msgid "Description"
msgid "Description"
msgstr "Beschrijving"
msgstr "Beschrijving"
#: models.py:6
3
#: models.py:6
5
msgid "Image"
msgid "Image"
msgstr "Afbeelding"
msgstr "Afbeelding"
#: models.py:7
6
#: models.py:7
8
msgid "permissions"
msgid "permissions"
msgstr "permissies"
msgstr "permissies"
#: models.py:8
1
#: models.py:8
3
msgid "founded in"
msgid "founded in"
msgstr "opgericht in"
msgstr "opgericht in"
#: models.py:8
7
#: models.py:8
9
msgid "existed until"
msgid "existed until"
msgstr "bestond tot"
msgstr "bestond tot"
#: models.py:9
4
#: models.py:9
7
msgid "contact email address"
msgid "contact email address"
msgstr "contact e-mailadres"
msgstr "contact e-mailadres"
#: models.py:97
#: models.py:104
msgid "contact mailing list"
msgstr "contact mailinglijst"
#: models.py:110
msgid "Wiki namespace"
msgid "Wiki namespace"
msgstr "Wiki namespace"
msgstr "Wiki namespace"
#: models.py:109
#: models.py:121 models.py:124
msgid "Please use either the mailing list or email address option."
msgstr "Selecteer een mailinglijst óf vul een e-mailadres in."
#: models.py:135
msgid "committee"
msgid "committee"
msgstr "commissie"
msgstr "commissie"
#: models.py:1
10
templates/activemembers/committee_index.html:
6
#: models.py:1
36
templates/activemembers/committee_index.html:
7
msgid "committees"
msgid "committees"
msgstr "commissies"
msgstr "commissies"
#: models.py:1
31
#: models.py:1
57
msgid "Is this a board"
msgid "Is this a board"
msgstr "Is dit een bestuur"
msgstr "Is dit een bestuur"
#: models.py:149 models.py:150
#: models.py:164
msgid "Access the board wiki"
msgstr ""
#: models.py:190 models.py:191
msgid "A board already exists for those years"
msgid "A board already exists for those years"
msgstr "Er bestaat al een bestuur voor die jaren"
msgstr "Er bestaat al een bestuur voor die jaren"
#: models.py:
167
models.py:
299
#: models.py:
209
models.py:
342
msgid "Member"
msgid "Member"
msgstr "Lid"
msgstr "Lid"
#: models.py:
173
#: models.py:
215
msgid "Committee"
msgid "Committee"
msgstr "Commissie"
msgstr "Commissie"
#: models.py:
177
#: models.py:
219
msgid "Committee member since"
msgid "Committee member since"
msgstr "Commissielid sinds"
msgstr "Commissielid sinds"
#: models.py:
178
#: models.py:
220
msgid "The date this member joined the committee in this role"
msgid "The date this member joined the committee in this role"
msgstr "De datum waarop deze persoon lid werd deze commissie in deze rol"
msgstr "De datum waarop deze persoon lid werd deze commissie in deze rol"
#: models.py:
183
#: models.py:
225
msgid "Committee member until"
msgid "Committee member until"
msgstr "Commissielid tot"
msgstr "Commissielid tot"
#: models.py:
184
#: models.py:
226
msgid "A member of this committee until this time (can't be in the future)."
msgid "A member of this committee until this time (can't be in the future)."
msgstr ""
msgstr ""
"De datum waarop deze persoon de commissie verliet (kan niet in de toekomst "
"De datum waarop deze persoon de commissie verliet (kan niet in de toekomst "
"liggen)"
"liggen)"
#: models.py:
191
#: models.py:
233
msgid "Chair of the committee"
msgid "Chair of the committee"
msgstr "Voorzitter van de commissie"
msgstr "Voorzitter van de commissie"
#: models.py:
192
#: models.py:
234
msgid "There can only be one chair at a time!"
msgid "There can only be one chair at a time!"
msgstr "Er kan maar één voorzitter tegelijkertijd zijn!"
msgstr "Er kan maar één voorzitter tegelijkertijd zijn!"
#: models.py:
198
#: models.py:
240
msgid "role"
msgid "role"
msgstr "rol"
msgstr "rol"
#: models.py:
199
#: models.py:
241
msgid "The role of this member"
msgid "The role of this member"
msgstr "De rol van dit lid binnen de commissie"
msgstr "De rol van dit lid binnen de commissie"
#: models.py:2
25
#: models.py:2
67
msgid "End date can't be before start date"
msgid "End date can't be before start date"
msgstr "De einddatum kan niet voor de startdatum liggen"
msgstr "De einddatum kan niet voor de startdatum liggen"
#: models.py:2
28
#: models.py:2
70
msgid "End date can't be in the future"
msgid "End date can't be in the future"
msgstr "De einddatum kan niet in de toekomst liggen"
msgstr "De einddatum kan niet in de toekomst liggen"
#: models.py:2
32
#: models.py:2
74
msgid "End date cannot be set for boards"
msgid "End date cannot be set for boards"
msgstr "Voor besturen kan geen einddatum worden opgegeven"
msgstr "Voor besturen kan geen einddatum worden opgegeven"
#: models.py:2
55
#: models.py:2
98
msgid "There already is a chair for this time period"
msgid "There already is a chair for this time period"
msgstr "Er is al een voorzitter voor deze periode"
msgstr "Er is al een voorzitter voor deze periode"
#: models.py:
271
#: models.py:
314
msgid "This member is already in the committee for this period"
msgid "This member is already in the committee for this period"
msgstr "Deze persoon is al lid van deze commissie in de aangegeven periode"
msgstr "Deze persoon is al lid van deze commissie in de aangegeven periode"
#: models.py:
291
#: models.py:
334
msgid "committee membership"
msgid "committee membership"
msgstr "commissielidmaatschap"
msgstr "commissielidmaatschap"
#: models.py:
292
#: models.py:
335
msgid "committee memberships"
msgid "committee memberships"
msgstr "commissielidmaatschappen"
msgstr "commissielidmaatschappen"
#: models.py:3
0
4
#: models.py:34
7
#, python-brace-format
#, python-brace-format
msgid "{name} mentor in {year}"
msgid "{name} mentor in {year}"
msgstr "{name} mentor in {year}"
msgstr "{name} mentor in {year}"
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_detail.html:8
#: templates/activemembers/board_detail.html:5
#: templates/activemembers/board_index.html:45
#: templates/activemembers/board_detail.html:9
#: templates/activemembers/board_index.html:50
#: templates/activemembers/board_index.html:46
#: templates/activemembers/board_index.html:51
msgid "Board"
msgid "Board"
msgstr "Bestuur"
msgstr "Bestuur"
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_detail.html:5
#: templates/activemembers/board_index.html:3
#: templates/activemembers/board_index.html:3
#: templates/activemembers/board_index.html:4
msgid "Boards"
msgid "Boards"
msgstr "Besturen"
msgstr "Besturen"
#: templates/activemembers/board_detail.html:2
6
#: templates/activemembers/board_detail.html:2
7
msgid "Board members"
msgid "Board members"
msgstr "Bestuursleden"
msgstr "Bestuursleden"
#: templates/activemembers/board_detail.html:4
2
#: templates/activemembers/board_detail.html:4
3
#: templates/activemembers/committee_detail.html:4
4
#: templates/activemembers/committee_detail.html:4
5
msgid "Chair"
msgid "Chair"
msgstr "Voorzitter"
msgstr "Voorzitter"
#: templates/activemembers/board_detail.html:
59
#: templates/activemembers/board_detail.html:
60
msgid "This board doesn't have any members?"
msgid "This board doesn't have any members?"
msgstr "Dit bestuur heeft geen leden?"
msgstr "Dit bestuur heeft geen leden?"
#: templates/activemembers/board_index.html:
6
#: templates/activemembers/board_index.html:
7
msgid "The board"
msgid "The board"
msgstr "Het bestuur"
msgstr "Het bestuur"
#: templates/activemembers/board_index.html:
9
#: templates/activemembers/board_index.html:
10
msgid ""
msgid ""
"Thalia's board makes sure all operations during the academic year are taken "
"Thalia's board makes sure all operations during the academic year are taken "
"care of, in front or behind the scenes. If you have any questions then you "
"care of, in front or behind the scenes. If you have any questions then you "
...
@@ -183,48 +198,50 @@ msgstr ""
...
@@ -183,48 +198,50 @@ msgstr ""
"schermen. Bij vragen en opmerkingen kun je ze altijd persoonlijk aanspreken "
"schermen. Bij vragen en opmerkingen kun je ze altijd persoonlijk aanspreken "
"of <a href=\"mailto:info@thalia.nu\">mailen</a>."
"of <a href=\"mailto:info@thalia.nu\">mailen</a>."
#: templates/activemembers/board_index.html:2
7
#: templates/activemembers/board_index.html:2
8
msgid "Old boards"
msgid "Old boards"
msgstr "Oude besturen"
msgstr "Oude besturen"
#: templates/activemembers/board_index.html:3
7
#: templates/activemembers/board_index.html:3
8
#: templates/activemembers/committee_detail.html:1
8
#: templates/activemembers/committee_detail.html:1
9
#: templates/activemembers/committee_detail.html:2
0
#: templates/activemembers/committee_detail.html:2
1
#, python-format
#, python-format
msgid "Photo of %(name)s"
msgid "Photo of %(name)s"
msgstr "Foto van %(name)s"
msgstr "Foto van %(name)s"
#: templates/activemembers/board_index.html:5
7
#: templates/activemembers/board_index.html:5
8
msgid "There are no boards!"
msgid "There are no boards!"
msgstr "Er zijn geen besturen!"
msgstr "Er zijn geen besturen!"
#: templates/activemembers/committee_detail.html:3
#: templates/activemembers/committee_detail.html:3
#: templates/activemembers/committee_detail.html:4
#: templates/activemembers/committee_index.html:3
#: templates/activemembers/committee_index.html:3
#: templates/activemembers/committee_index.html:4
msgid "Committees"
msgid "Committees"
msgstr "Commissies"
msgstr "Commissies"
#: templates/activemembers/committee_detail.html:2
4
#: templates/activemembers/committee_detail.html:2
5
#, python-format
#, python-format
msgid "About the %(name)s"
msgid "About the %(name)s"
msgstr "Over de %(name)s"
msgstr "Over de %(name)s"
#: templates/activemembers/committee_detail.html:2
8
#: templates/activemembers/committee_detail.html:2
9
msgid "Committee members"
msgid "Committee members"
msgstr "Commissieleden"
msgstr "Commissieleden"
#: templates/activemembers/committee_detail.html:5
3
#: templates/activemembers/committee_detail.html:5
4
msgid "Committee member since: ?"
msgid "Committee member since: ?"
msgstr "Commissielid sinds: ?"
msgstr "Commissielid sinds: ?"
#: templates/activemembers/committee_detail.html:5
5
#: templates/activemembers/committee_detail.html:5
6
#, python-format
#, python-format
msgid "Committee member since: %(since)s"
msgid "Committee member since: %(since)s"
msgstr "Commissielid sinds: %(since)s"
msgstr "Commissielid sinds: %(since)s"
#: templates/activemembers/committee_detail.html:6
7
#: templates/activemembers/committee_detail.html:6
8
msgid "This committee doesn't have any members?"
msgid "This committee doesn't have any members?"
msgstr "Deze commissie heeft geen leden?"
msgstr "Deze commissie heeft geen leden?"
#: templates/activemembers/committee_index.html:
39
#: templates/activemembers/committee_index.html:
40
msgid "There are no committees!"
msgid "There are no committees!"
msgstr "Er zijn geen commissies!"
msgstr "Er zijn geen commissies!"
website/activemembers/migrations/0020_
auto_20170519_2225
.py
→
website/activemembers/migrations/0020_
committee_contact_mailinglist
.py
View file @
08bccd98
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-0
5-19 20:25
# Generated by Django 1.11 on 2017-0
7-05 16:59
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
...
@@ -14,13 +14,9 @@ class Migration(migrations.Migration):
...
@@ -14,13 +14,9 @@ class Migration(migrations.Migration):
]
]
operations
=
[
operations
=
[
migrations
.
RemoveField
(
model_name
=
'committee'
,
name
=
'contact_email'
,
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'committee'
,
model_name
=
'committee'
,
name
=
'contact_mailinglist'
,
name
=
'contact_mailinglist'
,
field
=
models
.
OneToOneField
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'mailinglists.MailingList'
,
verbose_name
=
'contact
e
mail
address
'
),
field
=
models
.
OneToOneField
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'mailinglists.MailingList'
,
verbose_name
=
'contact mail
ing list
'
),
),
),
]
]
website/activemembers/migrations/0021_auto_20170705_1902.py
0 → 100644
View file @
08bccd98
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-05 17:02
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'activemembers'
,
'0020_committee_contact_mailinglist'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'committee'
,
name
=
'contact_email'
,
field
=
models
.
EmailField
(
blank
=
True
,
max_length
=
254
,
null
=
True
,
verbose_name
=
'contact email address'
),
),
]
website/activemembers/models.py
View file @
08bccd98
...
@@ -17,6 +17,7 @@ logger = logging.getLogger(__name__)
...
@@ -17,6 +17,7 @@ logger = logging.getLogger(__name__)
class
UnfilteredSortedManager
(
models
.
Manager
):
class
UnfilteredSortedManager
(
models
.
Manager
):
"""Returns committees and boards, sorted by name"""
"""Returns committees and boards, sorted by name"""
def
get_queryset
(
self
):
def
get_queryset
(
self
):
return
(
super
().
get_queryset
()
return
(
super
().
get_queryset
()
.
order_by
(
localize_attr_name
(
'name'
)))
.
order_by
(
localize_attr_name
(
'name'
)))
...
@@ -24,6 +25,7 @@ class UnfilteredSortedManager(models.Manager):
...
@@ -24,6 +25,7 @@ class UnfilteredSortedManager(models.Manager):
class
CommitteeManager
(
models
.
Manager
):
class
CommitteeManager
(
models
.
Manager
):
"""Returns committees only"""
"""Returns committees only"""
def
get_queryset
(
self
):
def
get_queryset
(
self
):
return
(
super
().
get_queryset
()
return
(
super
().
get_queryset
()
.
exclude
(
board__is_board
=
True
)
.
exclude
(
board__is_board
=
True
)
...
@@ -32,6 +34,7 @@ class CommitteeManager(models.Manager):
...
@@ -32,6 +34,7 @@ class CommitteeManager(models.Manager):
class
ActiveCommitteeManager
(
models
.
Manager
):
class
ActiveCommitteeManager
(
models
.
Manager
):
"""Returns active committees only"""
"""Returns active committees only"""
def
get_queryset
(
self
):
def
get_queryset
(
self
):
return
(
super
().
get_queryset
()
return
(
super
().
get_queryset
()
.
exclude
(
board__is_board
=
True
)
.
exclude
(
board__is_board
=
True
)
...
@@ -90,9 +93,15 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
...
@@ -90,9 +93,15 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
active
=
models
.
BooleanField
(
default
=
False
)
active
=
models
.
BooleanField
(
default
=
False
)
contact_email
=
models
.
EmailField
(
_
(
'contact email address'
),
blank
=
True
,
null
=
True
,
)
contact_mailinglist
=
models
.
OneToOneField
(
contact_mailinglist
=
models
.
OneToOneField
(
'mailinglists.MailingList'
,
'mailinglists.MailingList'
,
verbose_name
=
_
(
'contact
e
mail
address
'
),
verbose_name
=
_
(
'contact mail
ing list
'
),
null
=
True
,
null
=
True
,
blank
=
True
,
blank
=
True
,
)
)
...
@@ -103,6 +112,21 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
...
@@ -103,6 +112,21 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
blank
=
True
,
blank
=
True
,
max_length
=
50
)
max_length
=
50
)
def
clean
(
self
):
"""Validation"""
if
((
self
.
contact_email
is
not
None
and
self
.
contact_mailinglist
is
not
None
)
or
(
self
.
contact_email
is
None
and
self
.
contact_mailinglist
is
None
)):
raise
ValidationError
({
'contact_email'
:
_
(
"Please use either the mailing list "
"or email address option."
),
'contact_mailinglist'
:
_
(
"Please use either the mailing list "
"or email address option."
)
})
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
name
return
self
.
name
...
@@ -119,8 +143,8 @@ class BoardManager(models.Manager):
...
@@ -119,8 +143,8 @@ class BoardManager(models.Manager):
def
get_queryset
(
self
):
def
get_queryset
(
self
):
# sorting by descending order by default makes more sense for boards
# sorting by descending order by default makes more sense for boards
return
(
super
().
get_queryset
()
return
(
super
().
get_queryset
()
.
filter
(
is_board
=
True
)
.
filter
(
is_board
=
True
)
.
order_by
(
localize_attr_name
(
'-name'
)))
.
order_by
(
localize_attr_name
(
'-name'
)))
class
Board
(
Committee
):
class
Board
(
Committee
):
...
@@ -160,10 +184,10 @@ class Board(Committee):
...
@@ -160,10 +184,10 @@ class Board(Committee):
continue
continue
if
((
board
.
until
is
None
and
(
if
((
board
.
until
is
None
and
(
self
.
until
is
None
or
self
.
until
>=
board
.
since
))
or
self
.
until
is
None
or
self
.
until
>=
board
.
since
))
or
(
self
.
until
is
None
and
self
.
since
<=
board
.
until
)
or
(
self
.
until
is
None
and
self
.
since
<=
board
.
until
)
or
(
self
.
until
and
board
.
until
and
(
self
.
until
and
board
.
until
and
self
.
since
<=
board
.
until
and
self
.
since
<=
board
.
until
and
self
.
until
>=
board
.
since
)):
self
.
until
>=
board
.
since
)):
raise
ValidationError
({
raise
ValidationError
({
'since'
:
_
(
'A board already exists for those years'
),
'since'
:
_
(
'A board already exists for those years'
),
'until'
:
_
(
'A board already exists for those years'
)})
'until'
:
_
(
'A board already exists for those years'
)})
...
@@ -171,6 +195,7 @@ class Board(Committee):
...
@@ -171,6 +195,7 @@ class Board(Committee):
class
ActiveMembershipManager
(
models
.
Manager
):
class
ActiveMembershipManager
(
models
.
Manager
):