33 lines
1.3 KiB
HTML
33 lines
1.3 KiB
HTML
{% load i18n chrono %}
|
|
|
|
{% with slots=form.get_slots %}
|
|
{% with events_num=slots.events|length %}
|
|
<table class="main timesheet">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "First name" %}</th>
|
|
<th>{% trans "Last name" %}</th>
|
|
{% for k in slots.extra_data %}<th>{{ k }}</th>{% endfor %}
|
|
{% if events_num > 1 %}<th>{% trans "Activity" %}</th>{% endif %}
|
|
{% for date in slots.dates %}<th class="date">{{ date|date:"D d/m" }}</th>{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for user in slots.users %}{% for event in user.events %}
|
|
<tr>
|
|
{% if forloop.first %}
|
|
<td {% if events_num > 1 %}rowspan="{{ events_num }}"{% endif %}>{{ user.user_first_name }}</td>
|
|
<td {% if events_num > 1 %}rowspan="{{ events_num }}"{% endif %}>{{ user.user_last_name }}</td>
|
|
{% for k in slots.extra_data %}<td {% if events_num > 1 %}rowspan="{{ events_num }}"{% endif %}>{{ user.extra_data|get:k }}</td>{% endfor %}
|
|
{% endif %}
|
|
{% if events_num > 1 %}<td>{{ event.event }}</td>{% endif %}
|
|
{% for date in slots.dates %}
|
|
{% with booked=event.dates|get:date %}<td class="date">{% if booked is True %}☐{% elif booked is None %}-{% endif %}</td>{% endwith %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endwith %}
|
|
{% endwith %}
|