summaryrefslogtreecommitdiff
path: root/pages/shop
diff options
context:
space:
mode:
Diffstat (limited to 'pages/shop')
-rw-r--r--pages/shop/index.fnl8
1 files changed, 6 insertions, 2 deletions
diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl
index 6b0f79b..58ff288 100644
--- a/pages/shop/index.fnl
+++ b/pages/shop/index.fnl
@@ -3,6 +3,7 @@
(local shop (require :shop))
(local dicts (require :dicts))
(local templates (require :templates))
+(local synonyms (require :synonyms))
(fn all-products [db filters authenticated?]
(local where-stmts [])
@@ -18,7 +19,10 @@
(when filters.search
(table.insert where-stmts "products_search MATCH ?")
- (table.insert where-args filters.search)
+ (var query (synonyms.replace filters.search))
+ (when (not (lib.ends-with? query "*"))
+ (set query (.. query "*")))
+ (table.insert where-args query)
(set has-search-query? true))
(local where
@@ -109,7 +113,7 @@
[:a {:style "white-space: nowrap; margin-left: 1rem;"
:href (.. "/shop/order/list")} "☰ Список заказов"]])
"")
- [:form {:class "d-flex gap-0-5 mb-1"}
+ [:form {:class "d-flex-desktop gap-0-5 mb-1"}
[:input {:name "search" :type "search"
:placeholder "Поиск" :value (or filters.search "")}]
[:select {:name "type"}