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) {
var lang = 'DE'
// ======== APP ROUTES ====================
// ======== APP ROUTES - ACCOUNT ====================
app.get('/', function (req, res) {
if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){
if (!err) {
res.render(lang+'/home', {
res.render(lang+'/account/home', {
user: data
});
}
......@@ -167,7 +167,7 @@ module.exports = function (app, config, passport, i18n) {
if (req.isAuthenticated()) {
methods.getUserByEmail(req.user.email, function(data, err){
if (!err) {
res.render(lang+'/profile', {
res.render(lang+'/account/profile', {
user: data,
email: req.user.email
});
......@@ -231,7 +231,7 @@ module.exports = function (app, config, passport, i18n) {
}
// render the page
res.render(lang+'/services', {
res.render(lang+'/account/services', {
user: req.user,
project: allProjects
});
......@@ -244,7 +244,7 @@ module.exports = function (app, config, passport, i18n) {
app.get('/security', function (req, res) {
if (req.isAuthenticated()) {
res.render(lang+'/security', {
res.render(lang+'/account/security', {
user: req.user // useful for view engine, useless for HTML
});
} else {
......@@ -362,7 +362,7 @@ module.exports = function (app, config, passport, i18n) {
});
app.get('/forgotPwd', function (req, res) {
res.render(lang+'/forgotPwd', {
res.render(lang+'/account/forgotPwd', {
user: req.user
});
});
......@@ -446,7 +446,7 @@ module.exports = function (app, config, passport, i18n) {
res.redirect('/forgotPwd'); // localhost
}
else {
res.render(lang+'/reset');
res.render(lang+'/account/reset');
}
});
});
......@@ -498,7 +498,7 @@ module.exports = function (app, config, passport, i18n) {
// todo: user registration with captcha
app.get('/registration', function(req, res) {
res.render(lang+'/registration')
res.render(lang+'/account/registration')
})
app.post('/registration', function(req, res) {
......@@ -543,7 +543,6 @@ module.exports = function (app, config, passport, i18n) {
});
})
app.get('/email/:email', function(req, res) {
methods.checkUserEmail(req.params.email, function(err, user){
if (!err) {
......@@ -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
});
}
})
};
Supports Markdown
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