85 lines
3.5 KiB
Twig
85 lines
3.5 KiB
Twig
{% extends 'layouts/app.twig' %}
|
|
{% import 'macros/base.twig' as m %}
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
{% block title %}{{ __('location.locations') }}{% endblock %}
|
|
|
|
{% 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'), {'size':'sm', 'title':__('general.back')}) }}
|
|
{% endif %}
|
|
|
|
{{ block('title') }}
|
|
|
|
{% if is_index|default(false) %}
|
|
{{ m.button(m.icon('plus-lg'), url('/admin/locations/edit')) }}
|
|
{% 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>
|
|
<th>{{ __('general.name') }}</th>
|
|
<th>{{ __('general.dect') }}</th>
|
|
<th>{{ __('location.map_url') }}</th>
|
|
<th>{{ __('general.shifts') }}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for location in locations %}
|
|
<tr>
|
|
<td>
|
|
{{ m.icon('pin-map-fill') }}
|
|
<a href="{{ url('/locations', {'action': 'view', 'location_id': location.id}) }}">
|
|
{{ location.name }}
|
|
</a>
|
|
</td>
|
|
|
|
<td>{{ m.iconBool(location.dect) }}</td>
|
|
|
|
<td>{{ m.iconBool(location.map_url) }}</td>
|
|
|
|
<td>{{ m.iconBool(location.shifts.count) }}</td>
|
|
|
|
<td>
|
|
<div class="d-flex ms-auto">
|
|
|
|
{{ m.button(m.icon('pencil'), url('/admin/locations/edit/' ~ location.id), {'size': 'sm', 'title': __('form.edit')}) }}
|
|
|
|
<form method="post" class="ps-1">
|
|
{{ csrf() }}
|
|
{{ f.hidden('id', location.id) }}
|
|
{{ f.delete(null, {
|
|
'size': 'sm',
|
|
'confirm_title': __('location.delete.title', [location.name|e]),
|
|
'confirm_button_text': __('form.delete'),
|
|
}) }}
|
|
</form>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|