2020-11-21 20:54:04 +01:00
|
|
|
{% extends 'admin/schedule/index.twig' %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
|
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
|
|
|
|
{% block title %}{{ schedule ? __('schedule.edit.title') : __('schedule.import.title') }}{% endblock %}
|
|
|
|
|
2023-12-06 19:03:12 +01:00
|
|
|
{% block content_title %}
|
2023-12-21 13:08:29 +01:00
|
|
|
{{ m.button(m.icon('chevron-left'), url('/admin/schedule'), 'secondary', 'sm', __('general.back')) }}
|
2023-12-06 19:03:12 +01:00
|
|
|
{{ block('title') }}
|
2023-11-03 15:02:54 +01:00
|
|
|
{% endblock %}
|
2020-11-21 20:54:04 +01:00
|
|
|
|
|
|
|
{% block row_content %}
|
|
|
|
{% if schedule and schedule.updated_at %}
|
|
|
|
<div class="col-md-12">
|
2023-11-23 14:30:46 +01:00
|
|
|
<p>{{ __('schedule.last_update', [schedule.updated_at.format(__('general.datetime'))]) }}</p>
|
2020-11-21 20:54:04 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
|
|
|
|
<div class="col-lg-12">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.input('name', __('schedule.name'), {
|
|
|
|
'required': true,
|
|
|
|
'value': schedule ? schedule.name : '',
|
|
|
|
}) }}
|
|
|
|
{{ f.input('url', __('schedule.url'), {
|
|
|
|
'type': 'url',
|
|
|
|
'required': true,
|
|
|
|
'value': schedule ? schedule.url : ''
|
|
|
|
}) }}
|
2020-11-21 20:54:04 +01:00
|
|
|
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.select('shift_type', __('schedule.shift-type'), shift_types|default([]), {
|
|
|
|
'selected': schedule ? schedule.shift_type : '',
|
|
|
|
}) }}
|
2020-11-21 20:54:04 +01:00
|
|
|
|
2023-12-20 18:08:50 +01:00
|
|
|
{{ f.checkbox('needed_from_shift_type', __('schedule.needed-from-shift-type'), {
|
|
|
|
'checked': schedule ? schedule.needed_from_shift_type : '',
|
|
|
|
}) }}
|
|
|
|
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.input('minutes_before', __('schedule.minutes-before'), {
|
|
|
|
'type': 'number',
|
|
|
|
'required': true,
|
|
|
|
'value': schedule ? schedule.minutes_before : 15
|
|
|
|
}) }}
|
|
|
|
{{ f.input('minutes_after', __('schedule.minutes-after'), {
|
|
|
|
'type': 'number',
|
|
|
|
'required': true,
|
|
|
|
'value': schedule ? schedule.minutes_after : 15
|
|
|
|
}) }}
|
2020-11-21 20:54:04 +01:00
|
|
|
|
2023-12-08 21:25:24 +01:00
|
|
|
{{ f.save(__('form.save')) }}
|
|
|
|
|
|
|
|
{% if schedule %}
|
|
|
|
{{ f.delete(__('form.delete'), {
|
|
|
|
'confirm_title': __('schedule.delete.title', [schedule.shifts|length])
|
|
|
|
}) }}
|
|
|
|
{% endif %}
|
2020-11-21 20:54:04 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|