50 lines
2.2 KiB
HTML
50 lines
2.2 KiB
HTML
{% load i18n %}
|
|
{% for week_days in view.get_timetable_infos %}
|
|
|
|
{% if forloop.first %}
|
|
<table class="agenda-table {{ kind }}-view {% if kind == 'week' %}hourspan-{{ hour_span }}{% endif %} single-desk">
|
|
<tbody>
|
|
{% endif %}
|
|
<tr>
|
|
{% for day in week_days.days %}
|
|
{% if forloop.first %}
|
|
<th class="weeknum">
|
|
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">
|
|
{% blocktrans with weeknum=day.date|date:"W" %}Week{{ weeknum }}{% endblocktrans %}
|
|
</a>
|
|
</th>
|
|
{% endif %}
|
|
<th class="weekday {% if day.today %}today{% endif %}">{% if kind == 'month' and not day.other_month or kind == 'week' %}<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=day.date|date:"Y" month=day.date|date:"m" day=day.date|date:"d" %}">{{ day.date|date:"l j" }}{% if kind == 'week' %}<br />{{ day.date|date:"F" }}{% endif %}</a>{% endif %}</th>
|
|
{% endfor %}
|
|
</tr>
|
|
{% for hour in week_days.periods %}
|
|
<tr class="{% cycle 'odd' 'even' %}">
|
|
<th class="hour">{{ hour|date:"TIME_FORMAT" }}</th>
|
|
{% for day in week_days.days %}
|
|
<td class="{% if kind == 'month' and day.other_month %}other-month{% endif %} {% if day.today %}today{% endif %}">
|
|
{% if forloop.parentloop.first %}
|
|
{% for slot in day.infos.booked_slots %}
|
|
<div class="booking" style="height:{{ slot.css_height|stringformat:".1f" }}%;min-height:{{ slot.css_height|stringformat:".1f" }}%;top:{{ slot.css_top|stringformat:".1f" }}%">
|
|
<span class="start-time">{{ slot.booking.event.start_datetime|date:"TIME_FORMAT" }}</span>
|
|
<a {% if slot.booking.get_backoffice_url %}href="{{ slot.booking.get_backoffice_url }}"{% endif %}>{{ slot.booking.get_user_block }}</a>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
{% if forloop.last %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
{% empty %}
|
|
<div class="closed-for-the-day">
|
|
{% if kind == 'month' %}
|
|
<p>{% trans "No bookings this month." %}</p>
|
|
{% else %}
|
|
<p>{% trans "No bookings this week." %}</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|