diff options
| author | unwox <me@unwox.com> | 2025-10-30 19:01:32 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-10-30 20:36:58 +0600 |
| commit | 4151e7a73ef0476b4aea5a356d391a7060b8a01c (patch) | |
| tree | a576a0017fa5fa0c368d39c270a1df99b79b6014 /pages/shop/index.fnl | |
| parent | b06fdc9c3b4b6dc0d5d60098303dd57d5c098e13 (diff) | |
small improvements here and there
Diffstat (limited to 'pages/shop/index.fnl')
| -rw-r--r-- | pages/shop/index.fnl | 28 |
1 files changed, 20 insertions, 8 deletions
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} |
