crudification for thirdparty

This commit is contained in:
2021-10-06 12:30:18 +02:00
parent a8edef13a3
commit 7ea2c36c5e
16 changed files with 275 additions and 242 deletions

View File

@@ -1,5 +1,5 @@
{% set formId = crudMainFormId|default('crud_main_form') %}
<div class="{% block crud_content_main_div_class %}{% endblock %}">
<div class="{% block crud_content_main_div_class %}col-10 centered{% endblock %}">
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_edit')|trans }}</h1>
{% endblock crud_content_header %}

View File

@@ -1,10 +1,11 @@
{% set formId = crudMainFormId|default('crud_main_form') %}
<div class="{% block crud_content_main_div_class %}col-10 centered{% endblock %}">
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_new')|trans({'%crud_name%' : crud_name }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_form %}
{{ form_start(form) }}
{{ form_start(form, { 'attr' : { 'id': formId } }) }}
{% block crud_content_form_rows %}
{% for f in form %}{% if f.vars.name != 'submit' %}
@@ -14,6 +15,8 @@
{% block crud_content_after_form %}{% endblock %}
{{ form_end(form) }}
{% block crud_content_form_actions %}
<ul class="record_actions sticky-form-buttons">
{% block content_form_actions_back %}
@@ -25,21 +28,21 @@
{% endblock %}
{% block content_form_actions_save_and_close %}
<li class="">
<button type="submit" name="submit" value="save-and-close" class="btn btn-create">
<button type="submit" name="submit" value="save-and-close" class="btn btn-create" form="{{ formId }}">
{{ 'crud.new.save_and_close'|trans }}
</button>
</li>
{% endblock %}
{% block content_form_actions_save_and_show %}
<li class="">
<button type="submit" name="submit" value="save-and-show" class="btn btn-create">
<button type="submit" name="submit" value="save-and-show" class="btn btn-create" form="{{ formId }}">
{{ 'crud.new.save_and_show'|trans }}
</button>
</li>
{% endblock %}
{% block content_form_actions_save_and_new %}
<li class="">
<button type="submit" name="submit" value="save-and-new" class="btn btn-create">
<button type="submit" name="submit" value="save-and-new" class="btn btn-create" form="{{ formId }}">
{{ 'crud.new.save_and_new'|trans }}
</button>
</li>

View File

@@ -198,3 +198,15 @@
{{ form_widget(entry) }}
{% endfor %}
{% endblock comment_widget %}
{% block pick_center_widget %}
{{ form_widget(form.center) }}
{% endblock pick_center_widget %}
{% block pick_center_row %}
{% if (not form.vars.is_hidden) %}
{{ block('form_row') }}
{% else %}
{{ form_widget(form.center) }}
{% endif %}
{% endblock %}