Commit a6fa8da9 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add route for project-list

parent 3fecf9ff
...@@ -114,12 +114,12 @@ module.exports = function (app, config, passport, i18n) { ...@@ -114,12 +114,12 @@ module.exports = function (app, config, passport, i18n) {
var lang = 'DE' var lang = 'DE'
// ======== APP ROUTES ==================== // ======== APP ROUTES - ACCOUNT ====================
app.get('/', function (req, res) { app.get('/', function (req, res) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){ methods.getUserByEmail(req.user.email, function(data, err){
if (!err) { if (!err) {
res.render(lang+'/home', { res.render(lang+'/account/home', {
user: data user: data
}); });
} }
...@@ -167,7 +167,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -167,7 +167,7 @@ module.exports = function (app, config, passport, i18n) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){ methods.getUserByEmail(req.user.email, function(data, err){
if (!err) { if (!err) {
res.render(lang+'/profile', { res.render(lang+'/account/profile', {
user: data, user: data,
email: req.user.email email: req.user.email
}); });
...@@ -231,7 +231,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -231,7 +231,7 @@ module.exports = function (app, config, passport, i18n) {
} }
// render the page // render the page
res.render(lang+'/services', { res.render(lang+'/account/services', {
user: req.user, user: req.user,
project: allProjects project: allProjects
}); });
...@@ -244,7 +244,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -244,7 +244,7 @@ module.exports = function (app, config, passport, i18n) {
app.get('/security', function (req, res) { app.get('/security', function (req, res) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
res.render(lang+'/security', { res.render(lang+'/account/security', {
user: req.user // useful for view engine, useless for HTML user: req.user // useful for view engine, useless for HTML
}); });
} else { } else {
...@@ -362,7 +362,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -362,7 +362,7 @@ module.exports = function (app, config, passport, i18n) {
}); });
app.get('/forgotPwd', function (req, res) { app.get('/forgotPwd', function (req, res) {
res.render(lang+'/forgotPwd', { res.render(lang+'/account/forgotPwd', {
user: req.user user: req.user
}); });
}); });
...@@ -446,7 +446,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -446,7 +446,7 @@ module.exports = function (app, config, passport, i18n) {
res.redirect('/forgotPwd'); // localhost res.redirect('/forgotPwd'); // localhost
} }
else { else {
res.render(lang+'/reset'); res.render(lang+'/account/reset');
} }
}); });
}); });
...@@ -498,7 +498,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -498,7 +498,7 @@ module.exports = function (app, config, passport, i18n) {
// todo: user registration with captcha // todo: user registration with captcha
app.get('/registration', function(req, res) { app.get('/registration', function(req, res) {
res.render(lang+'/registration') res.render(lang+'/account/registration')
}) })
app.post('/registration', function(req, res) { app.post('/registration', function(req, res) {
...@@ -543,7 +543,6 @@ module.exports = function (app, config, passport, i18n) { ...@@ -543,7 +543,6 @@ module.exports = function (app, config, passport, i18n) {
}); });
}) })
app.get('/email/:email', function(req, res) { app.get('/email/:email', function(req, res) {
methods.checkUserEmail(req.params.email, function(err, user){ methods.checkUserEmail(req.params.email, function(err, user){
if (!err) { if (!err) {
...@@ -557,4 +556,20 @@ module.exports = function (app, config, passport, i18n) { ...@@ -557,4 +556,20 @@ module.exports = function (app, config, passport, i18n) {
}) })
}) })
// ======== APP ROUTES - PROJECT LIST ====================
app.get('/project', function (req, res) {
if (req.isAuthenticated()) {
console.log("true")
res.render(lang+'/projectList/projects', {
isUserAuthenticated: true
});
}
else {
console.log("false")
res.render(lang+'/projectList/projects', {
isUserAuthenticated: false
});
}
})
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment