summaryrefslogtreecommitdiff
path: root/templates.fnl
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-10-30 20:44:04 +0600
committerunwox <me@unwox.com>2025-10-30 20:44:04 +0600
commitf5b81c32cfb20b67f2944408fb64c87b2d4e309d (patch)
tree61bcebecd41ad547543d849bc6936e48a729771e /templates.fnl
parent4151e7a73ef0476b4aea5a356d391a7060b8a01c (diff)
add extra data for parsers
Diffstat (limited to 'templates.fnl')
-rw-r--r--templates.fnl22
1 files changed, 13 insertions, 9 deletions
diff --git a/templates.fnl b/templates.fnl
index ea51075..d7d83e3 100644
--- a/templates.fnl
+++ b/templates.fnl
@@ -95,23 +95,27 @@
(HTML
[:div {:class classes :style "font-style: italic"}
- (or (dicts.label dicts.product-type product.type) product.type) ", "
+ [:span {:data-parser "type"}
+ (or (dicts.label dicts.product-type product.type) product.type) ", "]
(if (not (lib.empty? product.year))
- (HTML [:span {} [:NO-ESCAPE (.. product.year "&nbsp;год, ")]])
+ (HTML [:span {:data-parser "year"}
+ [:NO-ESCAPE (.. product.year "&nbsp;год, ")]])
"")
(if (not (lib.empty? product.volume))
- (HTML [:span {} [:NO-ESCAPE (.. product.volume "&nbsp;мл., ")]])
+ (HTML [:span {:data-parser "volume"}
+ [:NO-ESCAPE (.. product.volume "&nbsp;мл., ")]])
"")
(if (not (lib.empty? product.region)) (.. product.region ", ") "")
(if (= product.packaging "piece")
- (HTML [:strong {} (lib.format-price product.price-per) "₽"])
+ (HTML [:strong {:data-parser "price"}
+ (lib.format-price product.price-per) "₽"])
(HTML [:span {}
- [:strong {}
- [:NO-ESCAPE
- (lib.format-price (* 50 product.price-per))
- "₽ за&nbsp;50&nbsp;грамм "]]
+ [:strong {:data-parser "price"}
+ [:NO-ESCAPE
+ (lib.format-price (* 50 product.price-per))
+ "₽ за&nbsp;50&nbsp;грамм "]]
[:NO-ESCAPE "(" (lib.format-price product.price-per)
- "₽ за&nbsp;1&nbsp;грамм)"]]))]))
+ "₽ за&nbsp;1&nbsp;грамм)"]]))]))
(fn add-to-basket-form [product basket classes redirect-url]
(fn quantity-steps [stock step]