diff --git a/assets/controllers/modal_controller.js b/assets/controllers/modal_controller.js new file mode 100644 index 0000000..cf64a54 --- /dev/null +++ b/assets/controllers/modal_controller.js @@ -0,0 +1,7 @@ +import { Controller } from '@hotwired/stimulus' + +export default class extends Controller { + close() { + this.element.remove() + } +} diff --git a/templates/_partials/_alert.html.twig b/templates/_partials/_alert.html.twig index 2ab7b04..cd982be 100644 --- a/templates/_partials/_alert.html.twig +++ b/templates/_partials/_alert.html.twig @@ -1,4 +1,7 @@ -
+{% if modal is not defined %} + {% set modal = false %} +{% endif %} + \ No newline at end of file +
diff --git a/templates/_partials/_flashes.html.twig b/templates/_partials/_flashes.html.twig index c886b4d..637de56 100644 --- a/templates/_partials/_flashes.html.twig +++ b/templates/_partials/_flashes.html.twig @@ -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 %} diff --git a/templates/_partials/_icon.html.twig b/templates/_partials/_icon.html.twig new file mode 100644 index 0000000..e0b0040 --- /dev/null +++ b/templates/_partials/_icon.html.twig @@ -0,0 +1 @@ + diff --git a/templates/_partials/_modal.html.twig b/templates/_partials/_modal.html.twig new file mode 100644 index 0000000..4e57cf9 --- /dev/null +++ b/templates/_partials/_modal.html.twig @@ -0,0 +1,22 @@ +
+
+
+
+
+
+ {% block title %}{% endblock %} +
+ +
+
+
+ {% block content %}{% endblock %} +
+
+
+
+
diff --git a/templates/base.html.twig b/templates/base.html.twig index bb6ce1c..38c6a88 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -10,7 +10,7 @@ {{ encore_entry_script_tags('app') }} {% endblock %} - + {% block body %}{% endblock %} diff --git a/templates/booking/index.html.twig b/templates/booking/index.html.twig index fed7c97..fe29b80 100644 --- a/templates/booking/index.html.twig +++ b/templates/booking/index.html.twig @@ -40,9 +40,9 @@ {% if booking.travelData %} - {{ booking.travelData.dateFrom | date('d.m.Y') }} - {{ booking.travelData.dateTo | date('d.m.Y') }} + {{ booking.travelData.dateFrom|date('d.m.Y') }} - {{ booking.travelData.dateTo|date('d.m.Y') }} {% else %} - {{ booking.travelDate | date('d.m.Y') }} + {{ booking.travelDate|date('d.m.Y') }} {% endif %} +
+
+
+
+
+ {% block title %}{% endblock %} +
+ +
+
+
+ {% block content %}{% endblock %} +
+
+
+ {% include '_partials/_spinner.html.twig' with { 'class': 'w-8 h-8'} %} +
+
+
+ diff --git a/templates/layout.html.twig b/templates/layout.html.twig index efe218d..69e1d3c 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -1,19 +1,23 @@ {% extends 'base.html.twig' %} {% block body %} -
-
- {% if is_granted('ROLE_USER') %} - - {% endif %} +
+
+
+ {% if is_granted('ROLE_USER') %} + + {% endif %} +
+
+
+ {% block content %}{% endblock %} + {% include '_partials/_loading_indicator.html.twig' %}
- {% block content %}{% endblock %} - {% include '_partials/_loading_indicator.html.twig' %}
-{% endblock %} \ No newline at end of file +{% endblock %}