|
- {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
- {% use '@EasyAdmin/crud/form_theme.html.twig' %}
-
- {% block gallery_manager_row %}
- {{ block('collection_row') }}
- {% endblock gallery_manager_row %}
-
- {% block gallery_manager_widget %}
- {{ block('collection_widget') }}
- {% endblock gallery_manager_widget %}
-
-
- {% block collection_row %}
- {% if prototype is defined and not prototype.rendered %}
- {% set row_attr = row_attr|merge({ 'data-prototype': form_row(prototype) }) %}
- {% endif %}
-
- {% set row_attr = row_attr|merge({
- 'data-entry-is-complex': form.vars.ea_crud_form.ea_field and form.vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ? 'true' : 'false',
- 'data-allow-add': allow_add ? 'true' : 'false',
- 'data-allow-delete': allow_delete ? 'true' : 'false',
- 'data-num-items': form.children|length,
- 'data-form-type-name-placeholder': prototype is defined ? prototype.vars.name : '',
- }) %}
-
- {{ block('form_row') }}
- {% endblock collection_row %}
-
- {% block collection_widget %}
- {{ block('form_widget') }}
- {% if allow_add|default(false) %}
- <button type="button" class="btn btn-link field-collection-add">
- <i class="fa fa-plus pr-1"></i>
- {{ 'action.add_new_item'|trans({}, 'EasyAdminBundle') }}
- </button>
- {% endif %}
- {% endblock collection_widget %}
-
- {% block collection_entry_widget %}
- {% set is_complex = form_parent(form).vars.ea_crud_form.ea_field.customOptions.get('entryIsComplex') ?? false %}
-
- <div class="field-collection-item {{ is_complex ? 'field-collection-item-complex' }}">
- {{ form_widget(form) }}
-
- {% if form_parent(form).vars.allow_delete|default(false) %}
- <button type="button" class="btn btn-link field-collection-delete"
- title="{{ 'action.remove_item'|trans({}, 'EasyAdminBundle') }}">
- <i class="fas fa-times"></i>
- </button>
- {% endif %}
- </div>
- {% endblock collection_entry_widget %}
-
- {% block file_manager_image_row %}
- {{ form_widget(form) }}
- {% endblock file_manager_image_row %}
-
- {% block file_manager_legend_row %}
- {{ form_widget(form) }}
- {% endblock file_manager_legend_row %}
-
- {% block file_manager_position_row %}
- {{ form_widget(form) }}
- {% endblock file_manager_position_row %}
-
-
- {% block file_manager_widget %}
-
- <div class="lc-filemanager row">
- <div class="col-md-3 col-xs-12 form-group">
- <div class="lc-filemenager-preview card">
- <div class="no-image">
- <i class="fa fa-image"></i>
- </div>
- <img src="{{ form.path.vars.value }}" id="{{ form.path.vars.id }}_preview" alt="" class="card-img-top">
- </div>
- </div>
- <div class="col-12">
- <div class="input-group">
- <div class="input-group-prepend">
- {% if form.parent.vars['row_attr']['data-sortable'] is defined %}
- <button type="button" class="btn btn-success lc-btn-sortable" data-toggle="tooltip" title="Trier les images">
- <i class="fa fa-arrows-alt"></i>
- </button>
- {% endif %}
- <button type="button" class="btn btn-primary lc-filemanager-open" data-id="{{ form.path.vars.id }}" data-toggle="tooltip" title="Sélectionner un fichier"
- data-target="{{ path('file_manager', {module:1, conf:'default'})|raw }}">
- <i class="fa fa-folder-open"></i>
- </button>
- </div>
- {{ form_widget(form.legend) }}
- <div class="input-group-append">
- <button type="button" class="btn btn-danger lc-filemanager-delete" data-toggle="tooltip" title="Supprimer l'image"
- data-id="{{ form.path.vars.id }}">
- <i class="fa fa-trash"></i>
- </button>
- </div>
-
-
- {{ form_rest(form) }}
- </div>
- </div>
- </div>
- {% endblock file_manager_widget %}
-
- {% block checkbox_radio_label -%}
- {#- Do not display the label if widget is not defined in order to prevent double label rendering -#}
- {%- if widget is defined -%}
- {% set is_parent_custom = parent_label_class is defined and ('checkbox-custom' in parent_label_class or 'radio-custom' in parent_label_class or 'switch-custom' in parent_label_class) %}
- {% set is_custom = label_attr.class is defined and ('checkbox-custom' in label_attr.class or 'radio-custom' in label_attr.class or 'switch-custom' in label_attr.class) %}
- {%- if is_parent_custom or is_custom -%}
- {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' custom-control-label')|trim}) -%}
- {%- else %}
- {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' form-check-label')|trim}) -%}
- {%- endif %}
- {%- if not compound -%}
- {% set label_attr = label_attr|merge({'for': id}) %}
- {%- endif -%}
- {%- if required -%}
- {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%}
- {%- endif -%}
- {%- if parent_label_class is defined -%}
- {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|replace({'checkbox-inline': '', 'radio-inline': '', 'checkbox-custom': '', 'radio-custom': ''})|trim}) -%}
- {%- endif -%}
- {%- if label is not same as(false) and label is empty -%}
- {%- if label_format is not empty -%}
- {%- set label = label_format|replace({
- '%name%': name,
- '%id%': id,
- }) -%}
- {%- else -%}
-
- {%- set label = name|humanize -%}
- {%- endif -%}
- {%- endif -%}
-
- <label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
- {{ widget|raw }}
- <span class="checkmark"></span>
-
- {# {% if translation_domain == 'lcshop' %}
- {{ name|lc_trad(easyadmin['entity']['name'], 'field') }}
- {% else %}#}
- {{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain))|raw -}}
- {#{% endif %}#}
- {{- form_errors(form) -}}
- </label>
- {%- endif -%}
- {%- endblock checkbox_radio_label %}
|