From 7eb42b129702fa3fda67f50913b00cc85e49f116 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 16 Apr 2013 14:19:21 +0200 Subject: added dashboard --- router.js | 15 ++++++++++----- views/dashboard.ejs | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 views/dashboard.ejs diff --git a/router.js b/router.js index e77766a..b757e79 100644 --- a/router.js +++ b/router.js @@ -56,15 +56,20 @@ module.exports = function(app) { } else { console.log('jeg er inne i elsen'); AM.autoLogin(req.cookies.user, req.cookies.pass, function(o) { - req.session.user = o; - console.log('DAFUQ SKJEDDE NĂ…'); - res.render('index', { title: 'Autologin' }); + if (o != null) { + req.session.user = o; + res.redirect('/IJUSTAUTOLOGGEDDEGINN'); + } else { + res.redirect('/'); + } }); - res.redirect('/IJUSTAUTOLOGGEDDEGINN'); } // res.redirect('/HAHAHAHAHAHA'); } else { - res.render('index', { title: 'kanin' }); + res.render('dashboard', { + title: 'kanin', + loggedin: true + }); } }); diff --git a/views/dashboard.ejs b/views/dashboard.ejs new file mode 100644 index 0000000..fe29166 --- /dev/null +++ b/views/dashboard.ejs @@ -0,0 +1,37 @@ +<% include header %> + + + <% include navbar %> + + +
+
+ +
+

Prosjekter

+
+
+

Hyttetur

+ Dennis, Robert, Turid-Laila +
+
+
+
+
+
+
+
+ HER KOMMER EN GRAF +
+ + + + + + + +
+
+ +<% include footer %> -- cgit v1.2.3