Permalink
Browse files

Add services to layout.

  • Loading branch information...
1 parent 4754151 commit dbd27a50bb0d4efc991f8eaaadf2c804fd768103 @llun committed Mar 3, 2013
Showing with 24 additions and 8 deletions.
  1. +15 −1 routes/index.js
  2. +9 −7 views/layout.jade
View
@@ -1,9 +1,23 @@
+var q = require('q');
+
var Card = require('../models/card'),
Service = require('../models/service');
module.exports = {
index: function (req, res) {
- res.render('index');
+ var query = Service.find().sort('name');
+ q.nfcall(query.exec.bind(query))
+ .then(function (services) {
+ res.render('index', {
+ services: services
+ });
+ })
+ .fail(function (err) {
+ res.render('index', {
+ services: []
+ });
+ });
+
},
login: function (req, res) {
View
@@ -25,13 +25,15 @@ html
.span4.offset2
nav
ul.social
- li: a.twitter(href='https://twitter.com/llun', target='_blank')
- li: a.gplus(href='#', target='_blank')
- li: a.flickr(href='#', target='_blank')
- li: a.instagram(href='#', target='_blank')
- li: a.linkedin(href='#', target='_blank')
- li: a.github(href='#', target='_blank')
- li: a.foursquare(href='#', target='_blank')
+ each service in services
+ li: a(class='#{service.name}', href='#{service.accountUrl}', target='_blacnk')
+ //- li: a.twitter(href='https://twitter.com/llun', target='_blank')
+ //- li: a.gplus(href='#', target='_blank')
+ //- li: a.flickr(href='#', target='_blank')
+ //- li: a.instagram(href='#', target='_blank')
+ //- li: a.linkedin(href='#', target='_blank')
+ //- li: a.github(href='#', target='_blank')
+ //- li: a.foursquare(href='#', target='_blank')
ul.menu
if user

0 comments on commit dbd27a5

Please sign in to comment.