summaryrefslogtreecommitdiff
path: root/pages/shop/_product
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-09-07 20:22:47 +0600
committerunwox <me@unwox.com>2025-09-07 22:16:39 +0600
commit88d1725520afde9fe10a3daa1ad5c1c0a552f041 (patch)
tree04069377658ac0b6c2fa903e0d2b42e8f2221031 /pages/shop/_product
parent4b0373bb42e21153f63d33f3546be9095d495f27 (diff)
small fixes
Diffstat (limited to 'pages/shop/_product')
-rw-r--r--pages/shop/_product/edit.fnl10
-rw-r--r--pages/shop/_product/index.fnl22
2 files changed, 18 insertions, 14 deletions
diff --git a/pages/shop/_product/edit.fnl b/pages/shop/_product/edit.fnl
index 9465d94..7e7548d 100644
--- a/pages/shop/_product/edit.fnl
+++ b/pages/shop/_product/edit.fnl
@@ -1,4 +1,4 @@
-(import-macros {:compile-html <>} :macros)
+(import-macros {:compile-html HTML} :macros)
(local templates (require :templates))
(local {: product-form} (require :pages.shop.add))
(local forms (require :forms))
@@ -14,6 +14,10 @@
products.title,
products.position,
products.short_description,
+ products.recommendations,
+ products.year,
+ products.season,
+ products.region,
products.stock,
products.type,
products.packaging,
@@ -42,10 +46,10 @@
(error "empty data for insert SQL-statement"))))
(fn content [form data errors authenticated?]
- [(<>
+ [(HTML
[:div {:class "side"}
(templates.header "/shop" authenticated?)])
- (<>
+ (HTML
[:div {:class "content"}
[:div {:class "mb-1"}
[:a {:href (.. "/shop/" data.name)} "⟵ Обратно к товару"]]
diff --git a/pages/shop/_product/index.fnl b/pages/shop/_product/index.fnl
index 722c952..2904b61 100644
--- a/pages/shop/_product/index.fnl
+++ b/pages/shop/_product/index.fnl
@@ -1,4 +1,4 @@
-(import-macros {:compile-html <>} :macros)
+(import-macros {:compile-html HTML} :macros)
(local templates (require :templates))
(local dicts (require :dicts))
(local lib (require :lib))
@@ -41,25 +41,25 @@
(for [i 1 5]
(table.insert images (. product (.. "image" i))))
- [(<>
+ [(HTML
[:div {:class "side"}
(templates.header "/shop" authenticated?)])
- (<>
+ (HTML
[:div {:class "content"}
[:div {:class "mb-1"} [:a {:href "/shop"} "⟵ Обратно к списку"]]
(let [link (.. "/static/files/" product.image1)]
- (<> [:a {:href link :target "_blank"}
- [:img {:class "product-page-img-mobile mb-1-5"
- :src (.. link "-thumbnail.jpg")}]]))
+ (HTML [:a {:href link :target "_blank"}
+ [:img {:class "product-page-img-mobile mb-1-5"
+ :src (.. link "-thumbnail.jpg")}]]))
[:div {:class "product-page-layout"}
[:div {}
[:h2 {:class "product-page-title mb-1"} product.title]
[:section {:class "mb-2"}
(if authenticated?
- (<> [:div {:class "mb-0-5"}
- [:a {:href (.. "/shop/" product.name "/edit")}
- "✎ Редактировать"]])
+ (HTML [:div {:class "mb-0-5"}
+ [:a {:href (.. "/shop/" product.name "/edit")}
+ "✎ Редактировать"]])
"")
[:div {:class "mb-0-5" :style "font-style: italic;"}
(or (dicts.label dicts.tea-type product.type) product.type) ", "
@@ -71,8 +71,8 @@
(table.concat
(icollect [idx image (ipairs images)]
(let [link (.. "/static/files/" image)]
- (<> [:a {:href link :target "_blank"}
- [:img {:class "product-page-img" :src (.. link "-thumbnail.jpg")}]]))))]]])])
+ (HTML [:a {:href link :target "_blank"}
+ [:img {:class "product-page-img" :src (.. link "-thumbnail.jpg")}]]))))]]])])
(fn render [request db authenticated?]
(let [product (find-product db request.params._product)]