From 91638c435076736ea1d6ac7f532a35523bd79f89 Mon Sep 17 00:00:00 2001 From: nanalelfe Date: Mon, 25 Jul 2016 04:55:59 -0400 Subject: Added popup window to view messages in profile page --- assets/css/style.css | 2 +- routes/user.js | 8 +++++++- views/user_profile_alt.hbs | 15 ++++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 91d75c4..5995a6e 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -414,7 +414,7 @@ section.exam-info em { /************************** Pop-up Window ************************************/ -.login-window, .registration-window { +.login-window, .registration-window, .modal { display: inline-block; text-align: left; vertical-align: middle; diff --git a/routes/user.js b/routes/user.js index f9487ea..9f200eb 100644 --- a/routes/user.js +++ b/routes/user.js @@ -61,6 +61,12 @@ router.get('/user_profile', loggedIn, isUser, function(req, res, next) { dbFile.checkMailbox(req.user.user_name, function(success, error, data, message){ if (success) { inbox = data; + // needed to display in layout + var i = 0; + inbox.forEach(function(element) { + element.class = i; + i ++; + }); resolve(1); } else if (error) { // For testing purposes, remove later: @@ -82,7 +88,7 @@ router.get('/user_profile', loggedIn, isUser, function(req, res, next) { }); } getComments().then(getMail).then(function (data) { - console.log('got here'); + console.log('got here fere'); res.render('user_profile_alt', {comments : comments, inbox: inbox, csrfToken: req.csrfToken()}); }); diff --git a/views/user_profile_alt.hbs b/views/user_profile_alt.hbs index 2270d76..30153d1 100644 --- a/views/user_profile_alt.hbs +++ b/views/user_profile_alt.hbs @@ -199,19 +199,20 @@ col-sm-offset-0 col-md-offset-3 col-lg-offset-3 toppad prf-details"> {{# each inbox }} - - {{ this.date }} - {{ this.subject }} - {{ this.sender }} + + {{ this.date }} + + {{ this.subject }} + + {{ this.sender }} - {{/each}} {{# each inbox}} -