summaryrefslogtreecommitdiff
path: root/bin/serve.fnl
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-11-05 13:51:12 +0600
committerunwox <me@unwox.com>2024-11-05 13:51:12 +0600
commitad9691cf051c205c992064ab9d6c46c2aba79dd6 (patch)
tree198e5ffb185e81f6b8b429acbce54651f839e44c /bin/serve.fnl
parent788523388d9e1c4531364958b261d0b6b84b1f87 (diff)
improve price formatting
Diffstat (limited to 'bin/serve.fnl')
-rw-r--r--bin/serve.fnl5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl
index 884fb4f..06ecd22 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -299,14 +299,15 @@
[:a {:href link :style "text-decoration: none;" :rel "nofollow"}
[:NO-ESCAPE (.. "<h2>" (unescape product.title) "</h2>")]]
[:div {:class "price"}
- (if product.price (.. product.price "₽") "")
+ (if product.price (.. (str.format-price product.price) "₽") "")
(if (< 0 product.weight)
[:NO-ESCAPE (.. "за&nbsp;" product.weight "&nbsp;гр.")]
"")
(if (and (< 1 product.weight)
product.price-per
(< 0 product.price-per))
- [:NO-ESCAPE (.. " (" product.price-per "₽ за&nbsp;1&nbsp;гр.)")]
+ [:NO-ESCAPE (.. "<br> (" (str.format-price product.price-per)
+ "₽ за&nbsp;1&nbsp;гр.)")]
"")]])
(fn paginator-template [form page limit total]