diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/serve.fnl | 36 |
1 files changed, 9 insertions, 27 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]]) |
