diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-08-15 19:44:14 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-08-15 19:44:33 +0200 |
commit | d49b5729a000530cba851114f098b8c6a2fad4a7 (patch) | |
tree | 73a3033bafe7fd2cdcd8dd3a3d52d3c0c2d46b42 /module/calp/html/view/search.scm | |
parent | Fix encode-query-parameters. (diff) | |
download | calp-d49b5729a000530cba851114f098b8c6a2fad4a7.tar.gz calp-d49b5729a000530cba851114f098b8c6a2fad4a7.tar.xz |
Fix paginator buttons forgetting future clause.
Diffstat (limited to 'module/calp/html/view/search.scm')
-rw-r--r-- | module/calp/html/view/search.scm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/module/calp/html/view/search.scm b/module/calp/html/view/search.scm index fd5000df..c356baec 100644 --- a/module/calp/html/view/search.scm +++ b/module/calp/html/view/search.scm @@ -3,15 +3,25 @@ :use-module (vcomponent) :use-module (vcomponent search) :use-module ((ice-9 pretty-print) :select (pretty-print)) + :use-module ((web uri-query) :select (encode-query-parameters)) :use-module ((calp html components) :select (xhtml-doc include-css)) :use-module ((calp html vcomponent) :select (compact-event-list)) ) +;; Display the result of a search term, but doesn't do any searching +;; on its own. +;; +;; @var{errors} : #f or SXML object to display instead of search result +;; @var{has-query?} : Does search-term actually contain anything, or should +;; it be handled as a blank query? +;; @var{search-term} : What was searched, as an SEXP +;; @var{search-result} : The list of matched events +;; @var{page} : Which page we are on +;; @var{paginator} : A paginator object (define-public (search-result-page - errors - has-query? search-term search-result page paginator q=) + errors has-query? search-term search-result page paginator) (xhtml-doc (@ (lang sv)) (head (title "Search results") @@ -38,5 +48,15 @@ paginator (lambda (p) (if (= p page) `(span ,p) - `(a (@ (href "?" ,q= "&p=" ,p)) ,p))) - (lambda (p) `(a (@ (href "?" ,q= "&p=" ,p)) "»"))))))))) + `(a (@ (href + "?" + ,(encode-query-parameters + `((p . ,p) + (q . ,search-term))))) + ,p))) + (lambda (p) `(a (@ (href + "?" + ,(encode-query-parameters + `((p . ,p) + (q . ,search-term))))) + "»"))))))))) |