Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: llun/blog
base: 4754151f20
...
head fork: llun/blog
compare: 0e32efb6e1
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 25 additions and 10 deletions.
  1. +14 −3 app.js
  2. +2 −0  routes/index.js
  3. +9 −7 views/layout.jade
View
17 app.js
@@ -4,7 +4,8 @@ var express = require('express'),
less_middleware = require('less-middleware'),
marked = require('marked'),
moment = require('moment'),
- path = require('path'),
+ path = require('path')
+ q = require('q'),
_ = require('underscore');
_.str = require('underscore.string');
@@ -15,7 +16,8 @@ var configuration = require('./configuration'),
comments = require('./routes/comments'),
services = require('./routes/services');
-var User = require('./models/user');
+var User = require('./models/user'),
+ Service = require('./models/service');
var passport = require('passport'),
LocalStrategy = require('passport-local').Strategy;
@@ -88,7 +90,16 @@ app.configure(function(){
app.use(function (req, res, next) {
res.locals.user = req.user;
res.locals.flash = req.flash();
- next();
+ var query = Service.find().sort('name');
+ q.nfcall(query.exec.bind(query))
+ .then(function (services) {
+ res.locals.services = services;
+ next();
+ })
+ .fail(function (err) {
+ res.locals.services = [];
+ next();
+ })
});
app.use(app.router);
View
2  routes/index.js
@@ -1,3 +1,5 @@
+var q = require('q');
+
var Card = require('../models/card'),
Service = require('../models/service');
View
16 views/layout.jade
@@ -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

No commit comments for this range

Something went wrong with that request. Please try again.