From cfcfd7778d7a5d10ecfdd88a9bb6db9f5b099c45 Mon Sep 17 00:00:00 2001
From: Joaquin
Date: Thu, 15 May 2025 21:30:58 -0700
Subject: [PATCH] feature/more page in nav bar completed
---
app.js | 14 ++++++++++++--
src/router/user.js | 4 +++-
src/views/aboutUs.ejs | 31 +++++++++++++++++++++---------
src/views/partials/header.ejs | 12 ++++++------
src/views/partials/headerStart.ejs | 2 +-
5 files changed, 44 insertions(+), 19 deletions(-)
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 3ae5b03..7156e24 100644
--- a/src/router/user.js
+++ b/src/router/user.js
@@ -80,7 +80,9 @@ module.exports = (middleware, users, plans, assets) => {
};
}
- res.render('dashboard', { user: req.session.user, geoData: req.session.geoData });
+ res.render('dashboard', {
+ user: req.session.user,
+ geoData: req.session.geoData });
return res.status(status.Ok);
});
diff --git a/src/views/aboutUs.ejs b/src/views/aboutUs.ejs
index 32ded54..6561f12 100644
--- a/src/views/aboutUs.ejs
+++ b/src/views/aboutUs.ejs
@@ -1,5 +1,10 @@
<%- include("./partials/fileHeader") %>
-<%- include("./partials/headerStart") %>
+
+<% if (!geoData) { %>
+ <%- include("./partials/headerStart") %>
+<% } else { %>
+ <%- include("./partials/header") %>
+<% } %>
-
+
+ <% if (!geoData) { %>
+
+ <% } %>
+<% if (!geoData) { %>
+<% } else { %>
+ <%- include("./partials/navBar") %>
+<% } %>
+
<%- include("./partials/footer") %>
\ No newline at end of file
diff --git a/src/views/partials/header.ejs b/src/views/partials/header.ejs
index 7b6121d..45b2f8d 100644
--- a/src/views/partials/header.ejs
+++ b/src/views/partials/header.ejs
@@ -2,7 +2,7 @@