diff options
-rwxr-xr-x | guix-web | 2 | ||||
-rw-r--r-- | js/guix-packages.js (renamed from js/guix-web.js) | 9 |
2 files changed, 8 insertions, 3 deletions
@@ -118,7 +118,7 @@ (define javascripts '("/js/underscore.js" "/js/mithril.js" - "/js/guix-web.js")) + "/js/guix-packages.js")) (define (run-route request) (match (cons (request-method request) diff --git a/js/guix-web.js b/js/guix-packages.js index 8cdbd53..9c4c450 100644 --- a/js/guix-web.js +++ b/js/guix-packages.js @@ -40,6 +40,12 @@ guix.controller = function() { }; guix.view = function(ctrl) { + function renderName(package) { + var name = package.name; + + return m("a", { href: "/package/".concat(name) }, name); + } + function renderHomepage(package) { if(package.homepage) { return m("a", { href: package.homepage }, package.homepage); @@ -65,7 +71,6 @@ guix.view = function(ctrl) { } return [ - m("h1", "GNU Guix"), m("h2", [ "Packages", m("span.badge", ctrl.packages().length) @@ -94,7 +99,7 @@ guix.view = function(ctrl) { m("tbody", [ ctrl.visiblePackages().map(function(package) { return m("tr", [ - m("td", package.name), + m("td", renderName(package)), m("td", package.version), m("td", package.synopsis), m("td", renderHomepage(package)), |