Files
myep-team/templates/administrative/system/staffing_rule/index.html.twig
T

91 lines
3.9 KiB
Twig

{% extends 'administrative/layout.html.twig' %}
{% block title %}Einstellungen - Besetzungsmatrix{% endblock %}
{% macro yes_no(value) %}{{ value ? 'ja' : '-' }}{% endmacro %}
{% block content %}
<div class="flex items-center justify-between pb-8">
<h1 class="text-2xl font-bold">
Besetzungsmatrix
</h1>
<a href="{{ path('app_administrative_system_staffing_rule_preview') }}" class="btn">
Vorschau
</a>
</div>
<p class="pb-4">
Für jeden künftigen Termin eines aktiven Produkts legt der Einsatz-Generator die Einsätze als
Entwurf an. Termine, die schon einmal Einsätze hatten, bleiben unberührt. Die Busbegleitung
ergibt sich aus den Zustiegen des Termins: Hat er welche, ist der erste vorausgewählt.
</p>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>Produkt</th>
<th>Reiseleitungen</th>
<th>Ski Anfänger:innen</th>
<th>Ski Fortgeschrittene</th>
<th>Split</th>
<th>Guiding</th>
<th>aktiv</th>
<th></th>
</tr>
</thead>
<tbody>
{% for rule in rules %}
<tr>
<td>{{ rule.productCode }}</td>
<td>{{ rule.guides }}</td>
<td>{{ _self.yes_no(rule.skiBeginner) }}</td>
<td>{{ _self.yes_no(rule.skiAdvanced) }}</td>
<td>
{%- set split = [] -%}
{%- if rule.splitBeginner %}{% set split = split|merge(['Anfänger:innen']) %}{% endif -%}
{%- if rule.splitAdvanced %}{% set split = split|merge(['Fortgeschrittene']) %}{% endif -%}
{{- split is empty ? _self.yes_no(false) : split|join(', ') -}}
</td>
<td>{{ _self.yes_no(rule.guiding) }}</td>
<td>{{ _self.yes_no(rule.enabled) }}</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
title="Zeile löschen"
hx-get="{{ path('app_administrative_system_staffing_rule_delete', { 'uuid': rule.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
</button>
<button type="button"
title="Zeile bearbeiten"
hx-get="{{ path('app_administrative_system_staffing_rule_edit', { 'uuid': rule.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('edit') }}
</button>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<button type="button"
class="btn"
title="Zeile hinzufügen"
hx-get="{{ path('app_administrative_system_staffing_rule_create') }}"
hx-target="body"
hx-swap="beforeend">
Zeile hinzufügen
</button>
{% endblock %}