Fix #406 -- Allow moving waiting list entries to the top or bottom

This commit is contained in:
Raphael Michel
2018-08-07 10:53:07 +02:00
parent 0100604798
commit 67897dfcc0
7 changed files with 124 additions and 23 deletions

View File

@@ -151,7 +151,15 @@
{% if request.event.has_subevents %}
<td>{{ e.subevent.name }} {{ e.subevent.get_date_range_display }}</td>
{% endif %}
<td>{{ e.created|date:"SHORT_DATETIME_FORMAT" }}</td>
<td>
{{ e.created|date:"SHORT_DATETIME_FORMAT" }}
{% if e.priority != 0 %}
<span class="label label-info" data-toggle="tooltip"
title="{% trans "This entry has a modified priority. The higher this number is, the earlier this person will be assigned a voucher." %}">
{% if e.priority > 0 %}+{% endif %}{{ e.priority }}
</span>
{% endif %}
</td>
<td>
{% if e.voucher %}
{% if e.voucher.redeemed >= e.voucher.max_usages %}
@@ -184,8 +192,22 @@
</td>
<td class="text-right">
{% if not e.voucher %}
<button name="move_top" value="{{ e.pk }}" class="btn btn-default btn-sm"
data-toggle="tooltip" title="{% trans "Move to the top of the list" %}">
<span class="fa fa-thumbs-up"></span>
</button>
<button name="move_end" value="{{ e.pk }}" class="btn btn-default btn-sm"
data-toggle="tooltip" title="{% trans "Move to the end of the list" %}">
<span class="fa fa-thumbs-down"></span>
</button>
<a href="{% url "control:event.orders.waitinglist.delete" organizer=request.event.organizer.slug event=request.event.slug entry=e.id %}?next={{ request.get_full_path|urlencode }}" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></a>
{% else %}
<button class="btn btn-default btn-sm disabled">
<span class="fa fa-thumbs-up"></span>
</button>
<button class="btn btn-default btn-sm disabled">
<span class="fa fa-thumbs-down"></span>
</button>
<span class="btn btn-danger btn-sm disabled"><i class="fa fa-trash"></i></span>
{% endif %}
</td>