feat: streamlined alerts

This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent 518bc7339f
commit 6dfd8fd3ef
4 changed files with 23 additions and 17 deletions
+10
View File
@@ -0,0 +1,10 @@
{% set type = type|default('info') %}
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 text-gray-100 rounded-md', { 'bg-blue-600': type == 'info', 'bg-red-600': type == 'warning' }) }}">
{{ icon('alert', 'w-5 h-5 flex-shrink-0') }}
<div class="leading-relaxed text-base">
{% block message %}
{{ message | nl2br }}
{% endblock %}
</div>
</div>
@@ -22,13 +22,15 @@
{% endif %} {% endif %}
{% if teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %} {% if teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %}
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-6"> {% embed '_partials/_alert.html.twig' with { 'type': 'warning' } %}
Dein zuletzt hochgeladener Führerschein wurde abgelehnt. {% block message %}
{% if teamer.driverLicenseReviewComment %} Dein zuletzt hochgeladener Führerschein wurde abgelehnt.
<br> {% if teamer.driverLicenseReviewComment %}
Begründung: {{ teamer.driverLicenseReviewComment }} <br>
{% endif %} Begründung: {{ teamer.driverLicenseReviewComment }}
</div> {% endif %}
{% endblock %}
{% endembed %}
{% endif %} {% endif %}
<div class="flex flex-col space-y-4 pb-6"> <div class="flex flex-col space-y-4 pb-6">
+3 -7
View File
@@ -12,12 +12,8 @@
{% include '_partials/_toast.html.twig' with { level: 'info', messages: ['Bitte lade ein Foto von dir hoch'] } %} {% include '_partials/_toast.html.twig' with { level: 'info', messages: ['Bitte lade ein Foto von dir hoch'] } %}
{% endif %} {% endif %}
{% if news is not null %} {% if news is not null %}
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 text-gray-100 rounded-md', { 'bg-blue-600': news.status == 1, 'bg-red-600': news.status == 2 }) }}"> {% set alertType = news.status == 2 ? 'warning' : 'info' %}
{{ icon('alert', 'w-5 h-5 flex-shrink-0') }} {% include '_partials/_alert.html.twig' with { 'type': alertType, 'message': news.message } %}
<div class="leading-relaxed text-base">
{{ news.message | nl2br }}
</div>
</div>
{% endif %} {% endif %}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8"> <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2"> <div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
@@ -169,4 +165,4 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
+1 -3
View File
@@ -54,9 +54,7 @@
Mein Profil Mein Profil
</h1> </h1>
{% if verification_mode %} {% if verification_mode %}
<div class="border border-blue-500 rounded-md p-4 text-blue-700 bg-blue-50 mb-8"> {% include '_partials/_alert.html.twig' with { 'message': 'Bitte überprüfe deine Daten und bestätige sie am Ende des Formulars.' } %}
Bitte überprüfe deine Daten und bestätige sie am Ende des Formulars.
</div>
{% endif %} {% endif %}
{% if not form.vars.valid %} {% if not form.vars.valid %}
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-8"> <div class="border border-red-500 rounded-md p-4 text-red-500 mb-8">