forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodalframe-turn-modal-into-frame.diff
33 lines (32 loc) · 1.23 KB
/
modalframe-turn-modal-into-frame.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/templates/_modal.html.twig b/templates/_modal.html.twig
index ae97d92..f893b54 100644
--- a/templates/_modal.html.twig
+++ b/templates/_modal.html.twig
@@ -12,13 +12,14 @@
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
- <div
+ <turbo-frame
class="modal-body"
data-modal-form-target="modalBody"
data-action="submit->modal-form#submitForm"
+ src="{{ modalSrc }}"
>
{{ modalContent|default('Loading...') }}
- </div>
+ </turbo-frame>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">Cancel
diff --git a/templates/product_admin/index.html.twig b/templates/product_admin/index.html.twig
index 113281f..b1ff5b1 100644
--- a/templates/product_admin/index.html.twig
+++ b/templates/product_admin/index.html.twig
@@ -25,6 +25,7 @@
{{ include('_modal.html.twig', {
modalTitle: 'Add a new Product',
+ modalSrc: path('product_admin_new'),
}) }}
</div>
</div>