{% extends 'admin/locations/index.twig' %} {% import 'macros/base.twig' as m %} {% import 'macros/form.twig' as f %} {% block title %}{{ location ? __('location.edit.title') : __('location.create.title') }}{% endblock %} {% block row_content %}
{{ csrf() }} {{ f.hidden('id', location ? location.id : '') }}
{{ f.input('name', __('general.name'), { 'required': true, 'required_icon': true, 'value': f.formData('location', location ? location.name : ''), }) }} {{ f.input('dect', __('general.dect'), { 'value': f.formData('dect', location ? location.dect : ''), }) }} {{ f.input('map_url', __('location.map_url'), { 'type': 'url', 'value': f.formData('map_url', location ? location.map_url : ''), 'info': __('location.map_url.info'), }) }} {{ f.textarea('description', __('general.description'), { 'value': f.formData('description', location ? location.description : ''), 'rows': 5, 'info': __('form.markdown') }) }}

{{ __('location.required_angels') }}

{% for types in angel_types.chunk(3) %}
{% 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 %}
{{ f.number(name, angel_type.name, { 'value': f.formData(name, needed ? needed.count : 0), 'min': 0, 'step': 1, }) }}
{% endfor %}
{% endfor %}
{{ f.submit(__('form.save'), {'icon_left': 'save'}) }} {% if location %} {{ f.submit(__('form.delete'), {'name': 'delete', 'btn_type': 'danger', 'icon_left': 'trash'}) }} {% endif %}
{% endblock %}