diff options
| -rw-r--r-- | assets/css/style.css | 2 | ||||
| -rw-r--r-- | routes/user.js | 8 | ||||
| -rw-r--r-- | 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"> </thead> <tbody> {{# each inbox }} - <a href="#" data-toggle="modal" data-target=".{{this.date}}{{this.sender}}"> <tr> - <td>{{ this.date }}</td> - <td>{{ this.subject }}</td> - <td>{{ this.sender }}</td> + <td><a href="#" data-toggle="modal" data-target=".{{ this.class }}"> + {{ this.date }}</a></td> + <td><a href="#" data-toggle="modal" data-target=".{{ this.class }}"> + {{ this.subject }}</a></td> + <td><a href="#" data-toggle="modal" data-target=".{{ this.class }}"> + {{ this.sender }}</a></td> </tr> - </a> {{/each}} </tbody> </table> {{# each inbox}} - <article class="modal fade {{this.date}}{{this.sender}}"> + <article class="modal fade {{this.class}}"> <div class="modal-dialog"> <div class="modal-content"> @@ -287,4 +288,4 @@ col-sm-offset-0 col-md-offset-3 col-lg-offset-3 toppad prf-details"> </div> </div> -</main>
\ No newline at end of file +</main> |
