This commit is contained in:
Björn Fromme
2025-02-28 09:42:17 +01:00
parent ac498f9040
commit 62f5fa4406
9 changed files with 105 additions and 21 deletions
+5 -2
View File
@@ -1,4 +1,7 @@
<div class="{{ html_classes('rounded-md p-4 mb-4', { 'bg-red-50': level == 'error', 'bg-green-50': level == 'success', 'bg-blue-50': level == 'info' }) }}">
{% if modal is not defined %}
{% set modal = false %}
{% endif %}
<div class="{{ html_classes('rounded-md mb-4', { 'py-4': modal == true, 'p-4': modal == false, 'bg-red-50': level == 'error', 'bg-green-50': level == 'success', 'bg-blue-50': level == 'info' }) }}">
<div class="flex">
<div class="shrink-0">
{% if level == 'error' %}
@@ -36,4 +39,4 @@
{% endif %}
</div>
</div>
</div>
</div>
+24 -3
View File
@@ -1,9 +1,30 @@
{% if app.session.flashBag.peek('error')|length > 0 %}
{% include '_partials/_alert.html.twig' with { level: 'error', messages: app.flashes('error') } %}
{% embed '_partials/_modal.html.twig' with { 'level': 'error', 'modal': true } %}
{% block title %}
Fehler
{% endblock %}
{% block content %}
{% include '_partials/_alert.html.twig' with { level: 'error', messages: app.flashes('error') } %}
{% endblock %}
{% endembed %}
{% endif %}
{% if app.session.flashBag.peek('success')|length > 0 %}
{% include '_partials/_alert.html.twig' with { level: 'success', messages: app.flashes('success') } %}
{% embed '_partials/_modal.html.twig' with { 'level': 'success', 'modal': true } %}
{% block title %}
OK
{% endblock %}
{% block content %}
{% include '_partials/_alert.html.twig' with { level: 'success', messages: app.flashes('success') } %}
{% endblock %}
{% endembed %}
{% endif %}
{% if app.session.flashBag.peek('info')|length > 0 %}
{% include '_partials/_alert.html.twig' with { level: 'info', messages: app.flashes('info') } %}
{% embed '_partials/_modal.html.twig' with { 'level': 'info', 'modal': true } %}
{% block title %}
Hinweis
{% endblock %}
{% block content %}
{% include '_partials/_alert.html.twig' with { level: 'info', messages: app.flashes('info') } %}
{% endblock %}
{% endembed %}
{% endif %}
+1
View File
@@ -0,0 +1 @@
<svg class="{{ class }}"><use href="{{ asset('build/images/icons.svg') }}#icon-{{ icon }}"/></svg>

After

Width:  |  Height:  |  Size: 99 B

+22
View File
@@ -0,0 +1,22 @@
<div class="fixed inset-0 w-full h-full z-50" {{ stimulus_controller('modal') }} {{ stimulus_action('modal', 'close', 'modal-close@window') }}>
<div class="absolute inset-0 w-full h-full bg-black/80" {{ stimulus_action('modal', 'close', 'click') }}></div>
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 px-4 w-full max-w-2xl">
<div class="{{ html_classes('relative py-8 rounded-md', { 'bg-red-50': level == 'error', 'bg-green-50': level == 'success', 'bg-blue-50': level == 'info' }) }}">
<div class="{{ html_classes('flex justify-between pb-4 px-8', { 'text-red-800': level == 'error', 'text-green-800': level == 'success', 'text-blue-800': level == 'info' }) }}">
<div class="text-2xl font-medium">
{% block title %}{% endblock %}
</div>
<button type="button"
class="inline-block"
{{ stimulus_action('modal', 'close') }}>
{{ icon('close', 'w-6 h-6')}}
</button>
</div>
<div class="max-h-96 overflow-y-scroll">
<div class="{{ html_classes('px-8', { 'text-red-700': level == 'error', 'text-green-700': level == 'success', 'text-blue-700': level == 'info' }) }}">
{% block content %}{% endblock %}
</div>
</div>
</div>
</div>
</div>