2021-03-04 15:16:31 +01:00
|
|
|
{% extends "chrono/manager_event_detail.html" %}
|
2022-04-17 10:59:59 +02:00
|
|
|
{% load static i18n %}
|
2021-03-04 15:16:31 +01:00
|
|
|
|
|
|
|
{% block breadcrumb %}
|
|
|
|
{{ block.super }}
|
|
|
|
<a href="{% url 'chrono-manager-event-check' pk=agenda.pk event_pk=object.pk %}">{% trans "Check" %}</a>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block appbar_actions %}{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="section">
|
|
|
|
<h3>
|
2021-08-16 15:59:01 +02:00
|
|
|
{% blocktrans with booked_places=object.booked_places places=object.places %}Bookings ({{ booked_places }}/{{ places }}){% endblocktrans %}
|
2021-03-04 15:16:31 +01:00
|
|
|
</h3>
|
|
|
|
<div>
|
2021-04-22 11:39:42 +02:00
|
|
|
<form class="check-bookings-filters">
|
|
|
|
{{ filterset.form.as_p }}
|
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$('form.check-bookings-filters input').on('change',
|
|
|
|
function() {
|
|
|
|
$(this).parents('form').submit();
|
2021-04-08 15:50:24 +02:00
|
|
|
});
|
2022-09-21 17:28:29 +02:00
|
|
|
});
|
2021-04-08 15:50:24 +02:00
|
|
|
</script>
|
|
|
|
</form>
|
|
|
|
<table class="main check-bookings">
|
2022-09-21 17:28:29 +02:00
|
|
|
<tbody>
|
2022-01-27 16:31:02 +01:00
|
|
|
{% if results and not event.checked %}
|
2021-03-05 08:38:19 +01:00
|
|
|
<tr class="booking">
|
2022-01-27 16:31:02 +01:00
|
|
|
<td class="booking-actions">
|
2022-02-14 11:26:03 +01:00
|
|
|
<form method="post" action="{% url 'chrono-manager-event-checked' pk=agenda.pk event_pk=object.pk %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<button class="submit-button">{% trans "Mark the event as checked" %}</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
2022-09-21 17:28:29 +02:00
|
|
|
</tr>
|
2022-02-14 11:26:03 +01:00
|
|
|
{% endif %}
|
2022-01-27 16:31:02 +01:00
|
|
|
{% if booked_without_status %}
|
|
|
|
{% if not event.checked or not agenda.disable_check_update %}
|
2021-04-08 15:50:24 +02:00
|
|
|
<tr class="booking all-bookings">
|
2022-01-27 16:31:02 +01:00
|
|
|
<td colspan="2"><b>{% trans "Mark all bookings without status:" %}</b></td>
|
|
|
|
<td class="booking-actions">
|
2022-04-14 16:24:34 +02:00
|
|
|
<form method="post" action="{% url 'chrono-manager-event-presence' pk=agenda.pk event_pk=object.pk %}" id="all-bookings-presence">
|
2021-04-08 15:50:24 +02:00
|
|
|
{% csrf_token %}
|
|
|
|
<button class="submit-button">{% trans "Presence" %}</button>
|
2022-04-14 16:24:34 +02:00
|
|
|
{% if presence_form.check_type.field.choices.1 %}{{ presence_form.check_type }}{% endif %}
|
2022-09-21 17:28:29 +02:00
|
|
|
<script>
|
2022-04-14 16:24:34 +02:00
|
|
|
$(function() {
|
|
|
|
$('#all-bookings-presence select').on('change',
|
|
|
|
function() {
|
|
|
|
$('#all-bookings-presence').submit();
|
2022-09-21 17:28:29 +02:00
|
|
|
});
|
|
|
|
});
|
2022-04-14 16:24:34 +02:00
|
|
|
</script>
|
2022-09-21 17:28:29 +02:00
|
|
|
</form>
|
2021-04-08 15:50:24 +02:00
|
|
|
<form method="post" action="{% url 'chrono-manager-event-absence' pk=agenda.pk event_pk=object.pk %}" id="all-bookings-absence">
|
|
|
|
{% csrf_token %}
|
|
|
|
<button class="submit-button">{% trans "Absence" %}</button>
|
2022-04-12 15:31:42 +02:00
|
|
|
{% if absence_form.check_type.field.choices.1 %}{{ absence_form.check_type }}{% endif %}
|
2022-09-21 17:28:29 +02:00
|
|
|
<script>
|
2021-04-08 15:50:24 +02:00
|
|
|
$(function() {
|
|
|
|
$('#all-bookings-absence select').on('change',
|
|
|
|
function() {
|
|
|
|
$('#all-bookings-absence').submit();
|
2022-09-21 17:28:29 +02:00
|
|
|
});
|
|
|
|
});
|
2022-04-14 16:24:34 +02:00
|
|
|
</script>
|
2022-09-21 17:28:29 +02:00
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-06-29 16:43:26 +02:00
|
|
|
{% endif %}
|
2022-01-27 16:31:02 +01:00
|
|
|
{% endif %}
|
|
|
|
{% for result in results %}
|
2023-03-16 14:55:06 +01:00
|
|
|
<tr class="booking {% if agenda.booking_extra_user_block_template %}untoggled{% endif %}">
|
2023-03-13 15:50:29 +01:00
|
|
|
{% include "chrono/manager_event_check_booking_fragment.html" with booking=result %}
|
2021-03-05 08:38:19 +01:00
|
|
|
</tr>
|
2021-03-04 15:16:31 +01:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2022-09-21 17:28:29 +02:00
|
|
|
</div>
|
2021-03-04 15:16:31 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if object.waiting_list_places %}
|
|
|
|
<div class="section">
|
|
|
|
<h3>
|
2021-08-16 15:59:01 +02:00
|
|
|
{% blocktrans with booked_places=object.booked_waiting_list_places places=object.waiting_list_places %}Waiting List ({{ booked_places }}/{{ places }}){% endblocktrans %}
|
2021-03-04 15:16:31 +01:00
|
|
|
</h3>
|
2021-04-19 15:47:38 +02:00
|
|
|
<div>
|
|
|
|
<table class="main check-bookings">
|
|
|
|
<tbody>
|
|
|
|
{% for booking in waiting %}
|
2023-03-16 14:55:06 +01:00
|
|
|
<tr class="booking {% if agenda.booking_extra_user_block_template %}untoggled{% endif %}">
|
|
|
|
<td class="booking-username waiting" {% if agenda.booking_extra_user_block_template %}data-extra-user-block-url="{% url 'chrono-manager-booking-extra-user-block' pk=agenda.pk booking_pk=booking.pk %}{% endif %}">
|
|
|
|
{% if agenda.booking_extra_user_block_template %}<span class="togglable"></span>{% endif %}
|
|
|
|
{{ booking.get_user_block }}{% if booking.places_count > 1 %} ({{ booking.places_count }} {% trans "places" %}){% endif %}
|
|
|
|
</td>
|
2022-02-14 11:26:03 +01:00
|
|
|
<td>{% if booking.cancellation_datetime %}({% trans "Cancelled" %}){% endif %}</td>
|
|
|
|
</tr>
|
2021-04-19 15:47:38 +02:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2021-03-04 15:16:31 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-03-16 14:55:06 +01:00
|
|
|
|
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$(document).on('click', '.togglable', function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var $toggle = $(this);
|
|
|
|
var $tr = $toggle.parents('tr');
|
|
|
|
var $td = $toggle.parents('td.booking-username');
|
|
|
|
if ($('.extra-user-block', $td).length == 0) {
|
|
|
|
$.ajax({
|
|
|
|
url: $td.data('extra-user-block-url')
|
|
|
|
}).done(function(html) {
|
|
|
|
$tr.toggleClass('toggled').toggleClass('untoggled');
|
|
|
|
$td.append('<div class="extra-user-block">' + html + '</div>');
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if ($tr.hasClass('toggled')) {
|
|
|
|
$tr.toggleClass('toggled').toggleClass('untoggled');
|
|
|
|
$('.extra-user-block', $td).hide();
|
|
|
|
} else {
|
|
|
|
$tr.toggleClass('toggled').toggleClass('untoggled');
|
|
|
|
$('.extra-user-block', $td).show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2021-03-04 15:16:31 +01:00
|
|
|
{% endblock %}
|