aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-14 21:32:47 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-21 19:54:54 +0000
commit7c611402a0f7444322fc4e4c48fecd4b6dbd5efa (patch)
tree28548954af35304f77ab88cda4cabd2925b5f536
parent759ced5c9d62dfd877c73e768546f6ec895454d2 (diff)
downloaddata-service-7c611402a0f7444322fc4e4c48fecd4b6dbd5efa.tar
data-service-7c611402a0f7444322fc4e4c48fecd4b6dbd5efa.tar.gz
Add a basic page for derivation source files
Just so that the links work.
-rw-r--r--guix-data-service/web/controller.scm16
-rw-r--r--guix-data-service/web/view/html.scm14
2 files changed, 25 insertions, 5 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index feac0f1..1e8d46a 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -148,11 +148,17 @@
(let ((derivation (select-derivation-by-output-filename conn filename)))
(match derivation
(()
- (render-html
- #:sxml (general-not-found
- "Store item not found"
- "No derivation found producing this output")
- #:code 404))
+ (match (select-derivation-source-file-by-store-path conn filename)
+ (()
+ (render-html
+ #:sxml (general-not-found
+ "Store item not found"
+ "No derivation found producing this output")
+ #:code 404))
+ ((id)
+ (render-html
+ #:sxml (view-derivation-source-file filename)
+ #:extra-headers http-headers-for-unchanging-content))))
(derivations
(render-html
#:sxml (view-store-item filename
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index e6de895..1792440 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -47,6 +47,7 @@
view-derivation
view-formatted-derivation
view-store-item
+ view-derivation-source-file
error-page))
(define* (header)
@@ -516,6 +517,19 @@
derivations
derivations-using-store-item-list)))))
+(define (view-derivation-source-file filename)
+ (layout
+ #:body
+ `(,(header)
+ (div
+ (@ (class "container"))
+ (div
+ (@ (class "row"))
+ (div
+ (@ (class "col-sm-12"))
+ ,(display-store-item-title filename)
+ "Derivation source file."))))))
+
(define (view-derivation derivation derivation-inputs derivation-outputs
builds)
(layout