42 lines
1.3 KiB
Twig
42 lines
1.3 KiB
Twig
{#
|
|
Boîte d'ajout réutilisable dans l'admin.
|
|
|
|
Usage type :
|
|
{% embed '@Kernel/partials/_admin_create_box.twig' with {
|
|
title: 'Ajouter un élément',
|
|
hint: 'Le contenu de la boîte est piloté par le module consommateur.',
|
|
form: { action: '/admin/items/create' }
|
|
} %}
|
|
{% block fields %}...{% endblock %}
|
|
{% block actions %}...{% endblock %}
|
|
{% endembed %}
|
|
#}
|
|
|
|
{% set form = form|default({}) %}
|
|
{% set extra = form.extra|default({}) %}
|
|
|
|
<div class="admin-create">
|
|
<h3 class="admin-create__title">{{ title }}</h3>
|
|
|
|
<form
|
|
{% if form.id is defined %}id="{{ form.id }}"{% endif %}
|
|
method="{{ form.method|default('post') }}"
|
|
{% if form.action is defined %}action="{{ form.action }}"{% endif %}
|
|
{% if form.enctype is defined %}enctype="{{ form.enctype }}"{% endif %}
|
|
class="admin-create__form{% if form.class is defined %} {{ form.class }}{% endif %}"
|
|
{% for name, value in extra %} {{ name }}="{{ value }}"{% endfor %}
|
|
>
|
|
{% include '@Kernel/partials/_csrf_fields.twig' %}
|
|
|
|
{% block fields %}{% endblock %}
|
|
|
|
<div class="admin-create__actions">
|
|
{% block actions %}{% endblock %}
|
|
</div>
|
|
</form>
|
|
|
|
{% if hint is defined and hint %}
|
|
<p class="admin-create__hint">{{ hint }}</p>
|
|
{% endif %}
|
|
</div>
|