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

76 lines
3.0 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) %}
2023-10-15 19:25:55 +02:00
{{ m.button(m.icon('chevron-left'), location ? url('/locations', {'action': 'view', 'location_id': location.id}) : url('/admin/locations'), 'secondary', 'sm') }}
{% 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>
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>
<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) }}
{{ f.delete(null, {'size': 'sm','confirm_title': location.name|e}) }}
2023-02-26 11:27:41 +01:00
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}