summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-10-22 00:47:37 +0600
committerunwox <me@unwox.com>2024-10-22 00:47:37 +0600
commita24b2b3de7995d28420f09c988fbb7ef31d0e15c (patch)
tree36b3b135d6b46f8ed87101f913531bfe9d281a64
parent190ce50d172f9d2b1d2114f43fa80e92f28da03e (diff)
move sites information to corresponding parser modules
-rw-r--r--bin/serve.fnl36
-rw-r--r--parser/artoftea.fnl2
-rw-r--r--parser/chaekshop.fnl2
-rw-r--r--parser/clubcha.fnl2
-rw-r--r--parser/ipuer.fnl2
-rw-r--r--parser/ozchai.fnl2
-rw-r--r--static/chaekshop.pngbin0 -> 2773 bytes
-rw-r--r--static/chaekshop.svg3
-rw-r--r--static/ipuer.jpgbin26929 -> 0 bytes
-rw-r--r--static/ipuer.pngbin0 -> 28121 bytes
-rw-r--r--static/ozchai.icobin32988 -> 0 bytes
-rw-r--r--static/ozchai.pngbin0 -> 3164 bytes
-rw-r--r--static/style.css6
13 files changed, 19 insertions, 36 deletions
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
--- /dev/null
+++ b/static/chaekshop.png
Binary files 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 @@
-<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M86.7327 48.8756L81.7889 39.3407H65.7517L54.3689 33L42.9861 39.2454H27.1901L21.0164 51.164L6.25731 40.8425L1 43.6076L14.5291 64.6797L3.79747 86.8246H109.764L110.752 82.7722L117.119 56.5512L117.264 55.9076L117.891 53.357L119 48.8518L86.7327 48.8756ZM54.3689 36.2657L59.795 39.2454H48.9428L54.3689 36.2657ZM19.4247 77.0513L33.0503 49.6861H75.5187L89.4337 77.0513H19.4247ZM103.445 81.342L90.7118 56.5751H110.174L103.445 81.342Z" fill="#65A30D"/>
-</svg>
diff --git a/static/ipuer.jpg b/static/ipuer.jpg
deleted file mode 100644
index 13d2c78..0000000
--- a/static/ipuer.jpg
+++ /dev/null
Binary files differ
diff --git a/static/ipuer.png b/static/ipuer.png
new file mode 100644
index 0000000..9faae99
--- /dev/null
+++ b/static/ipuer.png
Binary files differ
diff --git a/static/ozchai.ico b/static/ozchai.ico
deleted file mode 100644
index f3328c7..0000000
--- a/static/ozchai.ico
+++ /dev/null
Binary files differ
diff --git a/static/ozchai.png b/static/ozchai.png
new file mode 100644
index 0000000..85affb3
--- /dev/null
+++ b/static/ozchai.png
Binary files 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%;