diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/serve.fnl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/serve.fnl b/bin/serve.fnl index 1fc7bd9..669c3e0 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -289,8 +289,8 @@ ORDER BY %s ROW_NUMBER() over (PARTITION BY products.site ORDER BY products.ROWID), rank - LIMIT 48 OFFSET ?" where-sql sort-sql) - (array.concat query-args [(* (- page 1) 48)]))) + LIMIT 24 OFFSET ?" where-sql sort-sql) + (array.concat query-args [(* (- page 1) 24)]))) :total (if (< 0 (# total)) (. total 1 1) 0)}) @@ -378,7 +378,7 @@ (item "/yellow-tea" "Желтый чай") (item "/teaware" "Посуда")]) -(fn aside-template [form path paginator] +(fn aside-template [form path aside-content] [:aside {:class "aside"} [:div {:class "aside-content"} (if (or (not (form-empty? form)) (~= path "/")) @@ -431,7 +431,7 @@ :selected (if (= form.sort "expensive-first") "selected" nil)} "Сначала дороже"]]] [:button {:type :submit} "Искать"]] - (if paginator "")]]) + (if aside-content aside-content "")]]) (fn home-template [] [:div {} @@ -494,6 +494,7 @@ [:small {:class "text"} [:NO-ESCAPE texts.footer-text]]]]]]]]) (fn root-handler [{: path : query}] + ;; FIXME: do not run render-listing when cache is hit (local cache-key (.. "page:" path "?" (serialize-query query))) (local cached (cache.get db cache-key)) @@ -530,9 +531,9 @@ spellfix-suggestion spellfix-suggestion)] [:NO-ESCAPE texts.no-results])]) - [:div {} (paginator-template form form.page 48 total 17)]] + [:div {} (paginator-template form form.page 24 total 17)]] ;; aside - (paginator-template form form.page 48 total 7))) + (paginator-template form form.page 24 total 7))) (values 200 headers |
