chrono/chrono/manager/templates/chrono/manager_agenda_settings.html

190 lines
8.4 KiB
HTML

{% extends "chrono/manager_agenda_view.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href=".">{% trans "Settings" %}</a>
{% endblock %}
{% block appbar %}
<h2>{% trans "Settings" %}
<span class="identifier">[{% trans "identifier:" %} {{object.slug}}]</span>
</h2>
<span class="actions">
{% if user.is_staff %}
<a rel="popup" href="{% url 'chrono-manager-agenda-delete' pk=object.id %}">{% trans 'Delete' %}</a>
{% endif %}
{% if user_can_manage %}
<a download href="{% url 'chrono-manager-agenda-export' pk=object.id %}">{% trans 'Export' %}</a>
<a rel="popup" href="{% url 'chrono-manager-agenda-edit' pk=object.id %}">{% trans 'Options' %}</a>
{% if object.kind == "events" %}
<a rel="popup" href="{% url 'chrono-manager-agenda-import-events' pk=object.id %}">{% trans 'Import Events' %}</a>
<a rel="popup" href="{% url 'chrono-manager-agenda-add-event' pk=object.id %}">{% trans 'New Event' %}</a>
{% else %}
<a rel="popup" href="{% url 'chrono-manager-agenda-add-meeting-type' pk=object.id %}">{% trans 'New Meeting Type' %}</a>
<a rel="popup" href="{% url 'chrono-manager-agenda-add-desk' pk=object.id %}">{% trans 'New Desk' %}</a>
{% endif %}
{% endif %}
</span>
{% endblock %}
{% block content %}
{% if object.kind == "events" %}
<div class="section">
<h3>{% trans "Events" %}</h3>
<div>
{% if object.event_set.count %}
<ul class="objects-list single-links">
{% for event in object.event_set.all %}
<li class="{% if event.booked_places > event.places %}overbooking{% endif %}
{% if event.full %}full{% endif %}
{% if not event.in_bookable_period %}not-{% endif %}bookable"
{% if event.places %}
data-total="{{event.places}}" data-booked="{{event.booked_places}}"
{% elif event.waiting_list_places %}
data-total="{{event.waiting_list_places}}" data-booked="{{event.waiting_list}}"
{% endif %}
><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-event-edit' pk=event.id %}{% else %}#{% endif %}">
{% if event.label %}{{event.label}} / {% endif %}
{{ event.start_datetime }}
{% if event.full %}/ <span class="full">{% trans "full" %}</span>{% endif %}
(
{% if event.places %}
{% blocktrans with places=event.places booked_places=event.booked_places %}{{ places }} places, {{ booked_places }} booked places{% endblocktrans %}
{% endif %}
{% if event.places and event.waiting_list_places %} / {% endif %}
{% if event.waiting_list_places %}
{% blocktrans with places=event.waiting_list_places waiting_places=event.waiting_list %}
{{waiting_places}} on {{ places }} in waiting list
{% endblocktrans %}
{% endif %}
)
{% if not event.in_bookable_period %}
({% trans "out of bookable period" %})
{% endif %}
</a>
{% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-event-delete' pk=event.id %}">{% trans "remove" %}</a>{% endif %}
<span class="occupation-bar"></span>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This agenda doesn't have any event yet. Click on the "New Event" button in
the top right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% if object.kind == "meetings" %}
<div class="section">
<h3>{% trans 'Meeting Types' %}</h3>
<div>
{% if object.meetingtype_set.count %}
<ul class="objects-list single-links">
{% for meeting_type in object.meetingtype_set.all %}
<li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-meeting-type-edit' pk=meeting_type.id %}{% else %}#{% endif %}">
{{meeting_type.label}}
<span class="duration">({{meeting_type.duration}} {% trans "minutes" %})</span>
<span class="identifier">[{% trans "identifier:" %} {{meeting_type.slug}}]</span>
</a>
{% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-meeting-type-delete' pk=meeting_type.id %}">{% trans "remove" %}</a>{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This agenda doesn't have any meeting type yet. Click on the "New Meeting Type" button in
the top right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
<div class="section">
<h3>{% trans 'Time Periods' %}</h3>
<div>
{% if object.desk_set.count %}
<div class="timeperiods">
{% for desk in object.desk_set.all %}
<div class="timeperiod">
{% url 'chrono-manager-agenda-add-time-period' agenda_pk=object.pk pk=desk.pk as add_time_period_url %}
<ul class="objects-list single-links">
{% if forloop.counter != 1 or forloop.revcounter != 1 %}
<li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-desk-edit' pk=desk.id %}{% else %}#{% endif %}">
<strong>{{ desk.label }}</strong>
</a>
{% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-desk-delete' pk=desk.id %}">{% trans "remove" %}</a>{% endif %}
</li>
{% endif %}
{% for time_period in desk.timeperiod_set.all %}
<li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-time-period-edit' pk=time_period.id %}{% else %}#{% endif %}">
{{time_period.weekday_str}} / {{time_period.start_time}} → {{time_period.end_time}} </a>
{% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-delete' pk=time_period.id %}">{% trans "remove" %}</a>{% endif %}
</li>
{% endfor %}
{% if user_can_manage %}
<li><a class="add" rel="popup" href="{{add_time_period_url}}">{% trans 'Add a time period' %}</a></li>
{% endif %}
{% if desk.timeperiod_set.count %}
{% url 'chrono-manager-agenda-add-time-period-exception' agenda_pk=object.pk pk=desk.pk as add_time_period_exception_url %}
<li><a href="#"><strong>{% trans 'Exceptions' %}</strong></a><a class="link-action-icon upload" rel="popup" href="{% url 'chrono-manager-desk-add-import-time-period-exceptions' pk=desk.pk %}" title="{% trans 'Import exceptions from .ics' %}">{% trans 'upload' %}</a></li>
{% for exception in desk.get_exceptions_within_two_weeks %}
<li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-time-period-exception-edit' pk=exception.pk %}{% else %}#{% endif %}">
{{ exception }}
{% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-exception-delete' pk=exception.id %}">{% trans "remove" %}</a>{% endif %}
{% endfor %}
{% if not desk.are_all_exceptions_displayed %}
<li><a class="timeperiod-exception-all" rel="popup" data-selector="div.timeperiod" href="{% url 'chrono-manager-time-period-exception-list' pk=desk.id %}">({% trans 'see all exceptions' %})</a></li>
{% endif %}
<li><a class="add" rel="popup" href="{{add_time_period_exception_url}}">{% trans 'Add a time period exception' %}</a></li>
{% endif %}
</ul>
</div>
{% endfor %}
</div>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This agenda doesn't have any desk yet. Click on the "New Desk" button in
the top right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
{% endif %}
<div class="section">
<h3>{% trans "Permissions" %}</h3>
<div>
<ul>
<li>{% trans "Edit Role:" %} {% if agenda.edit_role %}{{ agenda.edit_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li>
<li>{% trans "View Role:" %} {% if agenda.view_role %}{{ agenda.view_role }}{% else %}<i>{% trans "undefined" %}</i>{% endif %}</li>
</ul>
</div>
</div>
<div class="section">
<h3>{% trans "Booking Delays" %}</h3>
<div>
<ul>
<li>{% trans "Minimal booking delay:" %} {{ agenda.minimal_booking_delay }} {% trans "days" %}</li>
<li>{% trans "Maximal booking delay:" %} {{ agenda.maximal_booking_delay }} {% trans "days" %}</li>
</ul>
</div>
</div>
{% endblock %}