fix: keep dashboard entries on one line and inside the card

This commit is contained in:
fromme committed 2026-11-13 12:26:51 +01:00
1 parent 6dbc6efa78
commit 3332e36448
2 files changed
+19 -12

No files matched your search

+10 -4
View File
@@ -275,7 +275,7 @@
/* /*
* Lists of entries in a card, as on a dashboard (components/dashboard/): one line per entry, the * 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 { .entry-list {
@apply divide-y divide-line; @apply divide-y divide-line;
@@ -299,14 +299,20 @@
} }
.entry-link > * { .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; @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; @apply text-muted;
} }
@@ -9,14 +9,15 @@
{% set is_button = not url and attributes.all|keys|filter(k => k starts with 'hx-')|length > 0 %} {% set is_button = not url and attributes.all|keys|filter(k => k starts with 'hx-')|length > 0 %}
{% set body %} {% set body %}
{% if icon %}{{ include('_partials/_icon.html.twig', {icon: icon, class: 'size-4 text-muted'}) }}{% endif %} {% if icon %}{{ include('_partials/_icon.html.twig', {icon: icon, class: 'size-4 text-muted'}) }}{% endif %}
{% if parts is not null %} <span class="entry-text">
{% for part in parts|filter(p => p is not empty) %} {%- if parts is not null -%}
{% if not loop.first %}<span class="entry-dot" aria-hidden="true">·</span>{% endif %} {%- for part in parts|filter(p => p is not empty) -%}
<span>{{ part }}</span> {% if not loop.first %} <span class="entry-dot" aria-hidden="true">·</span> {% endif %}<span>{{ part }}</span>
{% endfor %} {%- endfor -%}
{% else %} {%- else -%}
<span>{{ block('content') }}</span> {{ block('content') }}
{% endif %} {%- endif -%}
</span>
{% endset %} {% endset %}
{% set attrs = attributes.defaults({class: 'entry-link'}).without('url', 'icon', 'parts') %} {% set attrs = attributes.defaults({class: 'entry-link'}).without('url', 'icon', 'parts') %}
<li> <li>