summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-07 17:33:13 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-07 17:33:13 -0400
commit2804e28ef22ded73a95da4508f7630db1db3c97d (patch)
treea5be9863a5260206a5272ec895a779a37112cf4d
parent863d76769a7e90f00f5b003a5bcfe8758054cf27 (diff)
Rename guix-web.js to guix-packages.js.
* guix-web (javascripts): Update. * js/guix-packages.js: New file. * js/guix-web.js: Delete it.
-rwxr-xr-xguix-web2
-rw-r--r--js/guix-packages.js (renamed from js/guix-web.js)9
2 files changed, 8 insertions, 3 deletions
diff --git a/guix-web b/guix-web
index 4ef25a4..d628987 100755
--- a/guix-web
+++ b/guix-web
@@ -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)),