From 88d1725520afde9fe10a3daa1ad5c1c0a552f041 Mon Sep 17 00:00:00 2001 From: unwox Date: Sun, 7 Sep 2025 20:22:47 +0600 Subject: small fixes --- pages/shop/_product/edit.fnl | 10 +++++++--- pages/shop/_product/index.fnl | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'pages/shop/_product') 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)] -- cgit v1.2.3