- AdditionnalData for buttons
- refresh manga metadata and chapters
This commit is contained in:
Jérémy Guillot
2024-07-05 19:03:16 +02:00
parent 3012adfee7
commit 586ebdb126
14 changed files with 283 additions and 107 deletions

View File

@@ -1,10 +1,19 @@
{# templates/components/ToolbarButton.html.twig #}
{% set buttonAttributes = {} %}
{% if data is defined and data is not empty %}
{% for key, value in data %}
{% set dataAttribute = 'data-' ~ key|replace({'_': '-'})|lower ~ '=' ~ value %}
{% set buttonAttributes = buttonAttributes|merge({dataAttribute}) %}
{% endfor %}
{% endif %}
<div {{ attributes }}>
<button
class="flex flex-col justify-around min-h-14 w-min ml-4 items-center text-white group"
<button class="flex flex-col justify-around min-h-14 w-min ml-4 items-center text-white group"
{% if action %}
{{ stimulus_action(controller|default('toolbar'), action) }}
{{ stimulus_action('toolbar', action) }}
{% endif %}
{{ buttonAttributes|join(' ') }}
>
<i class="fas fa-{{ icon }} text-xl group-hover:text-green-500"></i>
<span class="text-xs">{{ text }}</span>