From 3332e3644896640ad4808731231d0fd3b907828d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 13 Nov 2026 12:26:51 +0100 Subject: [PATCH] fix: keep dashboard entries on one line and inside the card --- assets/styles/ep-design.css | 14 ++++++++++---- templates/components/dashboard/entry.html.twig | 17 +++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/assets/styles/ep-design.css b/assets/styles/ep-design.css index cb3964f..28dfb7b 100644 --- a/assets/styles/ep-design.css +++ b/assets/styles/ep-design.css @@ -275,7 +275,7 @@ /* * Lists of entries in a card, as on a dashboard (components/dashboard/): one line per entry, the - * whole line is the link or button, its parts separated by a dot, the last part cut off with "…". + * whole line is the link or button, its parts separated by a dot, the text cut off with "…". */ .entry-list { @apply divide-y divide-line; @@ -299,14 +299,20 @@ } .entry-link > * { - @apply shrink-0 whitespace-nowrap; + @apply shrink-0; } - .entry-link > :last-child { + /* the text after the icon: one line, cut off as a whole with "…" */ + .entry-text { @apply min-w-0 shrink truncate; } - .entry-link > .entry-dot { + /* icons and dots inside the text flow with it (Tailwind's preflight makes svg a block) */ + .entry-text :is(svg, img) { + @apply inline-block align-middle; + } + + .entry-dot { @apply text-muted; } diff --git a/templates/components/dashboard/entry.html.twig b/templates/components/dashboard/entry.html.twig index 4e32647..5d31801 100644 --- a/templates/components/dashboard/entry.html.twig +++ b/templates/components/dashboard/entry.html.twig @@ -9,14 +9,15 @@ {% set is_button = not url and attributes.all|keys|filter(k => k starts with 'hx-')|length > 0 %} {% set body %} {% if icon %}{{ include('_partials/_icon.html.twig', {icon: icon, class: 'size-4 text-muted'}) }}{% endif %} - {% if parts is not null %} - {% for part in parts|filter(p => p is not empty) %} - {% if not loop.first %}{% endif %} - {{ part }} - {% endfor %} - {% else %} - {{ block('content') }} - {% endif %} + + {%- if parts is not null -%} + {%- for part in parts|filter(p => p is not empty) -%} + {% if not loop.first %} {% endif %}{{ part }} + {%- endfor -%} + {%- else -%} + {{ block('content') }} + {%- endif -%} + {% endset %} {% set attrs = attributes.defaults({class: 'entry-link'}).without('url', 'icon', 'parts') %}