Add Update Email View

This commit:

- Displays the user's email that we have on records
- Adds a button in the settings to update email
- Adds a form view to update the email
- Fixes CSS for the Email icons and the email form
                         ~ Credits to @hallaathrad

- Linting fixes and updated with Berkeley's Comments

- Streamline checks and fix scope

- Add AJAX Calls

- Add flash messages

- Update the views & add XHR value
This commit is contained in:
Mrugesh Mohapatra
2016-04-22 02:17:59 +05:30
parent c8a06f008b
commit 3d55b9bb8b
6 changed files with 189 additions and 35 deletions

View File

@@ -149,6 +149,7 @@ module.exports = function(app) {
router.get('/email-signup', getEmailSignup);
router.get('/email-signin', getEmailSignin);
router.get('/deprecated-signin', getDepSignin);
router.get('/email-update', getUpdateEmail);
router.get(
'/toggle-lockdown-mode',
sendNonUserToMap,
@@ -226,6 +227,7 @@ module.exports = function(app) {
res.redirect('/');
}
function getDepSignin(req, res) {
if (req.user) {
return res.redirect('/');
@@ -235,6 +237,15 @@ module.exports = function(app) {
});
}
function getUpdateEmail(req, res) {
if (!req.user) {
return res.redirect('/');
}
return res.render('account/email-update', {
title: 'Update your Email'
});
}
function getEmailSignin(req, res) {
if (req.user) {
return res.redirect('/');