diff options
-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))) |