summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-11-21 12:20:32 +0600
committerunwox <me@unwox.com>2024-11-21 12:28:27 +0600
commit05351c539603d699394a2f523634ab373162ec12 (patch)
tree7c0cc8c7cb01664962ae7e1b7f6fd446f75e05fd
parent56cd7f285ac9b28d44292e78c3363e0d81b05aa5 (diff)
make the container thinner
-rw-r--r--bin/serve.fnl13
-rw-r--r--static/style.css3
2 files changed, 8 insertions, 8 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
diff --git a/static/style.css b/static/style.css
index b7b1683..912b809 100644
--- a/static/style.css
+++ b/static/style.css
@@ -15,7 +15,7 @@ h1, h2, h3, h4, h5, h6 {
}
.container {
- max-width: 82.5rem;
+ max-width: 68rem;
margin: 0 auto;
}
@@ -167,7 +167,6 @@ h1, h2, h3, h4, h5, h6 {
}
.text {
- max-width: 50rem;
display: block;
margin: 0;
}