summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/shop/_product/index.fnl14
1 files changed, 12 insertions, 2 deletions
diff --git a/pages/shop/_product/index.fnl b/pages/shop/_product/index.fnl
index 30cbc33..6903144 100644
--- a/pages/shop/_product/index.fnl
+++ b/pages/shop/_product/index.fnl
@@ -57,11 +57,21 @@
(HTML
[:div {:class "content"}
(if (not agreed-to-cookies?) (templates.cookies-agreement) "")
- [:div {:class "back"} [:a {:href "/shop"} "⟵ Обратно к списку"]]
+ ;; this method of going back to the list requires JS and is bug prone but
+ ;; at the same time it's the simplest one. doing the same thing without
+ ;; JS would require storing "back URL" in query parameter (which will make
+ ;; URLs ugly and also hurt SEO) or in a cookie (which is brittle)
+ ;; TODO: also add <noscript> version of this link
+ [:div {:class "back"} [:a {:href "#"
+ :onclick "history.length > 1
+ ? history.back()
+ : location.assign('/shop')"}
+ "⟵ Обратно к списку"]]
[:div {:class "product-page-layout"}
[:section {}
- [:h2 {:class "product-page-title" :id "content"} product.title]
+ [:div {:id "content"} ""]
+ [:h2 {:class "product-page-title"} product.title]
(if authenticated?
(HTML
[:div {:class "mb-1" :style "margin-top: -0.5rem;"}