91 lines
3.2 KiB
HTML
91 lines
3.2 KiB
HTML
{% extends "chrono/manager_agenda_view.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block bodyargs %}class="dayview"{% endblock %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
<a>{{ day|date:"SHORT_DATE_FORMAT" }}</a>
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2>
|
|
<a href="{{ view.get_previous_day_url }}">←</a>
|
|
<span class="date-title">{{ view.date|date:"l j F Y" }}</span>
|
|
{% with selected_day=view.date|date:"j" selected_month=view.date|date:"n" selected_year=view.date|date:"Y" %}
|
|
<div class="date-picker" style="display: none">
|
|
<select name="day">{% for day in view.get_days %}<option value="{{ day }}" {% if selected_day == day %}selected{% endif %}>{{day}}</option>{% endfor %}</select>
|
|
<select name="month">{% for month, month_label in view.get_months %}<option value="{{ month }}" {% if selected_month == month %}selected{% endif %}>{{ month_label }}</option>{% endfor %}</select>
|
|
<select name="year">{% for year in view.get_years %}<option value="{{ year }}" {% if selected_year == year %}selected{% endif %}>{{year}}</option>{% endfor %}</select>
|
|
<button>{% trans 'Set Date' %}</button>
|
|
</div>
|
|
{% endwith %}
|
|
<a href="{{ view.get_next_day_url }}">→</a>
|
|
</h2>
|
|
<span class="actions">
|
|
{% if user_can_manage %}
|
|
<a href="{% url 'chrono-manager-agenda-settings' pk=agenda.id %}">{% trans 'Settings' %}</a>
|
|
{% endif %}
|
|
<a href="" onclick="window.print()">{% trans 'Print' %}</a>
|
|
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"n" %}">{% trans 'Month view' %}</a>
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{% for period, desk_infos in view.get_timetable_infos %}
|
|
|
|
{% if forloop.first %}
|
|
<table class="agenda-table hourspan-{{ hour_span }} desks-{{ desk_infos|length }} ">
|
|
<thead>
|
|
<tr>
|
|
<td></td>
|
|
{% for desk_info in desk_infos %}
|
|
<th>{{ desk_info.desk.label }}</th>
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% endif %}
|
|
|
|
<tr>
|
|
<th class="hour">{{ period|date:"TIME_FORMAT" }}</th>
|
|
{% for desk_info in desk_infos %}
|
|
<td>
|
|
|
|
{% if forloop.parentloop.first %}
|
|
{# opening hours on the first row #}
|
|
{% for slot in desk_info.opening_hours %}
|
|
<div class="opening-hours"
|
|
style="height: {{ slot.css_height }}%; top: {{ slot.css_top }}%;"
|
|
>{{slot.begin}} {{slot.end}}</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% for booking in desk_info.bookings %}
|
|
<div class="booking"
|
|
style="height: {{ booking.css_height }}%; min-height: {{ booking.css_height }}%; top: {{ booking.css_top }}%;"
|
|
><span class="start-time">{{booking.event.start_datetime|date:"TIME_FORMAT"}}</span>
|
|
<a {% if booking.backoffice_url %}href="{{booking.backoffice_url}}"{% endif %}
|
|
>{% if booking.label or booking.user_name %}
|
|
{{booking.label}}{% if booking.label and booking.user_name %} - {% endif %} {{booking.user_name}}
|
|
{% else %}{% trans "booked" %}{% endif %}</a>
|
|
</div>
|
|
{% endfor %}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
|
|
{% if forloop.last %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
|
|
{% empty %}
|
|
<div class="closed-for-the-day">
|
|
<p>{% trans "No opening hours this day." %}</p>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|