Skip to content
GitLab
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
4220570b
Verified
Commit
4220570b
authored
May 28, 2019
by
Sébastiaan Versteeg
Browse files
Give event notification default url of event
parent
3ee093de
Changes
4
Hide whitespace changes
Inline
Side-by-side
website/events/admin_views.py
View file @
4220570b
import
csv
from
django.conf
import
settings
from
django.contrib
import
messages
from
django.contrib.admin
import
helpers
from
django.contrib.admin.views.decorators
import
staff_member_required
...
...
@@ -151,12 +152,14 @@ class EventMessage(FormView):
def
form_valid
(
self
,
form
):
values
=
form
.
cleaned_data
if
not
values
[
'url'
]:
values
[
'url'
]
=
settings
.
BASE_URL
+
self
.
event
.
get_absolute_url
()
message
=
Message
(
title_nl
=
values
[
'title_nl'
],
title_en
=
values
[
'title_en'
],
body_nl
=
values
[
'title_nl'
],
body_en
=
values
[
'title_en'
],
url
=
values
[
'url'
]
if
values
[
'url'
]
else
None
,
url
=
values
[
'url'
],
category
=
Category
.
objects
.
get
(
key
=
'event'
)
)
message
.
save
()
...
...
website/events/forms.py
View file @
4220570b
...
...
@@ -94,4 +94,8 @@ class EventMessageForm(forms.Form):
title_nl
=
forms
.
CharField
(
label
=
_
(
'Title (NL)'
),
max_length
=
150
)
body_en
=
forms
.
CharField
(
label
=
_
(
'Body (EN)'
),
widget
=
forms
.
Textarea
)
body_nl
=
forms
.
CharField
(
label
=
_
(
'Body (NL)'
),
widget
=
forms
.
Textarea
)
url
=
forms
.
CharField
(
max_length
=
256
,
required
=
False
)
url
=
forms
.
CharField
(
max_length
=
256
,
required
=
False
,
help_text
=
_
(
'The notification opens to the event by default.'
)
)
website/events/locale/nl/LC_MESSAGES/django.mo
View file @
4220570b
No preview for this file type
website/events/locale/nl/LC_MESSAGES/django.po
View file @
4220570b
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-2
7 21
:3
0
+0200\n"
"PO-Revision-Date: 2019-05-2
7 21
:31+0200\n"
"POT-Creation-Date: 2019-05-2
8 13
:3
1
+0200\n"
"PO-Revision-Date: 2019-05-2
8 13
:31+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -154,6 +154,10 @@ msgstr "Bericht (EN)"
msgid "Body (NL)"
msgstr "Bericht (NL)"
#: forms.py
msgid "The notification opens to the event by default."
msgstr "De notificatie opent standaard het evenement."
#: models.py
msgid "Drinks"
msgstr "Borrel"
...
...
Luko van der Maas
@lukomaas
mentioned in commit
2abbcb94
·
May 30, 2019
mentioned in commit
2abbcb94
mentioned in commit 2abbcb946f7e640fc42f37f68343dd7dfcb40aac
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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