diff --git a/app.js b/app.js index 741673f..1e3c914 100644 --- a/app.js +++ b/app.js @@ -70,8 +70,18 @@ app.get('/login', (req, res) => { }); app.get('/aboutUs', (req, res) => { - res.render('aboutUs'); - return res.status(status.Ok); + if (!req.session.authenticated) { + res.render('aboutUs', { + geoData: undefined + }); + return res.status(status.Ok); + } else { + res.render('aboutUs', { + user: req.session.user, + geoData: req.session.geoData + }); + return res.status(status.Ok); + } }); app.get('/forgotPassword', (req, res) => { diff --git a/src/router/user.js b/src/router/user.js index e89db9f..5aa81d1 100644 --- a/src/router/user.js +++ b/src/router/user.js @@ -89,7 +89,10 @@ module.exports = (middleware, users, plans, assets) => { let planSchema = await plans.find({ userId: new ObjectId(user) }).project({ name: 1, retirementAssets: 1, progress: 1, _id: 1, }).toArray(); - res.render('dashboard', { user: req.user, geoData: req.session.geoData, plans: planSchema, }); + res.render('dashboard', { + user: req.session.user, + geoData: req.session.geoData, + plans: planSchema, }); return res.status(status.Ok); }); diff --git a/src/views/aboutUs.ejs b/src/views/aboutUs.ejs index 32ded54..7888461 100644 --- a/src/views/aboutUs.ejs +++ b/src/views/aboutUs.ejs @@ -1,7 +1,12 @@ <%- include("./partials/fileHeader") %> -<%- include("./partials/headerStart") %> -
+<% if (!geoData) { %> + <%- include("./partials/headerStart") %> +<% } else { %> + <%- include("./partials/header") %> +<% } %> + +

About RCalculator

@@ -25,15 +30,23 @@

- + + <% if (!geoData) { %> + + <% } %>
+<% if (!geoData) { %> +<% } else { %> + <%- include("./partials/navBar") %> +<% } %> + <%- include("./partials/footer") %> \ No newline at end of file diff --git a/src/views/assets.ejs b/src/views/assets.ejs index 26129a6..5397a5f 100644 --- a/src/views/assets.ejs +++ b/src/views/assets.ejs @@ -1,7 +1,7 @@ <%- include("./partials/fileHeader") %> <%- include("./partials/header") %> -
+
<%- include("./partials/createAsset", { icons: icons }) %> <% if (errMessage != "") { %> diff --git a/src/views/dashboard.ejs b/src/views/dashboard.ejs index 01d5545..7feeb93 100644 --- a/src/views/dashboard.ejs +++ b/src/views/dashboard.ejs @@ -1,25 +1,27 @@ <%- include("./partials/fileHeader") %> - <%- include("./partials/header") %> +<%- include("./partials/header") %> -
- - -
-
- <% plans.forEach(plan=> { %> - <%- include('./partials/dashboardBox.ejs', {plan: plan}) %> - <% }); %> -
-
-
- <%- include("./partials/navBar") %> - <%- include("./partials/scriptLoader") %> - <%- include("./partials/footer") %> - +
+ + +
+
+ <% plans.forEach(plan=> { %> + <%- include('./partials/dashboardBox.ejs', {plan: plan}) %> + <% }); %> +
+
+
+ + + +<%- include("./partials/navBar") %> +<%- include("./partials/scriptLoader") %> +<%- include("./partials/footer") %> diff --git a/src/views/login.ejs b/src/views/login.ejs index d35800f..c2e5f2b 100644 --- a/src/views/login.ejs +++ b/src/views/login.ejs @@ -1,7 +1,8 @@ <%- include("./partials/fileHeader") %> +<%- include("./partials/headerStart") %> -
-
+
+

Login

diff --git a/src/views/more.ejs b/src/views/more.ejs index 934700e..8e9020d 100644 --- a/src/views/more.ejs +++ b/src/views/more.ejs @@ -1,11 +1,54 @@ <%- include("./partials/fileHeader") %> <%- include("./partials/header") %> -
- The More Page +
+
<%- include("./partials/navBar") %> <%- include("./partials/scriptLoader") %> -<%- include("./partials/footer") %> - \ No newline at end of file +<%- include("./partials/footer") %> \ No newline at end of file diff --git a/src/views/newPlan.ejs b/src/views/newPlan.ejs index 5370290..c1ae0e7 100644 --- a/src/views/newPlan.ejs +++ b/src/views/newPlan.ejs @@ -1,7 +1,7 @@ <%- include("./partials/fileHeader") %> <%- include("./partials/header") %> -
+

Welcome: <%= user.name %>

Retirement Plan

diff --git a/src/views/partials/fileHeader.ejs b/src/views/partials/fileHeader.ejs index b15b69c..fed6087 100644 --- a/src/views/partials/fileHeader.ejs +++ b/src/views/partials/fileHeader.ejs @@ -6,5 +6,18 @@ RCalculator + + - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/partials/footer.ejs b/src/views/partials/footer.ejs index 5dca45f..3c6c988 100644 --- a/src/views/partials/footer.ejs +++ b/src/views/partials/footer.ejs @@ -23,5 +23,8 @@ + + + diff --git a/src/views/partials/header.ejs b/src/views/partials/header.ejs index 43747eb..e7df59b 100644 --- a/src/views/partials/header.ejs +++ b/src/views/partials/header.ejs @@ -1,8 +1,8 @@
-
\ No newline at end of file diff --git a/src/views/partials/headerStart.ejs b/src/views/partials/headerStart.ejs index 9b215d4..5d2305a 100644 --- a/src/views/partials/headerStart.ejs +++ b/src/views/partials/headerStart.ejs @@ -1,6 +1,6 @@