aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-16 22:44:07 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-16 22:44:07 +0100
commitf04690f38c549ae3ab5754d56560b29b7e5506f0 (patch)
treecc6a0f2ea2f0d15ca2e2f72165420efb9b828303
parentdfb1da3197cf9d839754400794ecd651dfdcd52c (diff)
downloaddata-service-f04690f38c549ae3ab5754d56560b29b7e5506f0.tar
data-service-f04690f38c549ae3ab5754d56560b29b7e5506f0.tar.gz
Add a View JSON button to the packages page
-rw-r--r--guix-data-service/web/view/html.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 05d3b60..510da9d 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -490,6 +490,7 @@
(form
(@ (method "get")
(action "")
+ (style "padding-bottom: 0")
(class "form-horizontal"))
,(form-horizontal-control
"Search query" query-parameters
@@ -516,6 +517,19 @@
(@ (class "row"))
(div
(@ (class "col-sm-12"))
+ (a (@ (class "btn btn-default btn-lg pull-right")
+ (href ,(let ((query-parameter-string
+ (query-parameters->string query-parameters)))
+ (string-append
+ "/revision/" revision-commit-hash "/packages.json"
+ (if (string-null? query-parameter-string)
+ ""
+ (string-append "?" query-parameter-string))))))
+ "View JSON")))
+ (div
+ (@ (class "row"))
+ (div
+ (@ (class "col-sm-12"))
(h1 "Packages")
(table
(@ (class "table table-responsive"))