{#- One line of a dashboard:widget. Its text is `parts` (shown with dots between them) or the content block; `icon` in front. With `url` the line is a link, without one but with hx-* attributes a button (opening a modal, say), otherwise plain text. -#} {% set url = url ?? null %} {% set icon = icon ?? null %} {% set parts = parts ?? null %} {% 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 -%} {% endset %} {% set attrs = attributes.defaults({class: 'entry-link'}).without('url', 'icon', 'parts') %}