149 lines
5.9 KiB
HTML
149 lines
5.9 KiB
HTML
{% extends "chrono/manager_home.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block appbar %}
|
|
<h2>{{ object.label }}
|
|
<span class="identifier">[{% trans "identifier:" %} {{object.slug}}]</span></h2>
|
|
</h2>
|
|
{% 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 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 %}
|
|
{% endblock %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
{% if agenda %}
|
|
<a href="{% url 'chrono-manager-agenda-view' pk=agenda.id %}">{{agenda.label}}</a>
|
|
{% elif object %}
|
|
<a href="{% url 'chrono-manager-agenda-view' pk=object.id %}">{{object.label}}</a>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{% if object.kind == "events" %}
|
|
{% if object.event_set.count %}
|
|
<div>
|
|
<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>
|
|
</div>
|
|
{% 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 %}
|
|
{% endif %}
|
|
|
|
{% if object.kind == "meetings" %}
|
|
|
|
<h3>{% trans 'Meeting Types' %}</h3>
|
|
{% if object.meetingtype_set.count %}
|
|
<div>
|
|
<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="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>
|
|
</div>
|
|
{% 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 %}
|
|
|
|
<h3>{% trans 'Time Periods' %}</h3>
|
|
{% if object.desk_set.count %}
|
|
<div class="timeperiods">
|
|
{% for desk in object.desk_set.all %}
|
|
<div class="timeperiod">
|
|
{% if object.desk_set.count > 1 %}
|
|
<h4>
|
|
<a href="{% if user_can_manage %}{% url 'chrono-manager-desk-edit' pk=desk.pk %}{% else %}#{% endif %}">
|
|
{{ desk.label }}</a>
|
|
</h4>
|
|
{% endif %}
|
|
{% url 'chrono-manager-agenda-add-time-period' agenda_pk=object.pk pk=desk.pk as add_time_period_url %}
|
|
{% if desk.timeperiod_set.count %}
|
|
<ul class="objects-list single-links">
|
|
{% for time_period in desk.timeperiod_set.all %}
|
|
<li><a 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>
|
|
</li>
|
|
{% endfor %}
|
|
<a rel="popup" href="{{add_time_period_url}}">{% trans 'Add' %}</a>
|
|
</ul>
|
|
{% else %}
|
|
<div>
|
|
{% trans "This desk doesn't have any time period yet." %} <a rel="popup" href="{{add_time_period_url}}">{% trans "New Time Period" %}</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div>
|
|
{% 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 %}
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|