Improve the Unknown revision page

Make it similar to the revision page, as some of the information, like the
link to the relevant CGit instance might be available.
This commit is contained in:
Christopher Baines 2019-06-19 22:03:55 +01:00
parent 3df0b43146
commit e93b8f948e
2 changed files with 50 additions and 10 deletions

View file

@ -151,7 +151,8 @@
#:sxml (unknown-revision
commit-hash
(select-job-for-commit
conn commit-hash))))))
conn commit-hash)
(git-branches-with-repository-details-for-commit conn commit-hash))))))
(define* (render-revision-packages mime-types
conn

View file

@ -1471,20 +1471,59 @@
(h1 ,header-text)
(p ,body)))))
(define (unknown-revision commit-hash job)
(define (unknown-revision commit-hash job git-repositories-and-branches)
(layout
#:body
`(,(header)
(div
(@ (class "container"))
(h1 "Unknown revision")
(p "No known revision with commit "
(strong (samp ,commit-hash))
,(match job
,@(match job
(()
" and it is not currently queued for processing")
((job)
" but it is queued for processing")))))))
`((h1 "Unknown revision")
(p "No known revision with commit "
(strong (samp ,commit-hash)))))
((jobs ...)
`((div
(@ (class "row"))
(div
(@ (class "col-md-12"))
(h1 (@ (style "white-space: nowrap;"))
"Revision " (samp ,commit-hash))))
(div
(@ (class "row"))
(div
(@ (class "col-md-6"))
(h2 "Packages")
(strong (@ (class "text-center")
(style "font-size: 2em; display: block;"))
"Unknown")
,@(if
(null? git-repositories-and-branches)
'()
`((h3 "Git repositories")
,@(map
(match-lambda
(((label url cgit-url-base) . branches)
`((h4 ,url)
,@(map
(match-lambda
((name datetime)
(if (string-null? cgit-url-base)
`(,name " at " ,datetime)
`(a (@ (href ,(string-append
cgit-url-base
"commit/?id="
commit-hash)))
,name " at " ,datetime))))
branches))))
git-repositories-and-branches))))
(div
(@ (class "col-md-6"))
(h3 "Derivations")
(strong (@ (class "text-center")
(style "font-size: 2em; display: block;"))
"Unknown"))))))))))
(define (compare-unknown-commit base-commit target-commit
base-exists? target-exists?