diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-07 07:55:20 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-07 07:55:20 -0400 |
commit | 04bd443162b063bce43f602f26dc5ace24e6a6f8 (patch) | |
tree | 3c176686a3bf5c9b2209537ef6119400aa15b904 | |
parent | 1bf4ad2c41c91c36d7b685a40dbeccc2ee8399b3 (diff) |
Add LibreJS weblabels page.
* guix-web (javascripts): Use absolute paths.
(run-route): Add weblabels route.
(all-packages): Add js license information link.
(weblabels): New procedure.
-rwxr-xr-x | guix-web | 34 |
1 files changed, 31 insertions, 3 deletions
@@ -115,9 +115,9 @@ ;;; (define javascripts - '("js/underscore.js" - "js/mithril.js" - "js/guix-web.js")) + '("/js/underscore.js" + "/js/mithril.js" + "/js/guix-web.js")) (define (run-route request) (match (cons (request-method request) @@ -128,6 +128,8 @@ (render-html (all-packages))) ((GET "packages.json") (render-json (all-packages-json))) + ((GET "weblabels") + (render-html (weblabels))) (_ #f))) (define (all-packages-json) @@ -176,8 +178,34 @@ (body (div (@ (id "guix") (class "container"))) + (footer + (small + (a (@ (href "/weblabels") + (rel "jslicense")) + "JavaScript license information"))) ,@(map script-tag javascripts)))) +(define (weblabels) + (define (weblabel js) + `(tr + (td + (a (@ (href ,js)) + ,(basename js))) + (td + (a (@ (href "http://www.gnu.org/licenses/agpl-3.0.html")) + ,(license-name agpl3+))) + (td + (a (@ (href ,js)) + ,(basename js))))) + + `(html + (head + (title "GNU Guix")) + (body + (div (@ (class "container")) + (table (@ (id "jslicense-labels1")) + ,@(map weblabel javascripts)))))) + (spawn-server (make-tcp-server-socket #:port 37146)) (run-server (lambda args (apply handler args))) |