From a24b2b3de7995d28420f09c988fbb7ef31d0e15c Mon Sep 17 00:00:00 2001 From: unwox Date: Tue, 22 Oct 2024 00:47:37 +0600 Subject: move sites information to corresponding parser modules --- bin/serve.fnl | 36 +++++++++--------------------------- parser/artoftea.fnl | 2 +- parser/chaekshop.fnl | 2 +- parser/clubcha.fnl | 2 +- parser/ipuer.fnl | 2 +- parser/ozchai.fnl | 2 +- static/chaekshop.png | Bin 0 -> 2773 bytes static/chaekshop.svg | 3 --- static/ipuer.jpg | Bin 26929 -> 0 bytes static/ipuer.png | Bin 0 -> 28121 bytes static/ozchai.ico | Bin 32988 -> 0 bytes static/ozchai.png | Bin 0 -> 3164 bytes static/style.css | 6 +++++- 13 files changed, 19 insertions(+), 36 deletions(-) create mode 100644 static/chaekshop.png delete mode 100644 static/chaekshop.svg delete mode 100644 static/ipuer.jpg create mode 100644 static/ipuer.png delete mode 100644 static/ozchai.ico create mode 100644 static/ozchai.png diff --git a/bin/serve.fnl b/bin/serve.fnl index f9563ec..ade091b 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -228,28 +228,10 @@ 0)}) (fn site-name-template [name] - (if - (= name "ipuer") - [:a {:class "site-icon" :href "https://ipuer.ru"} - [:img {:src "/static/ipuer.jpg" :alt "Логотип Институт чай пуэр"}] - "Институт чая пуэр"] - (= name "artoftea") - [:a {:class "site-icon" :href "https://artoftea.ru"} - [:img {:src "/static/artoftea.png" :alt "Логотип Art of tea"}] - "Art of tea"] - (= name "ozchai") - [:a {:class "site-icon" :href "https://ozchai.ru"} - [:img {:src "/static/ozchai.ico" :alt "Логотип #OZCHAI"}] - "Чайная #OZCHAI"] - (= name "clubcha") - [:a {:class "site-icon" :href "https://clubcha.ru"} - [:img {:src "/static/clubcha.png" :alt "Логотип Железный Феникс"}] - "Железный Феникс"] - (= name "chaekshop") - [:a {:class "site-icon" :href "https://chaekshop.ru"} - [:img {:src "/static/chaekshop.svg" :alt "Логотип Интернет-магазин «Чаёк»"}] - "Интернет-магазин «Чаёк»"] - "")) + (local module (require (.. "parser." name))) + [:a {:class "site-icon" :href module.url} + [:img {:src (.. "/static/" name ".png") :alt (.. "Логотип " module.title)}] + module.title]) (fn item-template [product] [:div {:class "tile"} @@ -325,8 +307,8 @@ [:form {:class "form"} [:input {:type :search :name "query" :value form.query :autofocus true :placeholder "Поисковый запрос"}] - [:div {:class "form-tags"} - [:select {:class "form-tag" :name "tags"} + [:div {} + [:select {:name "tags"} [:option {:value ""} "~ Категория ~"] (table.unpack (map @@ -345,15 +327,15 @@ [:input {:type :checkbox :id "price-per" :name "price-per" :checked (if form.price-per "checked" nil)}] [:label {:for "price-per"} "цена за грамм"]] - [:div {:class "form-tags"} - [:select {:class "form-tag" :name "site"} + [:div {} + [:select {:name "site"} [:option {:value ""} "~ Сайт ~"] (table.unpack (map (fn [_ val] [:option {:value val :selected (if (= form.site val) "selected" nil)} - val]) + (. (require (.. "parser." val)) :title)]) [:ozchai :clubcha :ipuer :artoftea :chaekshop]))]] [:button {:type :submit} "Искать"]] paginator]]) diff --git a/parser/artoftea.fnl b/parser/artoftea.fnl index 5339a3f..7ad4e66 100644 --- a/parser/artoftea.fnl +++ b/parser/artoftea.fnl @@ -81,4 +81,4 @@ product-peg normalize)) -{: products} +{: products :title "Art of tea" :url "https://artoftea.ru"} diff --git a/parser/chaekshop.fnl b/parser/chaekshop.fnl index 13be8f1..b7699e9 100644 --- a/parser/chaekshop.fnl +++ b/parser/chaekshop.fnl @@ -85,4 +85,4 @@ product-peg normalize)) -{: products} +{: products :title "Чаёк" :url "https://chaekshop.ru"} diff --git a/parser/clubcha.fnl b/parser/clubcha.fnl index a32f767..71fbc0f 100644 --- a/parser/clubcha.fnl +++ b/parser/clubcha.fnl @@ -127,4 +127,4 @@ product-peg normalize)) -{: products} +{: products :title "Железный Феникс" :url "https://clubcha.ru"} diff --git a/parser/ipuer.fnl b/parser/ipuer.fnl index b16ead5..9a244e2 100644 --- a/parser/ipuer.fnl +++ b/parser/ipuer.fnl @@ -69,4 +69,4 @@ product-peg normalize)) -{: products} +{: products :title "Институт чая пуэр" :url "https://ipuer.ru"} diff --git a/parser/ozchai.fnl b/parser/ozchai.fnl index f1bbcae..41f5816 100644 --- a/parser/ozchai.fnl +++ b/parser/ozchai.fnl @@ -46,4 +46,4 @@ destruct-response normalize)) -{: products} +{: products :title "Чайная #OZCHAI" :url "https://ozchai.ru"} diff --git a/static/chaekshop.png b/static/chaekshop.png new file mode 100644 index 0000000..55e414d Binary files /dev/null and b/static/chaekshop.png differ diff --git a/static/chaekshop.svg b/static/chaekshop.svg deleted file mode 100644 index 00146bd..0000000 --- a/static/chaekshop.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/static/ipuer.jpg b/static/ipuer.jpg deleted file mode 100644 index 13d2c78..0000000 Binary files a/static/ipuer.jpg and /dev/null differ diff --git a/static/ipuer.png b/static/ipuer.png new file mode 100644 index 0000000..9faae99 Binary files /dev/null and b/static/ipuer.png differ diff --git a/static/ozchai.ico b/static/ozchai.ico deleted file mode 100644 index f3328c7..0000000 Binary files a/static/ozchai.ico and /dev/null differ diff --git a/static/ozchai.png b/static/ozchai.png new file mode 100644 index 0000000..85affb3 Binary files /dev/null and b/static/ozchai.png differ diff --git a/static/style.css b/static/style.css index 87aa40b..c47ae13 100644 --- a/static/style.css +++ b/static/style.css @@ -226,10 +226,14 @@ body { position: relative; } + .form-price-per input { + height: 1.5rem; + } + .form-price-per label { position: absolute; top: 0; - padding: 0.5rem 2rem; + padding: 0.25rem 2rem; left: 0; width: 100%; height: 100%; -- cgit v1.2.3