{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} {% use '@EasyAdmin/crud/form_theme.html.twig' %} {% block form_start %} {% if form.vars.errors|length > 0 and 'ea_crud' in form.vars.block_prefixes|default([]) %} {{ form_errors(form) }} {% endif %} {%- do form.setMethodRendered() -%} {% set method = method|upper %} {%- if method in ["GET", "POST"] -%} {% set form_method = method %} {%- else -%} {% set form_method = "POST" %} {%- endif -%} {%- if form_method != method -%} {%- endif -%} {% endblock form_start %} {% block form_row %} {% set row_attr = row_attr|merge({ class: row_attr.class|default('') ~ ' form-group' }) %}
{{- form_label(form) -}}
{# {% set has_prepend_html = ea.field.prepend_html|default(null) is not null %} {% set has_append_html = ea.field.append_html|default(null) is not null %} {% set has_input_groups = has_prepend_html or has_append_html %} #} {% set has_prepend_html = false %} {% set has_append_html = false %} {% set has_input_groups = false %} {% if ea_crud_form.ea_field is defined and ea_crud_form.ea_field is not null %} {% set prepend_html = ea_crud_form.ea_field.customOptions.get('prependHtml') %} {% set append_html = ea_crud_form.ea_field.customOptions.get('appendHtml') %} {% set has_prepend_html = prepend_html is not null %} {% set has_append_html = append_html is not null %} {% set has_input_groups = has_prepend_html or has_append_html %} {% endif %} {% if has_input_groups %}
{% endif %} {% if has_prepend_html %}
{{ prepend_html|raw }}
{% endif %} {{ form_widget(form) }} {% if has_append_html %}
{{ append_html|raw }}
{% endif %} {% if has_input_groups %}
{% endif %} {% set nullable_fields_fqcn = [ 'EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField', 'EasyCorp\Bundle\EasyAdminBundle\Field\DateField', 'EasyCorp\Bundle\EasyAdminBundle\Field\TimeField', ] %} {% if form.vars.ea_crud_form.ea_field.fieldFqcn|default(false) in nullable_fields_fqcn and ea.field.nullable|default(false) %}
{% endif %} {% set help_message = name|sov_trans_admin_help(form.parent.vars.data) %} {% if help_message != '' %} {{ help_message }} {% endif %} {{- form_errors(form) -}}
{% endblock form_row %} {% block form_label -%} {% if label is same as(false) -%} {%- endif -%} {%- endblock checkbox_radio_label %} {% block ea_crud_widget_panels %} {% embed '@LcSov/adminlte/embed/tabs/tabs.html.twig' %} {# items menu #} {% import '@LcSov/adminlte/macro/tabs.html.twig' as mtabs %} {% block menu_items %} {% for panel_name, panel_config in ea_crud_form.form_panels|filter(panel_config => not panel_config.form_tab or panel_config.form_tab == tab_name) %} {{ mtabs.menu_item(panel_name, loop.first, panel_config.label|sov_trans_admin_panel(ea.getEntity().getFqcn())) }} {% endfor %} {% endblock %} {# content #} {% block content %} {# panes #} {% for panel_name, panel_config in ea_crud_form.form_panels|filter(panel_config => not panel_config.form_tab or panel_config.form_tab == tab_name) %} {% embed '@LcSov/adminlte/embed/tabs/pane.html.twig' %} {% block class %}{{ loop.first ? 'active' }}{% endblock %} {% block id %}{{ panel_name }}{% endblock %} {% block content %} {% if panel_config['prepend_content_path'] is defined %} {% include panel_config['prepend_content_path'] %} {% endif %} {% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and field.vars.ea_crud_form.form_panel == panel_name) %} {% if not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name %} {{ form_row(field) }} {% endif %} {% endfor %} {% if panel_config['append_content_path'] is defined %} {% include panel_config['append_content_path'] %} {% endif %} {% endblock %} {% endembed %} {% else %} {% for field in form|filter(field => 'hidden' not in field.vars.block_prefixes and (not field.vars.ea_crud_form.form_tab or field.vars.ea_crud_form.form_tab == tab_name)) %} {{ form_row(field) }} {% endfor %} {% endfor %} {% endblock %} {% endembed %} {% endblock ea_crud_widget_panels %} {% block ckeditor_widget %} {% endblock %}