From 4151e7a73ef0476b4aea5a356d391a7060b8a01c Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 30 Oct 2025 19:01:32 +0600 Subject: small improvements here and there --- pages/shop/index.fnl | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'pages/shop/index.fnl') diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl index 0d78b0a..63a1cc9 100644 --- a/pages/shop/index.fnl +++ b/pages/shop/index.fnl @@ -7,6 +7,12 @@ (local pagination-limit 12) +(local texts { + :address + (lib.improve-typography + "г. Омск, ул. Пушкина, д. 133/9, этаж 2. Вход с крыльца Магнита, дверь + слева, домофон 4. Дверь в офисе узнаете по нашему логотипу.")}) + (fn all-products [db page filters] (local where-stmts []) (local where-args []) @@ -125,22 +131,24 @@ "left: calc(100% / " (# without-videos) " * " (- idx 1) ")")}]))))]] [:a {:href item-url} [:h3 {:class "shop-item-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)] - (templates.product-overview product "mb-0-25 font-size-0-875") [:div {} product.short-description]])) -(fn content [db products page total filters basket authenticated?] +(fn content [db products page total filters basket agreed-to-cookies? authenticated?] (local redirect-url (filters-path page filters)) [(HTML [:aside {} (templates.header "/shop" authenticated?) (if (< 0 (# basket)) (templates.basket basket redirect-url) "") - ;; [:section {} [:h2 {} "Условия"] [:p {} ""]] - ]) + (templates.address-block) + (templates.conditions-block) + (templates.contact-block)]) (HTML [:div {:class "content"} + (if (not agreed-to-cookies?) (templates.cookies-agreement) "") [:div {:class "back"} [:a {:href "/"} "⟵ Обратно на главную"]] [:h2 {:class "product-page-title"} "Магазин"] (if authenticated? @@ -172,7 +180,8 @@ (paginator-template filters page pagination-limit total "mt-2")])]) (fn render [request db authenticated?] - (let [order-id (shop.order-id request) + (let [agreed-to-cookies? request.cookies.agreed-to-cookies + order-id request.cookies.order basket (if order-id (shop.basket db order-id) []) type (if (and request.query.type (not (lib.empty? (. request.query.type 1)))) @@ -189,8 +198,11 @@ only-published? (not authenticated?) filters {: type : search : page : only-published?} {: total : products} (all-products db page filters)] - (values 200 {} (templates.base - (content db products page total - filters basket authenticated?))))) + (values 200 {} + (templates.base + (content db products page total filters basket + agreed-to-cookies? authenticated?) + "Магазин чая" + "Купить вкусный китайский чай с доставкой по Омску")))) {: render} -- cgit v1.2.3