summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/fetch.fnl2
-rw-r--r--bin/serve.fnl10
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/fetch.fnl b/bin/fetch.fnl
index c51d0f9..3dcaded 100644
--- a/bin/fetch.fnl
+++ b/bin/fetch.fnl
@@ -7,6 +7,7 @@
(local ipuer (require :parser.ipuer))
(local artoftea (require :parser.artoftea))
(local clubcha (require :parser.clubcha))
+(local chaekshop (require :parser.chaekshop))
(local db (luna.db.open "file:var/db.sqlite?_journal=WAL&_sync=NORMAL"))
(luna.db.exec db "
@@ -72,6 +73,7 @@
FROM products;" [])
(luna.db.commit tx))
+(store-products (chaekshop.products))
(store-products (clubcha.products))
(store-products (artoftea.products))
(store-products (ipuer.products))
diff --git a/bin/serve.fnl b/bin/serve.fnl
index eb56d8a..bec5a94 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -56,6 +56,11 @@
:alt "Логотип Железный Феникс"}
[:img {:src "/static/clubcha.png"}]
"Железный Феникс"]
+ (= name "chaekshop")
+ [:a {:class "site-icon" :href "https://chaekshop.ru"
+ :alt "Логотип Интернет-магазин фермерского китайского чая «Чаёк»"}
+ [:img {:src "/static/chaekshop.svg"}]
+ "Интернет-магазин «Чаёк»"]
""))
(fn item-template [product]
@@ -75,7 +80,8 @@
(< 0 product.price-per))
[:NO-ESCAPE (.. " (" product.price-per "₽ за&nbsp;1&nbsp;гр.)")]
"")]
- [:small {} (unescape (str.truncate product.description 200))]])
+ ;; FIXME: security issue
+ [:small {} [:NO-ESCAPE (unescape (str.truncate product.description 200))]]])
(fn paginator-template [query page limit total]
(local last-page (math.ceil (/ total limit)))
@@ -120,7 +126,7 @@
:alt "Логотип meicha.ru" :title "Логотип meicha.ru"}])
[:form {:class "form"}
[:input {:type :search :name :query :value query
- :autofocus true :placeholder "Введите поисковый запрос"}]
+ :autofocus true :placeholder "Поисковый запрос"}]
[:button {:type :submit} "Искать"]]
paginator]]
[:section {}