2023-02-26 11:27:41 +01:00
|
|
|
{% extends 'admin/rooms/index.twig' %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
|
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
|
|
|
|
{% block title %}{{ room ? __('room.edit.title') : __('room.create.title') }}{% endblock %}
|
|
|
|
|
|
|
|
{% block row_content %}
|
|
|
|
<form method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
{{ f.hidden('id', room ? room.id : '') }}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.input('name', __('room.name'), {
|
|
|
|
'required': true,
|
|
|
|
'required_icon': true,
|
|
|
|
'value': f.formData('room', room ? room.name : ''),
|
|
|
|
}) }}
|
2023-02-26 11:27:41 +01:00
|
|
|
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.input('dect', __('room.dect'), {
|
|
|
|
'value': f.formData('dect', room ? room.dect : ''),
|
|
|
|
}) }}
|
|
|
|
{{ f.input('map_url', __('room.map_url'), {
|
|
|
|
'type': 'url',
|
|
|
|
'value': f.formData('map_url', room ? room.map_url : ''),
|
|
|
|
'info': __('room.map_url.info'),
|
|
|
|
}) }}
|
2023-02-26 11:27:41 +01:00
|
|
|
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.textarea('description', __('room.description'), {
|
|
|
|
'value': f.formData('description', room ? room.description : ''),
|
|
|
|
'rows': 5,
|
|
|
|
'info': __('form.markdown')
|
|
|
|
}) }}
|
2023-02-26 11:27:41 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<h4>{{ __('room.required_angels') }}</h4>
|
|
|
|
{% for types in angel_types.chunk(3) %}
|
|
|
|
<div class="row">
|
|
|
|
{% for angel_type in types %}
|
|
|
|
{% set needed = needed_angel_types ? needed_angel_types.where('angel_type_id', angel_type.id).first() : null %}
|
|
|
|
{% set name = 'angel_type_' ~ angel_type.id %}
|
|
|
|
<div class="col-md-4">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.number(name, angel_type.name, {
|
|
|
|
'value': f.formData(name, needed ? needed.count : 0),
|
|
|
|
'min': 0,
|
|
|
|
'step': 1,
|
|
|
|
}) }}
|
2023-02-26 11:27:41 +01:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="btn-group">
|
|
|
|
{{ f.submit(__('form.save'), {'icon_left': 'save'}) }}
|
|
|
|
{% if room %}
|
|
|
|
{{ f.submit(__('form.delete'), {'name': 'delete', 'btn_type': 'danger', 'icon_left': 'trash'}) }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|