- Monitoring chapters
- possibilities for ToolBarButton.html.twig to have tailwind classes see ChapterListToolbar.php
- Makefile scheduler command
- Makefile make:message command
This commit is contained in:
Jérémy Guillot
2024-07-20 19:40:48 +02:00
parent 7fc2f15f6b
commit ff59aa5d77
21 changed files with 818 additions and 283 deletions

View File

@@ -1,21 +1,25 @@
{# templates/components/ToolbarButton.html.twig #}
{% set buttonAttributes = {} %}
{% set buttonClass = 'text-white' %}
{% 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}) %}
{% set dataKey = 'data-' ~ key|replace({'_': '-'})|lower %}
{% set buttonAttributes = buttonAttributes|merge({ (dataKey): value }) %}
{% endfor %}
{% if data['buttonClass'] is defined %}
{% set buttonClass = data['buttonClass'] %}
{% endif %}
{% endif %}
<div {{ attributes }}>
<button class="flex flex-col justify-around min-h-14 w-min ml-4 items-center text-white group"
{% if action %}
<button class="flex flex-col justify-around min-h-14 w-min ml-4 items-center group {{ buttonClass }}"
data-controller="{{ controller }}"
data-action="{{ action }}"
{% endif %}
{{ buttonAttributes|join(' ') }}
{% for attrName, attrValue in buttonAttributes %}
{{ attrName }}="{{ attrValue }}"
{% endfor %}
>
<i data-toolbar-target="icon" class="fas fa-{{ icon }} text-xl group-hover:text-green-500"></i>
<span class="text-xs">{{ text }}</span>
<i data-{{ controller }}-target="icon" class="fas fa-{{ icon }} text-xl group-hover:text-green-500"></i>
<span data-{{ controller }}-target="text" class="text-xs">{{ text }}</span>
</button>
</div>