Fix events table values in admin

parent 10d422fd
This diff was suppressed by a .gitattributes entry.
...@@ -301,7 +301,7 @@ msgstr "Niet betaald" ...@@ -301,7 +301,7 @@ msgstr "Niet betaald"
#: models.py:266 #: models.py:266
msgid "Paid with cash" msgid "Paid with cash"
msgstr "Contact betaald" msgstr "Contant betaald"
#: models.py:267 #: models.py:267
msgid "Paid with card" msgid "Paid with card"
...@@ -504,7 +504,7 @@ msgstr "niet betaald" ...@@ -504,7 +504,7 @@ msgstr "niet betaald"
#: templates/events/admin/registrations_table.html:13 #: templates/events/admin/registrations_table.html:13
msgid "paid cash" msgid "paid cash"
msgstr "contact betaald" msgstr "contant betaald"
#: templates/events/admin/registrations_table.html:14 #: templates/events/admin/registrations_table.html:14
msgid "paid card" msgid "paid card"
......
...@@ -161,11 +161,15 @@ class Event(models.Model, metaclass=ModelTranslateMeta): ...@@ -161,11 +161,15 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
@property @property
def participants(self): def participants(self):
return self.registrations.order_by('date')[:self.max_participants] if self.max_participants is not None:
return self.registrations.order_by('date')[:self.max_participants]
return self.registrations.order_by('date')
@property @property
def queue(self): def queue(self):
return self.registrations.order_by('date')[self.max_participants:] if self.max_participants is not None:
return self.registrations.order_by('date')[self.max_participants:]
return []
@property @property
def cancellations(self): def cancellations(self):
......
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
<div class="module"> <div class="module">
{% with event.registrationinformationfield_set.all as fields %} {% with event.registrationinformationfield_set.all as fields %}
<h2>{% trans "registrations"|capfirst %}</h2> <h2>{% trans "registrations"|capfirst %}</h2>
{% include 'events/admin/registrations_table.html' with registrations=event.registrations %} {% include 'events/admin/registrations_table.html' with registrations=event.participants %}
<br> <br>
{% if waiting %} {% if event.queue.count > 0 %}
<h2>{% trans "waiting"|capfirst %}</h2> <h2>{% trans "waiting"|capfirst %}</h2>
{% trans "queued" as queued %} {% trans "queued" as queued %}
{% include 'events/admin/registrations_table.html' with registrations=event.queue verb=queued addlink=False %} {% include 'events/admin/registrations_table.html' with registrations=event.queue verb=queued addlink=False %}
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
{% endif %} {% endif %}
<dt>{% trans "number of registrations"|capfirst %}</dt> <dt>{% trans "number of registrations"|capfirst %}</dt>
<dd> <dd>
{% blocktrans count counter=registrations|length trimmed %} {% blocktrans count counter=event.registrations|length trimmed %}
{{ counter }} registration {{ counter }} registration
{% plural %} {% plural %}
{{ counter }} registrations {{ counter }} registrations
......
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