forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamstats-refactor-to-quickstats-template.diff
28 lines (28 loc) · 1.27 KB
/
streamstats-refactor-to-quickstats-template.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
diff --git a/templates/product/_quickStats.html.twig b/templates/product/_quickStats.html.twig
new file mode 100644
index 0000000..ab6e450
--- /dev/null
+++ b/templates/product/_quickStats.html.twig
@@ -0,0 +1,5 @@
+<strong>{{ product.priceString|format_currency('USD') }}</strong>
+<br>
+<strong>{{ product.reviews|length }}</strong> Reviews
+<br/>
+<strong>{{ product.averageStars }}/5</strong><i class="fas fa-star ms-2"></i>
diff --git a/templates/product/show.html.twig b/templates/product/show.html.twig
index 6c050c1..d2ab874 100644
--- a/templates/product/show.html.twig
+++ b/templates/product/show.html.twig
@@ -31,11 +31,7 @@
</div>
<div class="p-3 mt-4 d-flex justify-content-between flex-wrap flex-lg-nowrap">
<div id="product-quick-stats">
- <strong>{{ product.priceString|format_currency('USD') }}</strong>
- <br>
- <strong>{{ product.reviews|length }}</strong> Reviews
- <br/>
- <strong>{{ product.averageStars }}/5</strong><i class="fas fa-star ms-2"></i>
+ {{ include('product/_quickStats.html.twig') }}
</div>
<div>
{{ include('product/_cart_add_controls.html.twig') }}