Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thalia
concrexit
Commits
f2dd7e4e
Commit
f2dd7e4e
authored
Sep 28, 2016
by
Luuk Scholten
Committed by
Sébastiaan Versteeg
Oct 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add registration status
parent
572122b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
28 deletions
+55
-28
website/events/locale/nl/LC_MESSAGES/django.mo
website/events/locale/nl/LC_MESSAGES/django.mo
+0
-0
website/events/locale/nl/LC_MESSAGES/django.po
website/events/locale/nl/LC_MESSAGES/django.po
+27
-10
website/events/models.py
website/events/models.py
+16
-0
website/events/templates/events/event.html
website/events/templates/events/event.html
+12
-18
No files found.
website/events/locale/nl/LC_MESSAGES/django.mo
View file @
f2dd7e4e
No preview for this file type
website/events/locale/nl/LC_MESSAGES/django.po
View file @
f2dd7e4e
...
...
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-2
0
21:2
6
+0200\n"
"PO-Revision-Date: 2016-09-2
0
21:2
7
+0200\n"
"POT-Creation-Date: 2016-09-2
8
21:2
7
+0200\n"
"PO-Revision-Date: 2016-09-2
8
21:2
8
+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: nl\n"
...
...
@@ -189,11 +189,11 @@ msgstr "aanwezig"
msgid "paid"
msgstr "betaald"
#: models.py:23
7
models.py:2
38
#: models.py:2
5
3 models.py:2
54
msgid "Either specify a member or a name"
msgstr "Geef een lid of een naam op"
#: models.py:26
0
#: models.py:2
7
6
msgid "last changed"
msgstr "laatst aangepast"
...
...
@@ -292,11 +292,28 @@ msgstr[1] "%(counter)s aanmeldingen"
msgid "max"
msgstr "max"
#: templates/events/event.html:
60
#: templates/events/event.html:
59
msgid "registration status"
msgstr "aanmeldstatus"
#: templates/events/event.html:157
#: templates/events/event.html:62
msgid "You are registered"
msgstr "Je bent aangemeld"
#: templates/events/event.html:64
#, python-format
msgid "Waiting list position %(pos)s"
msgstr "Wachtlijst positie %(pos)s"
#: templates/events/event.html:68
msgid "Your registration is cancelled after the cancellation deadline"
msgstr "Je bent afgemeld na de afmelddeadline"
#: templates/events/event.html:70
msgid "Your registration is cancelled"
msgstr "Je bent afgemeld"
#: templates/events/event.html:155
msgid "You have to log in before you can register for this event."
msgstr "Je moet inloggen voordat je jezelf kunt aanmelden."
...
...
@@ -308,16 +325,16 @@ msgstr "jaarlaag"
msgid "Calendar"
msgstr "Agenda"
#: templates/events/index.html:4
4
templates/events/index.html:
46
#: templates/events/index.html:5
2
#: templates/events/index.html:4
9
templates/events/index.html:
51
#: templates/events/index.html:5
7
msgid "hide birthdays"
msgstr "Verberg verjaardagen"
#: templates/events/index.html:4
4
templates/events/index.html:
47
#: templates/events/index.html:4
9
templates/events/index.html:
52
msgid "show birthdays"
msgstr "Toon verjaardagen"
#: templates/events/index.html:6
4
#: templates/events/index.html:6
9
msgid "list"
msgstr "Lijst"
...
...
website/events/models.py
View file @
f2dd7e4e
...
...
@@ -233,6 +233,22 @@ class Registration(models.Model):
def
is_external
(
self
):
return
bool
(
self
.
name
)
def
is_late_cancellation
(
self
):
return
(
self
.
date_cancelled
and
self
.
date_cancelled
>
self
.
event
.
cancel_deadline
)
def
is_registered
(
self
):
return
self
.
date_cancelled
is
None
def
queue_position
(
self
):
if
self
.
event
.
max_participants
is
None
:
return
0
return
max
(
self
.
event
.
registration_set
.
filter
(
date_cancelled
=
None
,
id__lte
=
self
.
id
).
count
()
-
self
.
event
.
max_participants
,
0
)
def
clean
(
self
):
if
((
self
.
member
is
None
and
not
self
.
name
)
or
(
self
.
member
and
self
.
name
)):
...
...
website/events/templates/events/event.html
View file @
f2dd7e4e
...
...
@@ -54,28 +54,21 @@
{% endif %}
</td>
</tr>
<?php if ($registration !== null): ?>
{% if registration %}
<tr>
<th>
{% trans "registration status"|capfirst %}
</th>
<td>
<b>
TODO TODO TODO
</b>
{# TODO implement registration status #}
{#
<?php#}
{# /** @var RegistrationModel $registration */#}
{# if ($registration->isRegisteredExcludeCoolDown()) {#}
{# $queuePos = $activity->getQueuePosition($registration);#}
{# if ($queuePos === 0) {#}
{# echo "Aangemeld";#}
{# } else {#}
{# echo "Op wachtlijst positie " . $queuePos;#}
{# }#}
{# } else if($registration->isLateCancellation()) {#}
{# echo "Te laat afgemeld";#}
{# } else {#}
{# echo "Afgemeld";#}
{# }#}
{# ?>
#}
{% if registration.is_registered and registration.queue_position == 0 %}
{% trans "You are registered" %}
{% elif registration.is_registered and registration.queue_position > 0 %}
{% blocktrans with pos=registration.queue_position trimmed %}
Waiting list position {{ pos }}
{% endblocktrans %}
{% elif not registration.is_registered and registration.is_late_cancellation %}
{% trans "Your registration is cancelled after the cancellation deadline" %}
{% else %}
{% trans "Your registration is cancelled" %}
{% endif %}
</td>
</tr>
{% endif %}
...
...
@@ -121,6 +114,7 @@
{# }#}
{# ?>
#}
<tr>
<td></td>
<td>
</td>
<td>
...
...
Write
Preview
Markdown
is supported
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