brass/web/templates/calendar_tr_availability.html

46 lines
1.9 KiB
HTML

<tr>
<td>{{ u.name }}</td>
<td>
{{ u.function|show_tree|safe }}
</td>
<td>
{{ availability.start|fmt_datetime(HourMinute) }} Uhr bis
{{ availability.end|fmt_datetime(DayMonthYearHourMinute) }} Uhr
</td>
<td>
{{- availability.comment.as_deref().unwrap_or_default() -}}
</td>
{%- if user.role == Role::AreaManager || user.role == Role::Admin %}
<td>{% if availability.cross_areal %}ja{% else %}nein{% endif %}</td>
{% endif -%}
<td>
{% if availability.user_id == user.id || user.role == Role::Admin || user.role == Role::AreaManager %}
<div class="buttons is-right">
<a class="button is-primary is-light" href="/availability/edit/{{ availability.id }}"
title="Verfügbarkeit bearbeiten">
<svg class="icon">
<use href="/static/feather-sprite.svg#edit" />
</svg>
</a>
<button class="button is-danger is-light" hx-delete="/availability/delete/{{ availability.id }}"
hx-target="closest tr" hx-swap="delete" hx-trigger="confirmed"
title="Verfügbarkeit löschen">
<svg class="icon">
<use href="/static/feather-sprite.svg#x-circle" />
</svg>
</button>
{% if user.role == Role::Admin || (user.role == Role::AreaManager && user.area_id == u.area_id) %}
<button class="button is-link is-light" hx-swap="outerHTML" hx-target="closest tr"
hx-put="/availability/{{ availability.id }}/make{% if availability.cross_areal %}Non{% endif %}CrossAreal"
title="{% if availability.cross_areal %}nur im Hauptbereich{% else %}Bereichsübergreifend{% endif %} verfügbar machen">
<svg class="icon">
<use
href="/static/feather-sprite.svg#{% if availability.cross_areal %}home{% else %}globe{% endif %}" />
</svg>
</button>
{% endif %}
</div>
{% endif %}
</td>
</tr>