diff options
author | Christopher Baines <mail@cbaines.net> | 2019-07-22 21:11:09 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-07-22 21:11:09 +0100 |
commit | 7f8ffb4beaf25b02bea601b2a42cea1dc8720e0a (patch) | |
tree | 3f09b279c06df3caf87f52720cc5cfddffdc61c7 | |
parent | 05db0a87f92dbc705d0f9285becff22a2ffdc887 (diff) | |
download | data-service-7f8ffb4beaf25b02bea601b2a42cea1dc8720e0a.tar data-service-7f8ffb4beaf25b02bea601b2a42cea1dc8720e0a.tar.gz |
Show links to the cgit pages for repositories on the index page
-rw-r--r-- | guix-data-service/model/git-repository.scm | 2 | ||||
-rw-r--r-- | guix-data-service/web/view/html.scm | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/guix-data-service/model/git-repository.scm b/guix-data-service/model/git-repository.scm index 8eb7ee6..f460d0e 100644 --- a/guix-data-service/model/git-repository.scm +++ b/guix-data-service/model/git-repository.scm @@ -14,7 +14,7 @@ (exec-query conn (string-append - "SELECT id, label, url FROM git_repositories ORDER BY id ASC"))) + "SELECT id, label, url, cgit_url_base FROM git_repositories ORDER BY id ASC"))) (define (select-git-repository conn id) (match (exec-query diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index a126f4d..8773d73 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -233,12 +233,18 @@ (h1 "Guix Data Service"))) ,@(map (match-lambda - (((repository-id label url) . branches-with-most-recent-commits) + (((repository-id label url cgit-url-base) . branches-with-most-recent-commits) `(div (@ (class "row")) (div (@ (class "col-sm-12")) - (h3 ,url) + (h3 (@ (style "display: inline-block;")) + ,url) + ,@(if (string-null? cgit-url-base) + '() + `((a (@ (style "padding-left: 0.8em;") + (href ,cgit-url-base)) + "(View cgit)"))) ,(if (null? branches-with-most-recent-commits) '(p "No branches") (table/branches-with-most-recent-commits |