engelsystem/resources/views/admin/locations/index.twig

85 lines
3.4 KiB
Twig
Raw Normal View History

2023-02-26 11:27:41 +01:00
{% extends 'layouts/app.twig' %}
{% import 'macros/base.twig' as m %}
{% import 'macros/form.twig' as f %}
2023-10-15 19:25:55 +02:00
{% block title %}{{ __('location.locations') }}{% endblock %}
2023-02-26 11:27:41 +01:00
{% block content %}
<div class="container">
<h1>
{% if not is_index|default(false) %}
{{ m.button(m.icon('chevron-left'), location
? url('/locations', {'action': 'view', 'location_id': location.id})
: url('/admin/locations'), 'secondary', 'sm', __('general.back')) }}
{% endif %}
2023-02-26 11:27:41 +01:00
{{ block('title') }}
{% if is_index|default(false) %}
2023-10-15 19:25:55 +02:00
{{ m.button(m.icon('plus-lg'), url('/admin/locations/edit'), 'secondary') }}
2023-02-26 11:27:41 +01:00
{% endif %}
</h1>
{% include 'layouts/parts/messages.twig' %}
<div class="row">
{% block row_content %}
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
2023-10-02 16:15:25 +02:00
<th>{{ __('general.name') }}</th>
<th>{{ __('general.dect') }}</th>
2023-10-15 19:25:55 +02:00
<th>{{ __('location.map_url') }}</th>
<th>{{ __('general.shifts') }}</th>
2023-02-26 11:27:41 +01:00
<th></th>
</tr>
</thead>
<tbody>
2023-10-15 19:25:55 +02:00
{% for location in locations %}
2023-02-26 11:27:41 +01:00
<tr>
<td>
{{ m.icon('pin-map-fill') }}
2023-10-15 19:25:55 +02:00
<a href="{{ url('/locations', {'action': 'view', 'location_id': location.id}) }}">
{{ location.name }}
2023-02-26 11:27:41 +01:00
</a>
</td>
2023-10-15 19:25:55 +02:00
<td>{{ m.iconBool(location.dect) }}</td>
2023-02-26 11:27:41 +01:00
2023-10-15 19:25:55 +02:00
<td>{{ m.iconBool(location.map_url) }}</td>
2023-02-26 11:27:41 +01:00
<td>{{ m.iconBool(location.shifts.count) }}</td>
2023-02-26 11:27:41 +01:00
<td>
<div class="d-flex ms-auto">
2023-11-13 16:56:52 +01:00
{{ m.button(m.icon('pencil'), url('/admin/locations/edit/' ~ location.id), null, 'sm', __('form.edit')) }}
2023-02-26 11:27:41 +01:00
<form method="post" class="ps-1">
{{ csrf() }}
2023-10-15 19:25:55 +02:00
{{ f.hidden('id', location.id) }}
2023-11-10 16:20:01 +01:00
{{ f.delete(null, {
'size': 'sm',
'confirm_title': __('location.delete.title', [location.name|e]),
'confirm_button_text': __('form.delete'),
}) }}
2023-02-26 11:27:41 +01:00
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}