Compare commits

...
Author SHA1 Message Date
Joaquin e1626f6ae9 feature/completed getting geolocation data 2025-05-06 14:46:01 -07:00
Joaquin 83be006a83 feature/geolocation implemented 2025-05-06 13:38:00 -07:00
SowinskiBraeden 6d91934229 fix/ignore login err message on signup 2025-05-06 12:49:20 -07:00
SowinskiBraeden 97a1473e21 fix/require name on register 2025-05-06 12:46:21 -07:00
SowinskiBraeden 3bb9ede515 update/cancel changes 2025-05-06 11:52:53 -07:00
SowinskiBraeden b350cdad9f update/keep email input disabled 2025-05-06 11:46:14 -07:00
SowinskiBraeden f0d324151d update/error message style 2025-05-06 11:44:26 -07:00
SowinskiBraeden b88333e3b4 refactor/temp remove personal section 2025-05-06 11:41:14 -07:00
SowinskiBraeden 75bc3bee8f update/save modified account settings 2025-05-06 11:39:49 -07:00
SowinskiBraeden a2b4e8d36d refactor/remove debug statements 2025-05-06 11:19:10 -07:00
SowinskiBraeden 033401dbf7 update/profile page with user data 2025-05-06 11:15:18 -07:00
SowinskiBraeden 1d8ec431b2 fix/tidy auth+user routers 2025-05-06 09:32:39 -07:00
Joaquin 4050e95cc3 fixed conflict 2025-05-06 09:30:30 -07:00
Joaquin ae3ddbeaeb Merge branch 'dev' of https://github.com/JoaquinPar/2800-202510-BBY14 into dev 2025-05-06 09:30:22 -07:00
Nícolas Agostini 84cd8b0bae Merge pull request #3 from JoaquinPar/feature/questions
feature/questionnaire page create + saving to MongoDb
2025-05-06 02:10:14 -07:00
Joaquin 54566f05b7 feature/fully implemented ejs inclusion to main files 2025-05-05 21:56:47 -07:00
Joaquin decdb299b7 Merge branch 'dev' of https://github.com/JoaquinPar/2800-202510-BBY14 into feature/layoutPage 2025-05-05 21:17:50 -07:00
Joaquin c8bf2e49ab feature/completed most of ejs implementation into other pages 2025-05-05 21:12:52 -07:00
Joaquin f6640b23cf feature/some progress made on layouts 2025-05-05 17:07:51 -07:00
Joaquin 4be7ca3a8e Merge branch 'dev' into feature/layoutPage 2025-05-05 16:30:51 -07:00
Joaquin 8b6ff1354b resolved merge conflict 2025-05-05 14:27:24 -07:00
Joaquin 4bcf8dd812 feature/started work on layout.ejs 2025-05-05 14:21:30 -07:00
22 changed files with 362 additions and 232 deletions

No files matched your search

+12
View File
@@ -28,6 +28,7 @@ app.set('views',path.join(__dirname, 'src/views'));
app.use(express.urlencoded({ extended: true }));
app.use("/static", express.static("./src/public"));
app.use("/images", express.static("./src/public/images"));
app.use(express.json());
/*** Database ***/
const { connectMongo, getCollection } = require("./src/database/connection");
@@ -49,6 +50,8 @@ app.get('/', (req, res) => {
});
app.get('/signup', (req, res) => {
const ignore = ["User not found", "Incorrect password"];
if (ignore.includes(req.session.errMessage)) req.session.errMessage = "";
res.render('signup', { errMessage: req.session.errMessage });
return res.status(status.Ok);
});
@@ -67,6 +70,15 @@ app.get('/aboutUs', (req, res) => {
return res.status(status.Ok);
});
app.post('/api/location', async (req,res) => {
const { latitude, longitude } = req.body;
const response = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&result_type=country&key=${process.env.geolocation_api}`);
const data = await response.json();
res.json(data);
});
// Initialize database and start app
initDatabase().then(() => {
+5 -12
View File
@@ -3,15 +3,11 @@ const bcrypt = require('bcrypt');
const joi = require("joi");
const salt = 12;
const middleware = require("./middleware");
module.exports = (users) => {
const router = require("express").Router();
router.get("/logout", (req, res) => {
req.session.destroy();
// res.status(status.Unauthorized);
return res.redirect('/login');
});
@@ -43,8 +39,6 @@ module.exports = (users) => {
return res.redirect("/login");
}
console.log("User logged in successfully");
console.log("User email: " + req.body.email);
req.session.authenticated = true;
req.session.email = req.body.email;
req.session.errMessage = "";
@@ -56,7 +50,7 @@ module.exports = (users) => {
router.post("/signup", async (req, res) => {
const userSchema = joi.object({
email: joi.string().email().required(),
// name: joi.string().alphanum().max(20).required(),
name: joi.string().alphanum().max(20).required(),
password: joi.string().max(20).min(8).required(),
repassword: joi.string().max(20).min(8).required(),
});
@@ -79,21 +73,20 @@ module.exports = (users) => {
users.insertOne({
email: req.body.email,
// name: req.body.name,
name: req.body.name,
password: hashedPassword,
}).then((results, err) => {
if (err) {
res.status(status.InternalServerError);
console.error(err);
return res.send("Internal server error");
res.session.errMessage = "Internal server error";
return res.status(status.InternalServerError).redirect("/signup");
}
req.session.authenticated = true;
req.session.email = req.body.email;
req.session.errMessage = "";
res.status(status.Ok);
return res.redirect("/home");
return res.status(status.Ok).redirect("/home");
});
});
+1
View File
@@ -16,6 +16,7 @@ const connectMongo = async (mongoURI, databaseName) => {
* getCollection object to interact with MongoDB
* @param {MongoClient} dbo
* @param {string} collection
* @return {MongoClient.collection}
*/
const getCollection = async (dbo, collection) => {
return await dbo.collection(collection);
+24
View File
@@ -0,0 +1,24 @@
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success, error);
}
}
function success(position) {
const { latitude, longitude } = position.coords;
fetch("api/location" , {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ latitude, longitude })
}).then(res => res.json())
.then(data => {
console.log(data.results[0].formatted_address);
})
}
function error(err) {
console.error("Geolocation error: ", err);
}
+75
View File
@@ -0,0 +1,75 @@
/**
* lockAccount resets inputs and disabled inputs
*/
function lockAccount() {
// Clear unsaved inputs on page load (refresh doesnt clear them)
document.getElementById("account-form").reset();
document.getElementById("save-account").disabled = true;
document.getElementById("email").disabled = true;
document.getElementById("name").disabled = true;
document.getElementById("password").disabled = true;
document.getElementById("repassword").disabled = true;
document.getElementById("save-account").classList.add("cursor-not-allowed");
document.getElementById("edit-account").innerHTML = "Edit";
document.getElementById("edit-account").onclick = unlockAccount;
}
/**
* lockPersonal resets inputs and disabled inputs
*/
function lockPersonal() {
// Clear unsaved inputs on page load (refresh doesnt clear them)
document.getElementById("personal-form").reset();
document.getElementById("save-personal").disabled = true;
document.getElementById("dob").disabled = true;
document.getElementById("education").disabled = true;
document.getElementById("ms-single").disabled = true;
document.getElementById("ms-married").disabled = true;
document.getElementById("ms-divorced").disabled = true;
document.getElementById("ms-widowed").disabled = true;
document.getElementById("save-personal").classList.add("cursor-not-allowed");
document.getElementById("edit-personal").innerHTML = "Edit";
document.getElementById("edit-personal").onclick = unlockPersonal;
}
/**
* unlockAccount removes disabled from inputs and
* allows users to edit their profile.
*/
function unlockAccount() {
document.getElementById("save-account").disabled = false;
// document.getElementById("email").disabled = false;
document.getElementById("name").disabled = false;
document.getElementById("password").disabled = false;
document.getElementById("repassword").disabled = false;
document.getElementById("save-account").classList.remove("cursor-not-allowed");
document.getElementById("edit-account").innerHTML = "Cancel changes";
document.getElementById("edit-account").onclick = lockAccount;
}
/**
* unlocPersonal removes disabled from inputs and
* allows users to edit their personal information.
*/
function unlockPersonal() {
document.getElementById("save-personal").disabled = false;
document.getElementById("dob").disabled = false;
document.getElementById("education").disabled = false;
document.getElementById("ms-single").disabled = false;
document.getElementById("ms-married").disabled = false;
document.getElementById("ms-divorced").disabled = false;
document.getElementById("ms-widowed").disabled = false;
document.getElementById("save-personal").classList.remove("cursor-not-allowed");
document.getElementById("edit-personal").innerHTML = "Cancel changes";
document.getElementById("edit-personal").onclick = lockPersonal;
}
// On page load, ensure forms are locked and reset
lockAccount();
// lockPersonal();
+54 -6
View File
@@ -1,5 +1,7 @@
const status = require("../util/statuses");
const bcrypt = require('bcrypt');
const joi = require("joi");
const salt = 12;
module.exports = (middleware, users) => {
const router = require("express").Router();
@@ -27,7 +29,7 @@ module.exports = (middleware, users) => {
});
router.get('/profile', (req, res) => {
res.render('profiles', { user: req.user });
res.render('profile', { user: req.user, errMessage: req.session.errMessage });
return res.status(status.Ok);
});
@@ -43,8 +45,6 @@ module.exports = (middleware, users) => {
});
router.post('/questionnaire', (req, res) => {
console.log("Questionnaire POST body:", req.body);
const questionnaireSchema = joi.object({
dob: joi.date().required(),
education: joi.string().valid('primary', 'secondary', 'tertiary', 'postgraduate').required(),
@@ -108,9 +108,57 @@ module.exports = (middleware, users) => {
});
});
router.get('/logout', (req, res) => {
req.session.destroy();
return res.redirect('/login');
router.post("/updateAccount", async (req, res) => {
const accountSchema = joi.object({
email: joi.string().email(),
name: joi.string().alphanum().max(20),
password: joi.string().max(20).min(8),
repassword: joi.string().max(20).min(8),
});
const valid = accountSchema.validate(req.body);
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
return res.redirect("/profile");
}
let update = {
// email: req.body.email,
name: req.body.name,
};
if ((req.body.password != "") && (req.body.password != req.body.repassword)) {
req.session.errMessage = "New passwords must match";
res.status(status.BadRequest);
return res.redirect("/profile");
} else if (req.body.password != "") {
let hashedPassword = await bcrypt.hashSync(req.body.password, salt);
update.password = hashedPassword;
}
users.updateOne(
{ email: req.session.email },
{ $set: update }
).then((result) => {
if (result.matchedCount === 0) {
console.log(`User not found during account update: ${req.session.email}`);
req.session.errMessage = "User session invalid. Please log in again.";
res.status(status.NotFound).redirect("/login");
return;
}
if (result.modifiedCount === 0 && result.matchedCount === 1) {
console.log(`User account data unchanged (already up-to-date): ${req.session.email}`);
}
req.session.errMessage = "";
return res.status(status.Ok).redirect("/profile");
}).catch(err => {
console.error("Error updating account in database:", err);
req.session.errMessage = "An error occurred while saving your information. Please try again.";
return res.status(status.InternalServerError).redirect("/profile");
});
});
return router;
+7 -24
View File
@@ -1,12 +1,7 @@
<html>
<head>
<title>RCalculator</title>
<link rel="icon" href="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-white dark:bg-gray-900">
<%- include("./partials/headerStart") %>
<main>
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main>
<section class="bg-white dark:bg-gray-900 py-12 md:py-20">
<div class="max-w-screen-lg mx-auto px-4 text-center">
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-gray-900 md:text-5xl lg:text-6xl dark:text-white">About RCalculator</h1>
@@ -31,7 +26,7 @@
</div>
</div>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<a href="/login" class="inline-flex justify-center items-center mt-4 py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
<a href="/signup" class="inline-flex justify-center items-center mt-4 py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
Get started
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
@@ -39,18 +34,6 @@
</a>
</div>
</section>
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
</body>
</html>
</main>
<!--fixed bottom-0 left-0 z-50 lg:hidden w-full h-16 bg-white border-t border-gray-200 dark:bg-gray-400-->
<%- include("./partials/footer") %>
+8 -22
View File
@@ -1,23 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<body>
<%- include("./partials/header") %>
<main>
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
The Assets Page
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
<%- include("./partials/navBar") %>
</footer>
</body>
</html>
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+6 -21
View File
@@ -1,15 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<body>
<main>
<main>
<%- include("./partials/header") %>
Welcome: <%= user.email %>
The Dashboard Page
@@ -17,14 +9,7 @@
<%= user.email %>
<%= user.errMessage %>
<% } %>
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
</body>
</main>
</html>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+6 -20
View File
@@ -1,23 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<body>
<main>
The Index Page
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
<%- include("./partials/navBar") %>
</footer>
</body>
</main>
</html>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+8 -22
View File
@@ -1,18 +1,13 @@
<html>
<head>
<title>RCalculator</title>
<link rel="icon" href="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-white dark:bg-gray-900">
<%- include("./partials/headerStart") %>
<main>
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main>
<section class="bg-center bg-no-repeat bg-cover bg-[url('/images/bg1.jpg')] bg-gray-400 bg-blend-multiply">
<div class="px-4 mx-auto max-w-screen-xl text-center py-24 lg:py-56">
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-white md:text-5xl lg:text-6xl">Plan now, live better.</h1>
<p class="mb-8 text-lg font-normal text-gray-300 lg:text-xl sm:px-16 lg:px-48">Planning your retirement is a crucial step towards financial security and a happy future.</p>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<a href="/login" class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
<a href="/signup" class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
Get started
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
@@ -24,15 +19,6 @@
</div>
</div>
</section>
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
</body>
</html>
</main>
<%- include("./partials/footer") %>
+5 -18
View File
@@ -1,19 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" href="/static/css/style.css" <link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
<div class="flex justify-center items-center h-screen bg-gray-700">
<main>
<div class="flex justify-center items-center h-screen">
<form action="/login" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold"> Login </h1>
@@ -51,7 +39,6 @@
</div>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
</body>
</main>
</html>
<%- include("./partials/footer") %>
+7 -22
View File
@@ -1,25 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<body>
<%- include("./partials/header") %>
<main>
<main>
The More Page
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
<%- include("./partials/navBar") %>
</footer>
</body>
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
</html>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>RCalculator</title>
</head>
<body class="bg-white dark:bg-gray-900">
+11
View File
@@ -0,0 +1,11 @@
<footer>
<div class="fixed bottom-0 left-0 z-50 hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
<script src="/static/scripts/geolocation.js"></script>
</body>
</html>
+1 -1
View File
@@ -20,7 +20,7 @@
<a href="/" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Home</a>
</li>
<li>
<a href="/aboutUs" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">About Us</a>
<a href="/login" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Login</a>
</li>
<li>
<a href="mailto:rcalculator@gmail.com" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Contact us</a>
-1
View File
@@ -27,4 +27,3 @@
</a>
</div>
</div>
+6 -23
View File
@@ -1,26 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<body>
<%- include("./partials/header") %>
<main>
<main>
The Plans Page
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
<%- include("./partials/navBar") %>
</footer>
</body>
</main>
</html>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+90
View File
@@ -0,0 +1,90 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
<h2 class="ml-11 mt-5 mb-6 text-xl font-semibold mb-4 text-white">Welcome <%= user.name %></h2>
<% if (errMessage != "") { %>
<div class="max-w-md mx-auto mb-10 rounded-lg shadow-md text-white font-bold bg-red-400 py-4 text-center"><%= errMessage %></div>
<% } %>
<div class="max-w-md mx-auto bg-white p-8 mb-10 rounded-lg shadow-md">
<div class="flex flex-row justify-between">
<h3 class="pt-2 pr-2 pb-2">Account settings</h3>
<button id="edit-account" onclick="unlockAccount()" class="py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Edit</button>
</div>
<form action="/updateAccount" method="post" class="space-y-4 mt-4" id="account-form">
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<input id="email" disabled type="text" name="email" value="<%= user.email %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<label for="name" class="block text-sm font-medium text-gray-700">Name</label>
<input id="name" disabled type="text" name="name" value="<%= user.name %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<label for="password" class="block text-sm font-medium text-gray-700">New password</label>
<input id="password" disabled type="password" name="password" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<label for="repassword" class="block text-sm font-medium text-gray-700">Confirm new password</label>
<input id="repassword" disabled type="password" name="repassword" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<div>
<button id="save-account" disabled type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-not-allowed">Save</button>
</div>
</form>
</div>
<!--
<div class="mb-10 max-w-md mx-auto bg-white p-8 rounded-lg shadow-md">
<div class="flex flex-row justify-between">
<h3 class="pt-2 pr-2 pb-2">Personal information</h3>
<button onclick="unlockPersonal()" class="py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Edit</button>
</div>
<form action="/updatePersonal" method="post" class="space-y-4" id="personal-form">
<div>
<label for="dob" class="block text-sm font-medium text-gray-700">Date of Birth</label>
<input id="dob" disabled type="date" name="dob" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
</div>
<div>
<label for="education" class="block text-sm font-medium text-gray-700">Education</label>
<select disabled name="education" id="education" class="mt-1 block w-full px-3 py-2 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<option value="primary">Primary (Elementary)</option>
<option value="secondary">Secondary (High School)</option>
<option value="tertiary">Tertiary (College/University)</option>
<option value="postgraduate">Postgraduate (Master's/PhD)</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Marital Status</label>
<div class="mt-1 space-x-4">
<label class="inline-flex items-center">
<input disabled id="ms-single" type="radio" name="maritalStatus" value="single" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<span class="ml-2 text-sm text-gray-700">Single</span>
</label>
<label class="inline-flex items-center">
<input disabled id="ms-married" type="radio" name="maritalStatus" value="married" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<span class="ml-2 text-sm text-gray-700">Married</span>
</label>
<label class="inline-flex items-center">
<input disabled id="ms-divorced" type="radio" name="maritalStatus" value="divorced" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<span class="ml-2 text-sm text-gray-700">Divorced</span>
</label>
<label class="inline-flex items-center">
<input disabled id="ms-widowed" type="radio" name="maritalStatus" value="widowed" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
<span class="ml-2 text-sm text-gray-700">Widowed</span>
</label>
</div>
</div>
<div>
<button id="save-personal" disabled type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-not-allowed">Save</button>
</div>
</form>
</div> -->
<div class="mt-24"></div>
</main>
<script src="/static/scripts/profile.js"></script>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+5 -22
View File
@@ -1,16 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>Document</title>
</head>
<body>
<%- include("./partials/header") %>
<main class="container mx-auto p-4">
<main class="container mx-auto p-4">
<h2 class="text-xl font-semibold mb-4">Welcome: <%= user.email %></h2>
<div class="max-w-md mx-auto bg-white p-8 mb-10 rounded-lg shadow-md">
<h3 class="text-lg font-medium mb-6">Financial Questionnaire</h3>
@@ -95,14 +86,6 @@
</div>
</form>
</div>
</main>
<footer>
<div class="fixed bottom-0 left-0 z-50 sm:hidden mt-5 lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
</body>
</main>
</html>
<%- include("./partials/footer") %>
+12 -18
View File
@@ -1,19 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signup</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<div class="flex justify-center items-center h-screen bg-gray-700">
<main>
<div class="flex justify-center items-center h-screen">
<form action="/signup" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold"> Signup </h1>
@@ -24,6 +13,12 @@
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<div class="mt-3">
<label for="name" class="block text-base mb-2">Name</label>
<input type="text" id="name" name="name"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Name" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Password</label>
<input type="password" id="password" name="password"
@@ -46,7 +41,6 @@
</div>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
</body>
</main>
</html>
<%- include("./partials/footer") %>
+9
View File
@@ -0,0 +1,9 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
<!-- Your content here -->
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>