diff --git a/assets/app.js b/assets/app.js index 01af6746..d1d1a0b2 100644 --- a/assets/app.js +++ b/assets/app.js @@ -578,6 +578,11 @@ document.addEventListener('DOMContentLoaded', () => { parseCuisine(); + // Tri automatique des tableaux + const tables = document.querySelectorAll('table'); + tables.forEach(table => { + table.classList.add('js-sort-table'); + }); }); diff --git a/assets/styles/app.css b/assets/styles/app.css index 80c7071a..548e3771 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -11,4 +11,8 @@ body { .main-footer { padding-bottom: 10rem; background-color: #dfe5eb; +} + +.no-name { + color: #df5a0d; } \ No newline at end of file diff --git a/templates/admin/stats.html.twig b/templates/admin/stats.html.twig index 44df53d4..06654b68 100644 --- a/templates/admin/stats.html.twig +++ b/templates/admin/stats.html.twig @@ -41,7 +41,13 @@ {% for commerce in stats.places %} - {% if commerce.name |length %} {{ commerce.name |slice(0, 20) }}... {% else %} (lieu sans nom) {% endif %} + + {% if not commerce.name |length %} + + (lieu sans nom) + + {% endif %} + {% if commerce.name |length > 50 %} {{ commerce.name |slice(0, 50) }}... {% else %} {{ commerce.name }} {% endif %} {{ commerce.address }} diff --git a/templates/base.html.twig b/templates/base.html.twig index 0b9e7d64..9e84c30b 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -12,13 +12,17 @@ + + + + {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #} {% block stylesheets %} {{ encore_entry_link_tags('app') }} - + {% endblock %} @@ -108,24 +112,6 @@ }); - // Tri automatique des tableaux - // Sélectionner la première table du document - if( Sortable) { - const firstTable = document.querySelector('table'); - if (firstTable) { - console.log('première table trouvée', firstTable); - var sortable = new Sortable(firstTable, { - animation: 150, - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - dragClass: 'sortable-drag' - }); - } else { - console.log('pas de table trouvée'); - } - }else{ - console.log('Sortable non trouvé'); - } {% endblock %}