diff --git a/templates/_partials/_alert.html.twig b/templates/_partials/_alert.html.twig new file mode 100644 index 0000000..a680fcd --- /dev/null +++ b/templates/_partials/_alert.html.twig @@ -0,0 +1,10 @@ +{% set type = type|default('info') %} + +
+ {{ icon('alert', 'w-5 h-5 flex-shrink-0') }} +
+ {% block message %} + {{ message | nl2br }} + {% endblock %} +
+
diff --git a/templates/teamer/check/driver_license.html.twig b/templates/teamer/check/driver_license.html.twig index fdb213c..372a3d9 100644 --- a/templates/teamer/check/driver_license.html.twig +++ b/templates/teamer/check/driver_license.html.twig @@ -22,13 +22,15 @@ {% endif %} {% if teamer.driverLicenseStatus == constant('App\\Entity\\Teamer::DRIVER_LICENSE_STATUS_DENIED') %} -
- Dein zuletzt hochgeladener Führerschein wurde abgelehnt. - {% if teamer.driverLicenseReviewComment %} -
- Begründung: {{ teamer.driverLicenseReviewComment }} - {% endif %} -
+ {% embed '_partials/_alert.html.twig' with { 'type': 'warning' } %} + {% block message %} + Dein zuletzt hochgeladener Führerschein wurde abgelehnt. + {% if teamer.driverLicenseReviewComment %} +
+ Begründung: {{ teamer.driverLicenseReviewComment }} + {% endif %} + {% endblock %} + {% endembed %} {% endif %}
diff --git a/templates/teamer/index.html.twig b/templates/teamer/index.html.twig index 180b774..13649b4 100644 --- a/templates/teamer/index.html.twig +++ b/templates/teamer/index.html.twig @@ -12,12 +12,8 @@ {% include '_partials/_toast.html.twig' with { level: 'info', messages: ['Bitte lade ein Foto von dir hoch'] } %} {% endif %} {% if news is not null %} -
- {{ icon('alert', 'w-5 h-5 flex-shrink-0') }} -
- {{ news.message | nl2br }} -
-
+ {% set alertType = news.status == 2 ? 'warning' : 'info' %} + {% include '_partials/_alert.html.twig' with { 'type': alertType, 'message': news.message } %} {% endif %}
@@ -169,4 +165,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/teamer/profile/index.html.twig b/templates/teamer/profile/index.html.twig index de73e63..39259e9 100644 --- a/templates/teamer/profile/index.html.twig +++ b/templates/teamer/profile/index.html.twig @@ -54,9 +54,7 @@ Mein Profil {% if verification_mode %} -
- Bitte überprüfe deine Daten und bestätige sie am Ende des Formulars. -
+ {% include '_partials/_alert.html.twig' with { 'message': 'Bitte überprüfe deine Daten und bestätige sie am Ende des Formulars.' } %} {% endif %} {% if not form.vars.valid %}