forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodal-customize-modal-header-buttons.diff
44 lines (42 loc) · 1.63 KB
/
modal-customize-modal-header-buttons.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
34
35
36
37
38
39
40
41
42
43
44
diff --git a/templates/_modal.html.twig b/templates/_modal.html.twig
index 8b1b18f..6161b48 100644
--- a/templates/_modal.html.twig
+++ b/templates/_modal.html.twig
@@ -7,20 +7,20 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
- <h5 class="modal-title">Modal title</h5>
+ <h5 class="modal-title">{{ modalTitle }}</h5>
<button type="button" class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
- ...
+ {{ modalContent|default('Loading...') }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
- data-bs-dismiss="modal">Close
+ data-bs-dismiss="modal">Cancel
</button>
<button type="button" class="btn btn-primary">
- Understood
+ Save
</button>
</div>
</div>
diff --git a/templates/product_admin/index.html.twig b/templates/product_admin/index.html.twig
index 2315288..9e6b821 100644
--- a/templates/product_admin/index.html.twig
+++ b/templates/product_admin/index.html.twig
@@ -13,7 +13,9 @@
data-action="modal-form#openModal"
>Add+</button>
- {{ include('_modal.html.twig') }}
+ {{ include('_modal.html.twig', {
+ modalTitle: 'Add a new Product',
+ }) }}
</div>
</div>