2021-05-12 12:04:03 +02:00
|
|
|
{% extends '@Core/admin/layout.html.twig' %}
|
|
|
|
|
2021-05-27 21:34:28 +02:00
|
|
|
{% set context = context ?? 'edit' %}
|
|
|
|
|
|
|
|
{% block title %}{{ configuration.pageTitle(context)|trans|build_string(entity) }} - {{ parent() }}{% endblock %}
|
2021-05-12 12:04:03 +02:00
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
{% block header %}
|
|
|
|
<div class="bg-light pl-5 pr-4 pt-5 pb-5">
|
|
|
|
<div class="crud-header">
|
|
|
|
{% block header_title %}
|
2021-05-27 21:34:28 +02:00
|
|
|
<h1 class="crud-header-title">{{ configuration.pageTitle(context)|trans|build_string(entity) }}</h1>
|
2021-05-12 12:04:03 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block header_actions %}
|
|
|
|
<div class="crud-header-actions">
|
|
|
|
<div class="btn-group">
|
2021-05-27 21:34:28 +02:00
|
|
|
{% if configuration.action(context, 'back', true) %}
|
2021-05-12 12:04:03 +02:00
|
|
|
<a href="{{ path(configuration.pageRoute('index')) }}" class="btn btn-light">
|
|
|
|
<span class="fa fa-list pr-1"></span>
|
2021-05-27 21:34:28 +02:00
|
|
|
{{ configuration.actionTitle(context, 'back', 'Back to the list')|trans }}
|
2021-05-12 12:04:03 +02:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2021-05-27 21:34:28 +02:00
|
|
|
{% if configuration.action(context, 'show', true) %}
|
2021-05-12 12:04:03 +02:00
|
|
|
<a href="{{ path(configuration.pageRoute('show'), {entity: entity.id}) }}" class="btn btn-secondary">
|
|
|
|
<span class="fa fa-eye pr-1"></span>
|
2021-05-27 21:34:28 +02:00
|
|
|
{{ configuration.actionTitle(context, 'show', 'Show')|trans|build_string(entity) }}
|
2021-05-12 12:04:03 +02:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<button type="submit" form="form-main" class="btn btn-primary">
|
|
|
|
<span class="fa fa-save pr-1"></span>
|
2021-05-27 21:34:28 +02:00
|
|
|
{{ configuration.actionTitle(context, 'save', 'Save')|trans|build_string(entity) }}
|
2021-05-12 12:04:03 +02:00
|
|
|
</button>
|
|
|
|
|
2021-05-17 16:44:01 +02:00
|
|
|
{% if header_actions_dropdown_menu is not defined %}
|
|
|
|
{% set header_actions_dropdown_menu = '' %}
|
|
|
|
{% endif %}
|
2021-05-12 12:04:03 +02:00
|
|
|
|
2021-05-27 21:34:28 +02:00
|
|
|
{% if configuration.action(context, 'delete', true) %}
|
2021-05-17 16:44:01 +02:00
|
|
|
{% set item %}
|
|
|
|
<button type="submit" form="form-delete" class="dropdown-item">
|
2021-05-27 21:34:28 +02:00
|
|
|
{{ configuration.actionTitle(context, 'delete', 'Delete')|trans|build_string(entity) }}
|
2021-05-17 16:44:01 +02:00
|
|
|
</button>
|
|
|
|
{% endset %}
|
2021-05-12 12:04:03 +02:00
|
|
|
|
2021-05-17 16:44:01 +02:00
|
|
|
{% set header_actions_dropdown_menu = header_actions_dropdown_menu ~ item %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% block header_actions_dropdown %}
|
|
|
|
{% set menu = '' %}
|
2021-05-12 12:04:03 +02:00
|
|
|
|
2021-05-17 16:44:01 +02:00
|
|
|
{% if header_actions_dropdown_menu %}
|
2021-05-12 12:04:03 +02:00
|
|
|
<button type="button" class="btn btn-white dropdown-toggle dropdown-toggle-hide-after" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
<span class="font-weight-bold">
|
|
|
|
⋅⋅⋅
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
|
2021-05-17 16:44:01 +02:00
|
|
|
<div class="dropdown-menu dropdown-menu-right">
|
|
|
|
{{ header_actions_dropdown_menu|raw }}
|
|
|
|
</div>
|
2021-05-12 12:04:03 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block form %}
|
|
|
|
<form action="{{ app.request.uri }}" method="post" id="form-main" enctype="multipart/form-data">
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane active">
|
|
|
|
<div class="tab-form">
|
2021-05-13 19:20:24 +02:00
|
|
|
{% include(configuration.view('form', '@Core/admin/crud/_form.html.twig')) with {form: form} %}
|
|
|
|
|
|
|
|
{{ form_rest(form) }}
|
2021-05-12 12:04:03 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|
|
|
|
|
2021-05-27 21:34:28 +02:00
|
|
|
{% if configuration.action(context, 'delete', true) %}
|
2021-05-12 12:04:03 +02:00
|
|
|
<form method="post" action="{{ path(configuration.pageRoute('delete'), {entity: entity.id}) }}" id="form-delete" data-form-confirm>
|
|
|
|
<input type="hidden" name="_method" value="DELETE">
|
|
|
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ entity.id) }}">
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|