Add an all results option to the packages page
This commit is contained in:
parent
0a7e6a76f3
commit
e92e095ee9
2 changed files with 12 additions and 3 deletions
|
|
@ -151,7 +151,8 @@
|
||||||
#f))))
|
#f))))
|
||||||
|
|
||||||
(let* ((search-query (assq-ref query-parameters 'search_query))
|
(let* ((search-query (assq-ref query-parameters 'search_query))
|
||||||
(limit-results (assq-ref query-parameters 'limit_results))
|
(limit-results (or (assq-ref query-parameters 'limit_results)
|
||||||
|
99999)) ; TODO There shouldn't be a limit
|
||||||
(fields (assq-ref query-parameters 'field))
|
(fields (assq-ref query-parameters 'field))
|
||||||
(packages
|
(packages
|
||||||
(if search-query
|
(if search-query
|
||||||
|
|
@ -563,10 +564,14 @@
|
||||||
(field ,identity #:multi-value
|
(field ,identity #:multi-value
|
||||||
#:default ("version" "synopsis"))
|
#:default ("version" "synopsis"))
|
||||||
(search_query ,identity)
|
(search_query ,identity)
|
||||||
(limit_results ,parse-result-limit #:default 100)))
|
(limit_results ,parse-result-limit
|
||||||
|
#:no-default-when (all_results)
|
||||||
|
#:default 100)
|
||||||
|
(all_results ,parse-checkbox-value)))
|
||||||
;; You can't specify a search query, but then also limit the
|
;; You can't specify a search query, but then also limit the
|
||||||
;; results by filtering for after a particular package name
|
;; results by filtering for after a particular package name
|
||||||
'((after_name search_query)))))
|
'((after_name search_query)
|
||||||
|
(limit_results all_results)))))
|
||||||
|
|
||||||
(render-revision-packages mime-types
|
(render-revision-packages mime-types
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
|
|
@ -527,6 +527,10 @@
|
||||||
,(form-horizontal-control
|
,(form-horizontal-control
|
||||||
"Limit results" query-parameters
|
"Limit results" query-parameters
|
||||||
#:help-text "The maximum number of packages by name to return.")
|
#:help-text "The maximum number of packages by name to return.")
|
||||||
|
,(form-horizontal-control
|
||||||
|
"All results" query-parameters
|
||||||
|
#:type "checkbox"
|
||||||
|
#:help-text "Return all results.")
|
||||||
(div (@ (class "form-group form-group-lg"))
|
(div (@ (class "form-group form-group-lg"))
|
||||||
(div (@ (class "col-sm-offset-2 col-sm-10"))
|
(div (@ (class "col-sm-offset-2 col-sm-10"))
|
||||||
(button (@ (type "submit")
|
(button (@ (type "submit")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue