From 62b1406fb9c5900c5df0da6ba970b81a8f9a1f4f Mon Sep 17 00:00:00 2001 From: mgielecinski Date: Mon, 27 Apr 2026 12:57:04 +0200 Subject: [PATCH 1/4] change-html-tags-to-classes --- assets/js/app.js | 8 ++++---- templates/crud/index.html.twig | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 22fdc5f63d..a7fc850049 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -185,7 +185,7 @@ class App { const searchQueryTerms = tokenizeString(searchElement.value); - const elementsToHighlight = document.querySelectorAll('table tbody td.searchable'); + const elementsToHighlight = document.querySelectorAll('.entity-list-item-value.searchable'); const highlighter = new Mark(elementsToHighlight); highlighter.mark(searchQueryTerms, { separateWordSearch: false }); } @@ -298,7 +298,7 @@ class App { const selectedRowCheckboxes = document.querySelectorAll( 'input[type="checkbox"].form-batch-checkbox:checked' ); - const row = rowCheckbox.closest('tr'); + const row = rowCheckbox.closest('.entity-list-item'); const content = rowCheckbox.closest('.content'); if (rowCheckbox.checked) { @@ -476,12 +476,12 @@ class App { } #createDefaultRowAction() { - const clickableRows = document.querySelectorAll('tr.ea-clickable-row[data-default-action-url]'); + const clickableRows = document.querySelectorAll('.entity-list-item.ea-clickable-row[data-default-action-url]'); if (0 === clickableRows.length) { return; } - const clickTrigger = clickableRows[0].closest('table')?.getAttribute('data-default-action-trigger') || 'single'; + const clickTrigger = clickableRows[0].closest('.entity-list')?.getAttribute('data-default-action-trigger') || 'single'; const interactiveSelectors = [ 'a', diff --git a/templates/crud/index.html.twig b/templates/crud/index.html.twig index 5b9fba24fc..3eb019c844 100644 --- a/templates/crud/index.html.twig +++ b/templates/crud/index.html.twig @@ -96,7 +96,8 @@ {% set has_filters = filters|length > 0 %} {% set num_results = entities|length %} - + {% block entity_list %} +
{% if num_results > 0 %} {% block table_head %} @@ -143,7 +144,7 @@ {% for entity in entities %} {% block table_body_row %} {% if entity.isAccessible %} - + {% if has_batch_actions %} {% endfor %} @@ -245,6 +246,7 @@ {% endblock table_footer %}
@@ -155,7 +156,7 @@ {% for field in entity.fields %} {% set is_searchable = null == ea.crud.searchFields or field.property in ea.crud.searchFields %} -
+ {{ include(field.templatePath, {field: field, entity: entity}, with_context: false) }}
+ {% endblock entity_list %} {% if entities|length > 0 %}