summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pages/shop/index.fnl5
-rw-r--r--templates.fnl22
2 files changed, 16 insertions, 11 deletions
diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl
index 63a1cc9..2486bc3 100644
--- a/pages/shop/index.fnl
+++ b/pages/shop/index.fnl
@@ -115,6 +115,7 @@
[:a {:href item-url}
[:div {:class "shop-item-imgs"}
[:img {:class "shop-item-img"
+ :data-parser "image"
:src (.. "/static/files/" (. product.image1) "-thumbnail.jpg")}]
(table.concat
(let [without-videos
@@ -130,11 +131,11 @@
"width: calc(100% / " (# without-videos) ");"
"left: calc(100% / " (# without-videos) " * " (- idx 1) ")")}]))))]]
[:a {:href item-url}
- [:h3 {:class "shop-item-title"} product.title]]
+ [:h3 {:class "shop-item-title" :data-parser "title"} product.title]]
(templates.product-overview product "mb-0-25 font-size-0-875")
[:div {:class "shop-item-price"}
(templates.add-to-basket-form product basket "" redirect-url)]
- [:div {} product.short-description]]))
+ [:div {:data-parser "description"} product.short-description]]))
(fn content [db products page total filters basket agreed-to-cookies? authenticated?]
(local redirect-url (filters-path page filters))
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 " год, ")]])
+ (HTML [:span {:data-parser "year"}
+ [:NO-ESCAPE (.. product.year " год, ")]])
"")
(if (not (lib.empty? product.volume))
- (HTML [:span {} [:NO-ESCAPE (.. product.volume " мл., ")]])
+ (HTML [:span {:data-parser "volume"}
+ [:NO-ESCAPE (.. product.volume " мл., ")]])
"")
(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))
- "₽ за 50 грамм "]]
+ [:strong {:data-parser "price"}
+ [:NO-ESCAPE
+ (lib.format-price (* 50 product.price-per))
+ "₽ за 50 грамм "]]
[:NO-ESCAPE "(" (lib.format-price product.price-per)
- "₽ за 1 грамм)"]]))]))
+ "₽ за 1 грамм)"]]))]))
(fn add-to-basket-form [product basket classes redirect-url]
(fn quantity-steps [stock step]