2022-03-13 19:32:32 +01:00
|
|
|
{% extends '@Core/admin/layout.html.twig' %}
|
|
|
|
|
|
|
|
{% set context = context ?? 'edit' %}
|
|
|
|
|
2022-05-08 18:38:55 +02:00
|
|
|
{% block body_class %}has-form{% endblock %}
|
|
|
|
|
2022-03-13 19:32:32 +01:00
|
|
|
{% block title %}{{ configuration.pageTitle(context)|trans|build_string(entity) }} - {{ parent() }}{% endblock %}
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
{% block header %}
|
|
|
|
<div class="bg-light pl-5 pr-4 pt-5 pb-5">
|
|
|
|
<div class="crud-header">
|
|
|
|
{% block header_title %}
|
|
|
|
<h1 class="crud-header-title">{{ configuration.pageTitle(context)|trans|build_string(entity) }}</h1>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block header_actions %}
|
|
|
|
<div class="crud-header-actions">
|
|
|
|
<div class="btn-group">
|
|
|
|
{% block header_actions_before %}{% endblock %}
|
|
|
|
|
|
|
|
{% if configuration.action(context, 'back', true) %}
|
|
|
|
<a href="{{ path(configuration.pageRoute('index'), configuration.pageRouteParams('index')) }}" class="btn btn-light">
|
|
|
|
<span class="fa fa-list pr-1"></span>
|
|
|
|
{{ configuration.actionTitle(context, 'back', 'Back to the list')|trans }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-04-30 14:31:37 +02:00
|
|
|
{% if configuration.action(context, 'show', true, [entity]) %}
|
2022-03-13 19:32:32 +01:00
|
|
|
<a href="{{ path(configuration.pageRoute('show'), {entity: entity.id}|merge(configuration.pageRouteParams('show'))) }}" class="btn btn-secondary">
|
|
|
|
<span class="fa fa-eye pr-1"></span>
|
|
|
|
{{ configuration.actionTitle(context, 'show', 'Show')|trans|build_string(entity) }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<button type="submit" form="form-main" class="btn btn-primary">
|
|
|
|
<span class="fa fa-save pr-1"></span>
|
|
|
|
{{ configuration.actionTitle(context, 'save', 'Save')|trans|build_string(entity) }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
{% block header_actions_after %}{% endblock %}
|
|
|
|
|
|
|
|
{% if header_actions_dropdown_menu is not defined %}
|
|
|
|
{% set header_actions_dropdown_menu = '' %}
|
|
|
|
{% endif %}
|
|
|
|
|
2022-04-30 14:31:37 +02:00
|
|
|
{% if configuration.action(context, 'delete', true, [entity]) %}
|
2022-03-13 19:32:32 +01:00
|
|
|
{% set item %}
|
|
|
|
<button type="submit" form="form-delete" class="dropdown-item">
|
|
|
|
{{ configuration.actionTitle(context, 'delete', 'Delete')|trans|build_string(entity) }}
|
|
|
|
</button>
|
|
|
|
{% endset %}
|
|
|
|
|
|
|
|
{% set header_actions_dropdown_menu = header_actions_dropdown_menu ~ item %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% block header_actions_dropdown %}
|
|
|
|
{% if header_actions_dropdown_menu %}
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<div class="dropdown-menu dropdown-menu-right">
|
|
|
|
{{ header_actions_dropdown_menu|raw }}
|
|
|
|
</div>
|
|
|
|
{% 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">
|
|
|
|
{% include(configuration.view('form', '@Core/admin/crud/_form.html.twig')) with {form: form} %}
|
|
|
|
|
|
|
|
{{ form_rest(form) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|
|
|
|
|
2022-04-30 14:31:37 +02:00
|
|
|
{% if configuration.action(context, 'delete', true, [entity]) %}
|
2022-03-13 19:32:32 +01:00
|
|
|
<form method="post" action="{{ path(configuration.pageRoute('delete'), {entity: entity.id}|merge(configuration.pageRouteParams('delete'))) }}" 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 %}
|