summaryrefslogtreecommitdiff
path: root/templates.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'templates.fnl')
-rw-r--r--templates.fnl78
1 files changed, 64 insertions, 14 deletions
diff --git a/templates.fnl b/templates.fnl
index 6ebf19c..ea51075 100644
--- a/templates.fnl
+++ b/templates.fnl
@@ -6,23 +6,22 @@
(with-open [f (io.open file "r")]
(f:read :*all)))
-(fn base [content]
+(fn base [content title description]
(HTML
[:html {:lang "ru-RU"}
[:head {}
- [:title {} "«Белая жаба» — маленькая уютная чайная в Омске"]
+ [:title {} (.. "«Белая жаба» / " (or title "Уютный чайный клуб в Омске"))]
[:meta {:charset "utf-8"}]
[:meta {:name "viewport"
:content (.. "width=device-width,initial-scale=1,"
"minimum-scale=1.0,maximum-scale=5.0")}]
[:meta {:name "description"
- :content (.. "Маленькая уютная чайная: "
- "Омск, ул. Пушкина, д. 133/9, этаж 2. "
- "Посещение по предварительной договоренности, "
- "стоимость 500 рублей с человека.")}]
+ :content (or description
+ (.. "Уютный чайный клуб в Омске: "
+ "ул. Пушкина, д. 133/9, этаж 2. "
+ "Посещение по предварительной договоренности."))}]
[:style {} [:NO-ESCAPE (read-file "static/style.css")]]
- [:link {:rel "icon" :href "/static/favicon.svg"
- :type "image/svg+xml"}]]
+ [:link {:rel "icon" :href "/static/favicon.svg" :type "image/svg+xml"}]]
[:body {}
[:main {:class "container"} (table.concat content)]]]))
@@ -44,12 +43,15 @@
logo)
[:h1 {} [:NO-ESCAPE "Чайный&nbsp;клуб<br>«Белая&nbsp;жаба»"]]]
[:nav {}
- [:a {:href "/shop" :class (if (lib.starts-with? current-path "/shop") "active" "")}
+ [:a {:href "/shop"
+ :class (if (lib.starts-with? current-path "/shop") "active" "")}
"магазин"]
- [:span {} "~"]
- [:a {:href "https://t.me/whitetoadtea"} "телеграм"]
- [:span {} "~"]
- [:a {:href "https://vk.com/whitetoadtea"} "вконтакте"]]]))
+ [:span {} "–"]
+ [:a {:href "/information"
+ :class (if (= current-path "/information") "active" "")}
+ "информация"]
+ [:span {} "–"]
+ [:a {:href "https://t.me/whitetoadtea"} "телеграм"]]]))
(fn basket-item [item redirect-url]
(local item-link (.. "/shop/" item.name))
@@ -154,6 +156,38 @@
[:button (fn [] {:type "submit" :disabled disabled})
(if in-basket-quantity "В корзине" "Добавить")]]))
+(fn contact-block []
+ (HTML
+ [:section {}
+ [:h2 {} "Как связаться"]
+ [:p {}
+ "Телеграм: "
+ [:a {:href "https://t.me/whitetoadvlad"} "@whitetoadvlad"]
+ [:br {}]
+ "Почта: "
+ [:a {:href "mailto:vlad@whitetoad.ru"} "vlad@whitetoad.ru"]]]))
+
+(fn address-block []
+ (HTML
+ [:section {}
+ [:h2 {} "Адрес"]
+ [:p {} [:NO-ESCAPE
+ ;; FIXME: lib.improve-typography is too slow for this text for
+ ;; some reason
+ "г.&nbsp;Омск, ул.&nbsp;Пушкина, д.&nbsp;133/9, этаж&nbsp;2. Вход
+ с&nbsp;крыльца Магнита, дверь слева, домофон&nbsp;4. Дверь
+ в&nbsp;офисе узнаете по&nbsp;нашему логотипу."]]]))
+
+(fn conditions-block []
+ "")
+ ;; (HTML
+ ;; [:section {}
+ ;; [:h2 {} "Условия"]
+ ;; [:p {}
+ ;; (lib.improve-typography
+ ;; (.. "Доставка по Омску Яндекс-курьером.
+ ;; Доставка по России обговаривается отдельно."))]]))
+
(fn order-lines [order-lines]
(HTML
[:div {:class "order mb-0-5"}
@@ -182,6 +216,18 @@
{:class (.. "order-state order-state-" state)}
(dicts.label dicts.order-state state)]))
+(fn cookies-agreement []
+ (HTML
+ [:div {:class "cookies-agreement"}
+ [:span {:class "mr-0-5"}
+ "Продолжая использовать сайт, вы даете согласие на использование куки
+ для сохранения вашей корзины."]
+ [:button {:type "button"
+ :onclick
+ (.. "document.cookie='agreed-to-cookies=true;path=/shop;Max-Age=34560000';"
+ "this.parentElement.remove();")}
+ "Хорошо"]]))
+
{: base
: header
: basket-item
@@ -189,4 +235,8 @@
: product-overview
: add-to-basket-form
: order-lines
- : order-state}
+ : order-state
+ : contact-block
+ : address-block
+ : conditions-block
+ : cookies-agreement}