70 lines
3.8 KiB
HTML
70 lines
3.8 KiB
HTML
{% load i18n %}
|
|
|
|
{% if event %}
|
|
<h4>{% blocktrans with event_date=event.start_datetime %}Timesheet - {{ event }} - {{ event_date }}{% endblocktrans %}</h4>
|
|
{% else %}
|
|
<h4>{% blocktrans with start=form.cleaned_data.date_start end=form.cleaned_data.date_end %}Timesheet from {{ start }} to {{ end }}{% endblocktrans %}</h4>
|
|
{% endif %}
|
|
|
|
|
|
{% with slots=form.get_slots %}
|
|
{% with events_num=slots.events|length %}
|
|
{% for dates in slots.dates %}
|
|
{% for grouper in slots.users %}
|
|
{% if form.cleaned_data.group_by %}<h5>{{ form.cleaned_data.group_by }}: {{ grouper.grouper }}</h5>{% endif %}
|
|
<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 and form.cleaned_data.activity_display != 'col' %}<th class="activity">{% trans "Activity" %}</th>{% endif %}
|
|
{% for date, events in dates %}
|
|
{% if form.cleaned_data.activity_display == 'col' %}
|
|
{% for event in events %}
|
|
<th class="date-event" data-id="{{ date|date:"d-m" }}:{{ event.slug }}">{% blocktrans with date=date|date:"d/m" %}{{ event }} of {{ date }}{% endblocktrans %}</th>
|
|
{% endfor %}
|
|
{% else %}
|
|
<th class="date" data-id="{{ date|date:"d-m" }}">{{ date|date:"D d/m" }}</th>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% if form.cleaned_data.activity_display == 'col' %}
|
|
{% for user in grouper.users %}
|
|
<tr>
|
|
<td>{{ user.user_first_name }}</td>
|
|
<td>{{ user.user_last_name }}</td>
|
|
{% for k in slots.extra_data %}<td>{{ user.extra_data|get:k }}</td>{% endfor %}
|
|
{% for date, events in dates %}
|
|
{% for event in events %}
|
|
{% for item in user.events %}{% if item.event == event %}{% with booked=item.dates|get:date %}<td class="date" data-id="{{ date|date:"d-m" }}:{{ item.event.slug }}:{{ user.user_id }}">{% if booked is True %}☐{% elif booked is None %}-{% endif %}</td>{% endwith %}{% endif %}{% endfor %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
{% for user in grouper.users %}{% for item 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 class="activity">{{ item.event }}</td>{% endif %}
|
|
{% for date, events in dates %}
|
|
{% with booked=item.dates|get:date %}<td class="date" data-id="{{ date|date:"d-m" }}:{{ item.event.slug }}:{{ user.user_id }}">{% if booked is True %}☐{% elif booked is None %}-{% endif %}</td>{% endwith %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}{% endfor %}
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
{% if form.cleaned_data.with_page_break %}{% if not forloop.last or not forloop.parentloop.last %}<div class="page_break"></div>{% endif %}{% endif %}
|
|
{% endfor %}
|
|
{% if not form.cleaned_data.with_page_break and not forloop.last %}<div class="page_break"></div>{% endif %}
|
|
{% endfor %}
|
|
{% endwith %}
|
|
{% endwith %}
|