diff --git a/.cfignore b/.cfignore index 3270523..ea9ef4a 100644 --- a/.cfignore +++ b/.cfignore @@ -14,5 +14,4 @@ content db docs dist -test -www/cms-content \ No newline at end of file +test \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 8b52093..9fbe6e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -666,8 +666,8 @@ module.exports = function (grunt) { 'concurrent:dist', 'autoprefixer', 'concat', + //'ngmin', 'ngtemplates', - 'ngmin', 'copy:dist', //'cdnify', 'cssmin', diff --git a/app/index.html b/app/index.html index f232cbc..fa9a350 100755 --- a/app/index.html +++ b/app/index.html @@ -69,19 +69,18 @@
- +
- - + @@ -103,7 +102,6 @@ - diff --git a/package.json b/package.json index 2cb2cb3..e9f7a78 100755 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "finalhandler": "^0.3.3", "fs-extra": "^0.12.0", "http-proxy": "^1.3.0", + "jade": "^1.8.2", "jps-ds": "~0.0.2", "jquery": "~2.1.0", "jquery-file-upload-middleware": "~0.1.1", diff --git a/routes/cms-passport.js b/routes/cms-passport.js index 7ec03dd..c843d44 100644 --- a/routes/cms-passport.js +++ b/routes/cms-passport.js @@ -40,26 +40,28 @@ var cmsPassport = function(config, app) { for (var i = 0; i < u.emails.length; i++) { var email = u.emails[i].value; - + User.findOne({ email : email }, function(err, user) { if (err) { return done(err); } - + if (!user) { console.warn('create user', u); return done(null, false); } else { user.google = u; - user.update( { username: user.username }, user, function(){ + user.update({ + username : user.username + }, user, function() { console.warn('update user', u); - done(null, user); - } ); - + done(null, user); + }); + } - + }); } @@ -181,8 +183,12 @@ var cmsPassport = function(config, app) { app.use(express.static(path.resolve(config.staticDir))); app.use(express.static(path.resolve(config.publicDir))); //app.set('views', path.resolve(__dirname + path.sep + 'views')); - app.set('views', path.resolve(config.publicDir)); + //app.set('views', path.resolve(config.staticDir + path.sep + 'views')); //app.set('view engine', 'ejs'); + //app.set('view engine', 'html'); + + //app.set('views', __dirname + '/views'); + //app.engine('html', require('ejs').renderFile); //app.engine('ejs', require('ejs-locals')); app.use(cookieParser()); @@ -217,6 +223,7 @@ var cmsPassport = function(config, app) { message : 'Please login', status : 'info' }); + next(); }); app.get('/account', ensureAuthenticated, function(req, res) { @@ -227,7 +234,7 @@ var cmsPassport = function(config, app) { }); app.get('/login', function(req, res) { - res.render('login', { + res.json(200, { user : req.user, message : 'Please login', status : 'warning' diff --git a/routes/cms-server.js b/routes/cms-server.js index 4011cac..cf90fe8 100644 --- a/routes/cms-server.js +++ b/routes/cms-server.js @@ -40,7 +40,7 @@ module.exports = function (config, app) { console.log('cms-server', req.method); }); router.get('/', function(res, req, next){ - req.send(config.publicDir + path.sep + 'index.html'); + req.send(config.staticDir + path.sep + 'index.html'); next(); });