forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreloadcontroller-list-into-partial.diff
92 lines (90 loc) · 2.96 KB
/
reloadcontroller-list-into-partial.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
diff --git a/templates/product_admin/_list.html.twig b/templates/product_admin/_list.html.twig
new file mode 100644
index 0000000..b03c9c3
--- /dev/null
+++ b/templates/product_admin/_list.html.twig
@@ -0,0 +1,37 @@
+<table class="table">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>Name</th>
+ <th>Description</th>
+ <th>Brand</th>
+ <th>Weight</th>
+ <th>Price</th>
+ <th>StockQuantity</th>
+ <th>ImageFilename</th>
+ <th>actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for product in products %}
+ <tr>
+ <td>{{ product.id }}</td>
+ <td>{{ product.name }}</td>
+ <td>{{ product.description }}</td>
+ <td>{{ product.brand }}</td>
+ <td>{{ product.weight }}</td>
+ <td>{{ product.price }}</td>
+ <td>{{ product.stockQuantity }}</td>
+ <td>{{ product.imageFilename }}</td>
+ <td>
+ <a href="{{ path('product_admin_show', {'id': product.id}) }}">show</a>
+ <a href="{{ path('product_admin_edit', {'id': product.id}) }}">edit</a>
+ </td>
+ </tr>
+ {% else %}
+ <tr>
+ <td colspan="9">no records found</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/templates/product_admin/index.html.twig b/templates/product_admin/index.html.twig
index 18fe40f..2c53b56 100644
--- a/templates/product_admin/index.html.twig
+++ b/templates/product_admin/index.html.twig
@@ -27,43 +27,7 @@
</div>
</div>
- <table class="table">
- <thead>
- <tr>
- <th>Id</th>
- <th>Name</th>
- <th>Description</th>
- <th>Brand</th>
- <th>Weight</th>
- <th>Price</th>
- <th>StockQuantity</th>
- <th>ImageFilename</th>
- <th>actions</th>
- </tr>
- </thead>
- <tbody>
- {% for product in products %}
- <tr>
- <td>{{ product.id }}</td>
- <td>{{ product.name }}</td>
- <td>{{ product.description }}</td>
- <td>{{ product.brand }}</td>
- <td>{{ product.weight }}</td>
- <td>{{ product.price }}</td>
- <td>{{ product.stockQuantity }}</td>
- <td>{{ product.imageFilename }}</td>
- <td>
- <a href="{{ path('product_admin_show', {'id': product.id}) }}">show</a>
- <a href="{{ path('product_admin_edit', {'id': product.id}) }}">edit</a>
- </td>
- </tr>
- {% else %}
- <tr>
- <td colspan="9">no records found</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ {{ include('product_admin/_list.html.twig') }}
<a href="{{ path('product_admin_new') }}">Create new</a>
</div>