Commit f2dd7e4e authored by Luuk Scholten's avatar Luuk Scholten Committed by Sébastiaan Versteeg

Add registration status

parent 572122b6
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-20 21:26+0200\n"
"PO-Revision-Date: 2016-09-20 21:27+0200\n"
"POT-Creation-Date: 2016-09-28 21:27+0200\n"
"PO-Revision-Date: 2016-09-28 21:28+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: nl\n"
......@@ -189,11 +189,11 @@ msgstr "aanwezig"
msgid "paid"
msgstr "betaald"
#: models.py:237 models.py:238
#: models.py:253 models.py:254
msgid "Either specify a member or a name"
msgstr "Geef een lid of een naam op"
#: models.py:260
#: models.py:276
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:44 templates/events/index.html:46
#: templates/events/index.html:52
#: templates/events/index.html:49 templates/events/index.html:51
#: templates/events/index.html:57
msgid "hide birthdays"
msgstr "Verberg verjaardagen"
#: templates/events/index.html:44 templates/events/index.html:47
#: templates/events/index.html:49 templates/events/index.html:52
msgid "show birthdays"
msgstr "Toon verjaardagen"
#: templates/events/index.html:64
#: templates/events/index.html:69
msgid "list"
msgstr "Lijst"
......
......@@ -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)):
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment