feat: replace some partials with twig components

This commit is contained in:
Björn Fromme
2024-03-01 11:13:47 +01:00
parent a668dcb326
commit f722afe7ff
23 changed files with 205 additions and 96 deletions
+13
View File
@@ -0,0 +1,13 @@
<div class="relative inline-block text-left group">
<button type="button" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-0" aria-expanded="true" aria-haspopup="true">
<span class="sr-only">Funktionen</span>
{{ icon('dots', 'w-6 h-6') }}
</button>
<div class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
<div class="rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<div class="py-1 menu menu--pulldown" role="none">
{% block content %}{% endblock %}
</div>
</div>
</div>
</div>
@@ -0,0 +1,4 @@
<div class="{{ html_classes('flex items-start space-x-4 text-white p-4 rounded-md w-full', { 'bg-primary': type != 'error', 'bg-red-500': type == 'error' }) }}">
{{ icon(type == 'error' ? 'alert' : 'info', 'w-6 h-6 shrink-0') }}
<span>{{ message }}</span>
</div>
@@ -0,0 +1,5 @@
<div class="inline-flex items-center"{% if averageRating %}{{ stimulus_controller('tooltip', { content: averageRating|format_rating|raw, placement: 'top' }) }}{% endif %}>
{% for grade in range(1, 5) %}
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }}
{% endfor %}
</div>