diff options
author | Christopher Baines <mail@cbaines.net> | 2019-05-12 19:51:44 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-05-12 20:45:33 +0100 |
commit | 0bdc555ff8645869bdfdf3710038f135403c052c (patch) | |
tree | dfdda4210863681031e74e4594a4d37a6fb205d8 /guix-data-service/web/view | |
parent | 8eac26b17d996e3e171c92e43536333daf72b7c9 (diff) | |
download | data-service-0bdc555ff8645869bdfdf3710038f135403c052c.tar data-service-0bdc555ff8645869bdfdf3710038f135403c052c.tar.gz |
Add some basic pagination to the packages page
Lower powered devices will have problems displaying all ~9000+ packages, so
return a smaller number by default.
Diffstat (limited to 'guix-data-service/web/view')
-rw-r--r-- | guix-data-service/web/view/html.scm | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index d7b5725..825835b 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -412,7 +412,9 @@ (td (samp ,count)))))) derivations-count))))))))) -(define (view-revision-packages revision-commit-hash packages) +(define (view-revision-packages revision-commit-hash + query-parameters + packages) (layout #:extra-headers '((cache-control . ((max-age . 60)))) @@ -430,6 +432,28 @@ (div (@ (class "row")) (div + (@ (class "col-md-12")) + (div + (@ (class "well")) + (form + (@ (method "get") + (action "") + (class "form-horizontal")) + ,(form-horizontal-control + "After name" query-parameters + #:help-text + "List packages that are alphabetically after the given name.") + ,(form-horizontal-control + "Limit results" query-parameters + #:help-text "The maximum number of packages by name to return.") + (div (@ (class "form-group form-group-lg")) + (div (@ (class "col-sm-offset-2 col-sm-10")) + (button (@ (type "submit") + (class "btn btn-lg btn-primary")) + "Update results"))))))) + (div + (@ (class "row")) + (div (@ (class "col-sm-12")) (h1 "Packages") (table @@ -453,7 +477,13 @@ "/revision/" revision-commit-hash "/package/" name "/" version))) "More information"))))) - packages))))))))) + packages))))) + (div + (@ (class "row")) + (a (@ (href ,(string-append "/revision/" revision-commit-hash + "/packages?after_name=" + (car (last packages))))) + "Next page")))))) (define (view-branches branches-with-most-recent-commits) (layout |