{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} {% extends ea.templatePath('layout') %} {% block body_id 'ea-detail-' ~ entity.name ~ '-' ~ entity.primaryKeyValue %} {% block body_class 'ea-detail ea-detail-' ~ entity.name %} {% set ea_field_assets = ea.crud.fieldAssets(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Crud::PAGE_DETAIL')) %} {% block configured_head_contents %} {{ parent() }} {% for htmlContent in ea_field_assets.headContents %} {{ htmlContent|raw }} {% endfor %} {% endblock %} {% block configured_body_contents %} {{ parent() }} {% for htmlContent in ea_field_assets.bodyContents %} {{ htmlContent|raw }} {% endfor %} {% endblock %} {% block configured_stylesheets %} {{ parent() }} {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea_field_assets.cssAssets }, with_context = false) }} {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }} {% endblock %} {% block configured_javascripts %} {{ parent() }} {{ include('@EasyAdmin/includes/_js_assets.html.twig', { assets: ea_field_assets.jsAssets }, with_context = false) }} {{ include('@EasyAdmin/includes/_encore_script_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }} {% endblock %} {% block content_title %} {%- apply spaceless -%} {% set custom_page_title = ea.crud.customPageTitle(pageName, entity ? entity.instance : null, ea.i18n.translationParameters) %} {{ custom_page_title is null ? ea.crud.defaultPageTitle(null, null, ea.i18n.translationParameters)|trans|raw : custom_page_title|trans|raw }} {%- endapply -%} {% endblock %} {% block page_actions %} {% for action in entity.actions %} {{ include(action.templatePath, { action: action }, with_context = false) }} {% endfor %} {% endblock %} {% block main %} {% block detail_fields %} {% for field in entity.fields %} {% if field.isFormLayoutField %} {{ _self.render_layout_field(field) }} {% else %} {{ _self.render_field_contents(entity, field) }} {% endif %} {% endfor %} {% endblock detail_fields %} {% block delete_form %} {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', { entity_id: entity.primaryKeyValue }, with_context = false) }} {% endblock delete_form %} {% endblock %} {% macro render_field_contents(entity, field) %}
{% if field.label is same as (false) %} {# a FALSE label value means that the field doesn't even display the
{% endmacro %} {% macro render_layout_field(field) %} {% if field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormTabListType' %} {{ _self.render_tab_list(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormTabPaneGroupOpenType' %} {{ _self.render_tab_group_open(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormTabPaneGroupCloseType' %} {{ _self.render_tab_group_close(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormTabPaneOpenType' %} {{ _self.render_tab_open(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormTabPaneCloseType' %} {{ _self.render_tab_close(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormColumnGroupOpenType' %} {{ _self.render_column_group_open(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormColumnGroupCloseType' %} {{ _self.render_column_group_close(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormColumnOpenType' %} {{ _self.render_column_open(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormColumnCloseType' %} {{ _self.render_column_close(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormFieldsetOpenType' %} {{ _self.render_fieldset_open(field) }} {% elseif field.formType == 'EasyCorp\\Bundle\\EasyAdminBundle\\Form\\Type\\Layout\\EaFormFieldsetCloseType' %} {{ _self.render_fieldset_close(field) }} {% endif %} {% endmacro %} {% macro render_tab_list(field) %} {% set tab_id_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_TAB_ID') %} {% set tab_is_active_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_TAB_IS_ACTIVE') %} {% set tab_error_count_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_TAB_ERROR_COUNT') %} {% endmacro %} {% macro render_tab_group_open(field) %} {% endmacro %} {% macro render_tab_open(field) %} {% set tab_id_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_TAB_ID') %} {% set tab_is_active_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_TAB_IS_ACTIVE') %}
{% if field.help %}
{{ field.help|trans(domain = ea.i18n.translationDomain)|raw }}
{% endif %}
{% endmacro %} {% macro render_tab_close(field) %}
{% endmacro %} {% macro render_column_group_open(field) %} {# if columns are inside tabs, don't add a '.row' element because the tab pane already opens it #} {% if not field.getFormTypeOption('ea_is_inside_tab')|default(false) %}
{% endif %} {% endmacro %} {% macro render_column_group_close(field) %} {# if columns are inside tabs, don't add a '.row' element because the tab pane already opens it #} {% if not field.getFormTypeOption('ea_is_inside_tab')|default(false) %}
{% endif %} {% endmacro %} {% macro render_column_open(field) %} {% set field_icon = field.getCustomOption('icon') %} {% set column_has_title = field_icon != null or field.label != false or field.label != null or field.label != '' or field.help != null %}
{% if column_has_title %}
{% if field_icon %}{% endif %} {% if field.label %}{{ field.label|trans(domain = ea.i18n.translationDomain)|raw }}{% endif %}
{% if field.help %}
{{ field.help|trans(domain = ea.i18n.translationDomain)|raw }}
{% endif %}
{% endif %} {% endmacro %} {% macro render_column_close(field) %}
{% endmacro %} {% macro render_fieldset_open(field) %} {% set fieldset_has_header = field.label or field.getCustomOption('icon') or field.help %} {% set is_collapsible_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_COLLAPSIBLE') %} {% set is_collapsed_option_name = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Field\\FormField::OPTION_COLLAPSED') %} {% set is_collapsible = field.getCustomOption(is_collapsible_option_name) %} {% set is_collapsed = field.getCustomOption(is_collapsed_option_name) %}
{% if fieldset_has_header %}
{% set fieldset_title_contents %} {% if is_collapsible %} {% endif %} {% if field.getCustomOption('icon') %} {% endif %} {{ field.label|trans|raw }} {% endset %} {% if is_collapsible %} {% else %} {{ fieldset_title_contents|raw }} {% endif %} {% if field.help %}
{{ field.help|trans|raw }}
{% endif %}
{% endif %}
{% endmacro %} {% macro render_detail_fields_with_tabs(entity, field_layout) %} {% deprecated 'The "render_detail_fields_with_tabs" macro is deprecated because the layout building logic has been revamped for the "detail" page. Check EasyAdmin\'s `detail.html.page` for more details.' %}
{% endmacro %} {% macro render_detail_fields(entity, fields) %} {% deprecated 'The "render_detail_fields" macro is deprecated because the layout building logic has been revamped for the "detail" page. Check EasyAdmin\'s `detail.html.page` for more details.' %} {% set form_fieldset_is_already_open = false %} {% for field in fields %} {% set is_form_fieldset = 'field-form_fieldset' in field.cssClass %} {% if is_form_fieldset or (loop.first and not is_form_fieldset) %} {% if form_fieldset_is_already_open %} {{ _self.close_form_fieldset() }} {% set form_fieldset_is_already_open = false %} {% endif %} {{ _self.open_form_fieldset(is_form_fieldset ? field : null) }} {% set form_fieldset_is_already_open = true %} {% endif %} {% block detail_field %} {% if not is_form_fieldset %} {{ _self.render_field(entity, field) }} {% endif %} {% endblock %} {% endfor %} {% if form_fieldset_is_already_open %} {{ _self.close_form_fieldset() }} {% set form_fieldset_is_already_open = false %} {% endif %} {% endmacro %} {% macro open_form_fieldset(field = null) %} {% deprecated 'The "open_form_fieldset" macro is deprecated because the layout building logic has been revamped for the "detail" page. Check EasyAdmin\'s `detail.html.page` for more details.' %} {% set fieldset_name = field is null ? null : 'content-' ~ field.uniqueId %} {% set collapsible = field is null ? false : field.customOption('collapsible') %} {% set collapsed = field is null ? false : field.customOption('collapsed') %} {% set fieldset_icon = field is null ? null : (field.customOptions.get('icon')|default(false)) %} {% set fieldset_label = field is null ? null : field.label %} {% set fieldset_help = field is null ? null : field.help|default(false)%} {% set fieldset_has_header = collapsible or fieldset_icon or fieldset_label or fieldset_help %}
{% if fieldset_has_header %} {% endif %}
{% endmacro %} {% macro render_field(entity, field) %} {% deprecated 'The "render_field" macro is deprecated because the layout building logic has been revamped for the "detail" page. Check EasyAdmin\'s `detail.html.page` for more details.' %}
{{ field.label|trans|raw }} {% if field.help is not empty %} {% endif %}
{{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
{% endmacro %}