From f04690f38c549ae3ab5754d56560b29b7e5506f0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 16 May 2019 22:44:07 +0100 Subject: [PATCH] Add a View JSON button to the packages page --- guix-data-service/web/view/html.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 @@ -512,6 +513,19 @@ (button (@ (type "submit") (class "btn btn-lg btn-primary")) "Update results"))))))) + (div + (@ (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