Skip to content

Commit

Permalink
refactor: list projects on machine pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaixhin committed Oct 30, 2015
1 parent dd77e45 commit 56dbd99
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions views/machine.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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}]

0 comments on commit 56dbd99

Please sign in to comment.