feat: adopt ep-design 1.3.0 in admin
This commit is contained in:
1 parent
df564c30ae
commit
e517163c9a
19 files changed
+127
-140
No files matched your search
@@ -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 %}<span class="entry-dot" aria-hidden="true">·</span>{% endif %}
|
||||
<span>{{ part }}</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span>{{ block('content') }}</span>
|
||||
{% endif %}
|
||||
<span class="entry-text">
|
||||
{%- if parts is not null -%}
|
||||
{%- for part in parts|filter(p => p is not empty) -%}
|
||||
{% if not loop.first %} <span class="entry-dot" aria-hidden="true">·</span> {% endif %}<span>{{ part }}</span>
|
||||
{%- endfor -%}
|
||||
{%- else -%}
|
||||
{{ block('content') }}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
{% endset %}
|
||||
{% set attrs = attributes.defaults({class: 'entry-link'}).without('url', 'icon', 'parts') %}
|
||||
<li>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{% set warning = warning ?? false %}
|
||||
{% set method = method ?? 'get' %}
|
||||
<button type="button"
|
||||
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
|
||||
role="menuitem"
|
||||
{{ stimulus_action('menu', 'choose') }}
|
||||
{{ attributes
|
||||
.defaults({
|
||||
'hx-target': 'body',
|
||||
'hx-swap': 'beforeend',
|
||||
})
|
||||
.without('url', 'warning', 'method')
|
||||
}}
|
||||
hx-{{ method | lower }}="{{ url }}"
|
||||
>
|
||||
{{ block('content') }}
|
||||
</button>
|
||||
@@ -1,15 +0,0 @@
|
||||
{#- The "⋯" menu of a row or card (menu_controller.js); fill it with dropdown:link and dropdown:hxbutton -#}
|
||||
<div class="relative inline-block text-left" {{ stimulus_controller('menu') }}>
|
||||
<button type="button"
|
||||
class="btn-more"
|
||||
aria-haspopup="menu"
|
||||
aria-expanded="false"
|
||||
aria-label="Funktionen"
|
||||
{{ stimulus_target('menu', 'button') }}
|
||||
{{ stimulus_action('menu', 'toggle') }}>
|
||||
{{ icon('dots', 'size-5') }}
|
||||
</button>
|
||||
<div class="menu-panel" role="menu" hidden {{ stimulus_target('menu', 'panel') }}>
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
{% set warning = warning ?? false %}
|
||||
<a href="{{ url }}"
|
||||
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
|
||||
role="menuitem"
|
||||
{{ stimulus_action('menu', 'choose') }}>
|
||||
{{ block('content') }}
|
||||
</a>
|
||||
@@ -0,0 +1,13 @@
|
||||
{#-
|
||||
A "⋯" menu (menu_controller.js), opened by click or tap, never by hover. The items go in the
|
||||
content block: links or buttons with the class `menu-item` (or `menu-item-danger`) and
|
||||
role="menuitem". Choosing one closes the menu.
|
||||
-#}
|
||||
{% set label = label ?? 'Aktionen' %}
|
||||
<div class="relative inline-block" {{ stimulus_controller('menu') }}>
|
||||
<button type="button" class="btn-more" aria-haspopup="menu" aria-expanded="false" aria-label="{{ label }}"
|
||||
{{ stimulus_target('menu', 'button') }} {{ stimulus_action('menu', 'toggle') }}>⋯</button>
|
||||
<div class="menu-panel" role="menu" hidden {{ stimulus_target('menu', 'panel') }} {{ stimulus_action('menu', 'choose') }}>
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user