diff --git a/lab.js b/lab.js index da142a3..9dc55e3 100644 --- a/lab.js +++ b/lab.js @@ -547,8 +547,15 @@ app.get("/projects/:id/experiments", function(req, res, next) { // Machine page app.get("/machines/:id", function(req, res, next) { db.machines.findByIdAsync(req.params.id) - .then(function(result) { - res.render("machine", {machine: result}); + .then(function(mac) { + // TODO Retrieve supported projects + db.projects.find({}, {name: 1}).sort({name: 1}).toArrayAsync() + .then(function(projects) { + res.render("machine", {machine: mac, projects: projects}); + }) + .catch(function(err) { + next(err); + }); }) .catch(function(err) { next(err); diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 2f8209f..8426bd9 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -2,6 +2,11 @@ div.container, h1, h2, h3 { margin-top: 1rem; } +.dl-horizontal { + margin-left: 0; + margin-right: 0; +} + .mega-octicon { font-size: 2.5rem; } diff --git a/views/machine.jade b/views/machine.jade index af8c802..2f07a45 100644 --- a/views/machine.jade +++ b/views/machine.jade @@ -27,3 +27,5 @@ block content li= gpu h2 Projects ul.list-unstyled + - each project in projects + li #[a(href="/projects/" + project._id) #{project.name}]