Add a very basic repositories page
This commit is contained in:
parent
6bc753dd0e
commit
744ab9366b
3 changed files with 40 additions and 1 deletions
|
|
@ -289,6 +289,8 @@
|
|||
(count-derivations conn))))
|
||||
(('GET "revision" args ...)
|
||||
(delegate-to revision-controller))
|
||||
(('GET "repositories")
|
||||
(delegate-to repository-controller))
|
||||
(('GET "repository" _ ...)
|
||||
(delegate-to repository-controller))
|
||||
(('GET "gnu" "store" filename)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@
|
|||
(uri-path (request-uri request)))
|
||||
|
||||
(match method-and-path-components
|
||||
(('GET "repositories")
|
||||
(let ((git-repositories (all-git-repositories conn)))
|
||||
(render-html
|
||||
#:sxml
|
||||
(view-git-repositories git-repositories))))
|
||||
(('GET "repository" id)
|
||||
(match (select-git-repository conn id)
|
||||
((label url cgit-url-base)
|
||||
|
|
|
|||
|
|
@ -21,12 +21,44 @@
|
|||
#:use-module (ice-9 match)
|
||||
#:use-module (guix-data-service web html-utils)
|
||||
#:use-module (guix-data-service web view html)
|
||||
#:export (view-git-repository
|
||||
#:export (view-git-repositories
|
||||
view-git-repository
|
||||
view-branches
|
||||
view-branch
|
||||
view-branch-package
|
||||
view-branch-package-derivations))
|
||||
|
||||
(define* (view-git-repositories git-repositories)
|
||||
(layout
|
||||
#:body
|
||||
`(,(header)
|
||||
(div
|
||||
(@ (class "container"))
|
||||
(div
|
||||
(@ (class "row"))
|
||||
(div
|
||||
(@ (class "col-md-12"))
|
||||
(h1 "Git repositories")))
|
||||
,@(map
|
||||
(match-lambda
|
||||
((id label url cgit-base-url)
|
||||
`(div
|
||||
(@ (class "row"))
|
||||
(div
|
||||
(@ (class "col-md-12"))
|
||||
(h3 ,url)
|
||||
(a (@ (href ,(string-append "/repository/" (number->string id))))
|
||||
"View repository")
|
||||
(dl
|
||||
(@ (class "dl-horizontal"))
|
||||
(dt "Label")
|
||||
(dd ,label)
|
||||
(dt "URL")
|
||||
(dd ,url)
|
||||
(dt "cgit base URL")
|
||||
(dd ,cgit-base-url))))))
|
||||
git-repositories)))))
|
||||
|
||||
(define* (view-git-repository git-repository-id
|
||||
label url cgit-url-base
|
||||
branches-with-most-recent-commits)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue