From a104fbc5e1cd1485c2ce97e555d91d28f3c6eb67 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 3 Oct 2019 22:08:06 +0100 Subject: Link from the revision package page to the version history page --- guix-data-service/web/controller.scm | 6 +++++- guix-data-service/web/view/html.scm | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index e63a75d..13b315d 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -293,7 +293,10 @@ (let ((package-versions (select-package-versions-for-revision conn commit-hash - name))) + name)) + (git-repositories-and-branches + (git-branches-with-repository-details-for-commit conn + commit-hash))) (case (most-appropriate-mime-type '(application/json text/html) mime-types) @@ -306,6 +309,7 @@ #:sxml (view-revision-package commit-hash name package-versions + git-repositories-and-branches #:path-base path-base #:header-text header-text #:header-link header-link) diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index b5c6175..3005af6 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -312,6 +312,7 @@ (define* (view-revision-package revision-commit-hash name versions + git-repositories-and-branches #:key path-base header-text header-link) @@ -330,6 +331,19 @@ (@ (class "row")) (div (@ (class "col-sm-12")) + ,(append-map + (match-lambda + (((id label url cgit-url-base) . branches) + (map (match-lambda + ((branch-name datetime) + `(a (@ (class "btn btn-default btn-lg pull-right") + (href ,(simple-format + #f "/repository/~A/branch/~A/package/~A" + id branch-name name))) + ,(simple-format #f "View ~A branch version history" + branch-name)))) + branches))) + git-repositories-and-branches) (h1 "Package " ,name))) (div (@ (class "row")) -- cgit v1.2.3