summaryrefslogtreecommitdiff
path: root/pages/shop/_product
diff options
context:
space:
mode:
Diffstat (limited to 'pages/shop/_product')
-rw-r--r--pages/shop/_product/index.fnl18
1 files changed, 12 insertions, 6 deletions
diff --git a/pages/shop/_product/index.fnl b/pages/shop/_product/index.fnl
index 91ec765..4bcf579 100644
--- a/pages/shop/_product/index.fnl
+++ b/pages/shop/_product/index.fnl
@@ -68,7 +68,7 @@
"")
(if (not (lib.empty? product.region)) (.. product.region ", ") "")
(if (= product.packaging "piece")
- (HTML [:strong {} product.price-per "₽ за 1 шт. "])
+ (HTML [:strong {} product.price-per "₽"])
(HTML [:span {}
[:strong {} [:NO-ESCAPE
(* 50 product.price-per)
@@ -88,11 +88,17 @@
(HTML [:div {} [:NO-ESCAPE (text->html product.description)]])
"")]
[:div {:class "product-page-imgs"}
- (table.concat
- (icollect [idx image (ipairs images)]
- (let [link (.. "/static/files/" image)]
- (HTML [:a {:href link :target "_blank"}
- [:img {:class "product-page-img" :src (.. link "-thumbnail.jpg")}]]))))]]])])
+ (table.concat
+ (icollect [idx image (ipairs images)]
+ (let [link (.. "/static/files/" image)
+ video? (lib.ends-with? (_G.must (luna.utf8.lower image)) ".webm")]
+ (HTML
+ [:a {:href link :target "_blank"}
+ (if video?
+ (HTML [:video {:class "product-page-img" :autoplay true :loop true
+ :muted true}
+ [:source {:src (.. "/static/files/" image) :type "video/webm"}]])
+ (HTML [:img {:class "product-page-img" :src (.. link "-thumbnail.jpg")}]))]))))]]])])
(fn render [request db authenticated?]
(let [product (find-product db request.params._product)]