Compare commits

...
Author SHA1 Message Date
nicoagostini f1afcbd785 refactor/ new plan as a modal pop up. Deletion and edition on plan created 2025-05-20 14:25:27 -07:00
Joaquin e320459955 fix/fixed all color related problems 2025-05-20 08:56:44 -07:00
knighthawk4227 8c0e07abb3 dashboard col issue 2025-05-16 23:31:28 -07:00
Nícolas Agostini edb0021cc6 Merge pull request #35 from JoaquinPar/feature/months-left
feature/ calculations done, being displayed dynamically in the plan card
2025-05-16 19:37:22 -07:00
nicoagostini 69624f859c feature/ calculations done, being displayed dynamically in the plan card 2025-05-16 19:36:17 -07:00
nicoagostini 53e72e2a19 fix/ dashboard progression bar not updating when assets changed 2025-05-16 16:19:35 -07:00
nicoagostini 043c24a417 fix/progress bar limitation added 2025-05-16 12:46:23 -07:00
Joaquin 629e4f8ae8 fix/fixed planDetail page padding 2025-05-16 12:28:37 -07:00
Nícolas Agostini e2df35929f Merge pull request #33 from JoaquinPar/fix/planDetail-padding
Fix/plan detail padding
2025-05-16 12:26:35 -07:00
Nícolas Agostini b1743d91c4 Merge branch 'dev' into fix/planDetail-padding 2025-05-16 12:26:28 -07:00
nicoagostini 5d67f4f5ed fix/planDetail padding fixed to avoid overlap 2025-05-16 12:25:29 -07:00
nicoagostini 505f0484bc fix/planDetail.ejs padding adjusted to fix overlap 2025-05-16 12:14:42 -07:00
Joaquin cc63b83288 fix/fixed spacing in planDetail page 2025-05-16 12:09:46 -07:00
knighthawk4227 0eaa82b121 padding for mobile 2025-05-16 12:02:06 -07:00
Joaquin 03b0dd8fa6 fix/fixed navbar pop-up element shadow 2025-05-16 11:57:53 -07:00
Joaquin 6faa951636 fix/fixed navbar pop-up element shadow 2025-05-16 11:56:06 -07:00
Nícolas Agostini 58a6e4724f Merge pull request #32 from JoaquinPar/refactor/ai-challenge2
refactor/ai-challenge2 removed from pages where the user is not logge…
2025-05-16 11:48:48 -07:00
knighthawk4227 692f195e27 google chrome browser fix 2025-05-16 11:25:08 -07:00
25 changed files with 741 additions and 272 deletions

No files matched your search

+9 -4
View File
@@ -1,14 +1,19 @@
/**
* Function takes in a number and formats it to currency
* @param {integer}
* @returns nuber formatted in currency
*/
document.addEventListener("DOMContentLoaded", () => {
const number = document.querySelectorAll(".planGoal");
number.forEach(value => {
num = parseFloat(value.textContent);
if (num >= 999999) {
value.textContent = (num /= 1000000).toFixed(2) + "M";
console.log(value.textContent);
value.textContent = "$" + (num /= 1000000) + "M";
} else if (num > 999) {
value.textContent = (num /= 1000).toFixed(2) + "K";
value.textContent = "$" + (num /= 1000) + "k";
} else {
return num;
return "$" + num;
}
});
});
+36
View File
@@ -32,3 +32,39 @@ factSubmitButton.addEventListener("click", () => {
Swal.fire('Error fetching fact', 'Please try again later', 'error');
});
});
document.addEventListener("DOMContentLoaded", () => {
const drawer = document.getElementById("drawer-navigation");
const toggle = document.getElementById("drawer-toggle");
function openDrawer() {
drawer.classList.remove("translate-x-full");
// Add backdrop
const backdrop = document.createElement("div");
backdrop.className = "fixed inset-0 bg-gray-900/50 z-30 drawer-backdrop";
document.body.appendChild(backdrop);
// Optional: prevent scroll
document.body.classList.add("overflow-hidden");
backdrop.addEventListener("click", closeDrawer);
}
function closeDrawer() {
drawer.classList.add("translate-x-full");
const backdrop = document.querySelector(".drawer-backdrop");
if (backdrop) backdrop.remove();
document.body.classList.remove("overflow-hidden");
}
toggle.addEventListener("click", openDrawer);
// Also close on X button if needed
const closeBtn = drawer.querySelector("[data-drawer-hide]");
if (closeBtn) {
closeBtn.addEventListener("click", closeDrawer);
}
});
+39
View File
@@ -0,0 +1,39 @@
function editPlan(planId) {
if (planId) {
window.location.href = `/plans/${planId}/edit`;
} else {
console.error('editPlan called without a planId');
alert('Cannot edit plan: Plan ID is missing.');
}
}
async function deletePlan(planId) {
if (!planId) {
console.error('deletePlan called without a planId');
alert('Cannot delete plan: Plan ID is missing.');
return;
}
if (confirm('Are you sure you want to delete this plan? This action cannot be undone.')) {
try {
const response = await fetch(`/plans/${planId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
});
const result = await response.json();
if (response.ok && result.success) {
alert('Plan deleted successfully.');
window.location.href = '/plans'; // Redirect to the plans list page
} else {
alert(`Failed to delete plan: ${result.message || 'Unknown error'}`);
}
} catch (error) {
console.error('Error deleting plan:', error);
alert('An error occurred while trying to delete the plan. Please check the console for details and ensure the server is running.');
}
}
}
+133 -26
View File
@@ -1,5 +1,5 @@
const getRates = require("../util/exchangeRate");
const { calculatePlanProgress, updatePlanProgressInDB } = require("../util/calculations");
const { calculateProgress, updatePlanProgressInDB, updateProgress } = require("../util/calculations");
const suggestions = require("../util/suggestions");
const status = require("../util/statuses");
const ObjectId = require('mongodb').ObjectId;
@@ -86,13 +86,20 @@ module.exports = (middleware, users, plans, assets) => {
toCurrencyRates: [],
};
}
let planSchema = await plans.find({ userId: new ObjectId(user) }).project({
name: 1, retirementAssets: 1, progress: 1, _id: 1,
}).toArray();
const userPlansFromDB = await plans.find({ userId: new ObjectId(req.session.userId) }).toArray();
for (const plan of userPlansFromDB) {
const progress = await calculateProgress(plan, assets, users, req.session.user._id);
await updatePlanProgressInDB(plan._id, progress.percentage, plans);
}
const updatedUserPlans = await plans.find({ userId: new ObjectId(req.session.user._id) }).toArray();
res.render('dashboard', {
user: req.session.user,
geoData: req.session.geoData,
plans: planSchema, });
plans: updatedUserPlans,
});
return res.status(status.Ok);
});
@@ -111,15 +118,8 @@ module.exports = (middleware, users, plans, assets) => {
router.get('/plans', async (req, res) => {
try {
const userPlansFromDB = await plans.find({ userId: new ObjectId(req.session.userId) }).toArray();
for (const plan of userPlansFromDB) {
const percentage = await calculatePlanProgress(plan, assets, req.session.user._id);
await updatePlanProgressInDB(plan._id, percentage, plans);
}
const updatedUserPlans = await plans.find({ userId: new ObjectId(req.session.user._id) }).toArray();
const updatedUserPlans = await updateProgress(plans, assets, users, req.session.user._id);
res.render('plans', {
user: req.session.user,
@@ -143,20 +143,21 @@ module.exports = (middleware, users, plans, assets) => {
req.session.errMessage = "Invalid plan ID format.";
return res.status(status.BadRequest).redirect('/plans');
}
const plan = await plans.findOne({ userId: new ObjectId(req.session.userId), _id: new ObjectId(planId) });
if (!plan) {
console.log(`Plan not found with ID: ${planId} for user: ${req.session.userId}`);
req.session.errMessage = "Plan not found or you do not have permission to view it.";
return res.status(status.NotFound).redirect('/plans');
}
const progress = await calculateProgress(plan, assets, users, req.session.userId);
res.render('planDetail', {
user: req.session.user,
plan: plan,
geoData: req.session.geoData,
assets: userAssets,
progress: progress,
suggestions: await suggestions.generateSuggestions(),
});
@@ -195,11 +196,12 @@ module.exports = (middleware, users, plans, assets) => {
if (error) {
console.error("Plan validation error:", error.details);
req.session.errMessage = "Invalid input: " + error.details.map(d => d.message.replace(/"/g, '')).join(', ');
res.status(status.BadRequest).redirect("/newPlan");
const errorMessage = "Invalid input: " + error.details.map(d => d.message.replace(/"/g, '')).join(', ');
res.status(status.BadRequest).json({ success: false, message: errorMessage });
return;
}
const newPlan = {
const planToInsert = {
userId: new ObjectId(req.session.userId),
name: value.name,
retirementAge: value.retirementAge,
@@ -210,14 +212,118 @@ module.exports = (middleware, users, plans, assets) => {
};
try {
await plans.insertOne({ userId: new ObjectId(req.session.userId), ...newPlan });
req.session.errMessage = "";
res.redirect('/plans');
await plans.insertOne(planToInsert);
res.status(status.Ok).json({ success: true, message: "Plan created successfully." });
}
catch (err) {
console.error("Error saving plan:", err);
req.session.errMessage = "An error occurred while saving your plan. Please try again.";
res.status(status.InternalServerError).redirect("/newPlan");
res.status(status.InternalServerError).json({ success: false, message: "An error occurred while saving your plan. Please try again." });
}
});
router.delete('/plans/:id', async (req, res) => {
const planId = req.params.id;
const plan = await plans.findOne({ _id: new ObjectId(planId) });
if(!plan) {
console.log(`Plan not found with ID: ${planId}`);
res.status(status.NotFound).json({ success: false, message: "Plan not found or you do not have permission to delete it." });
return;
}
if(plan.userId.toString() !== req.session.userId) {
console.log(`User ${req.session.userId} does not have permission to delete plan ${planId}`);
res.status(status.Forbidden).json({ success: false, message: "You do not have permission to delete this plan." });
return;
}
try {
await plans.deleteOne({ _id: new ObjectId(planId) });
res.status(status.Ok).json({ success: true, message: "Plan deleted successfully." });
}
catch (err) {
console.error("Error deleting plan:", err);
res.status(status.InternalServerError).json({ success: false, message: "An error occurred while deleting your plan. Please try again." });
}
});
router.get('/plans/:id/edit', async (req, res) => {
const planId = req.params.id;
const plan = await plans.findOne({ _id: new ObjectId(planId) });
if(!plan) {
console.log(`Plan not found with ID: ${planId}`);
res.status(status.NotFound).json({ success: false, message: "Plan not found or you do not have permission to edit it." });
return;
}
if(plan.userId.toString() !== req.session.userId) {
console.log(`User ${req.session.userId} does not have permission to edit plan ${planId}`);
res.status(status.Forbidden).json({ success: false, message: "You do not have permission to edit this plan." });
return;
}
res.render('editPlan', {
user: req.session.user,
plan: plan,
geoData: req.session.geoData
});
});
router.post('/plans/:id/edit', async (req, res) => {
const planId = req.params.id;
const plan = await plans.findOne({ _id: new ObjectId(planId) });
if(!plan) {
console.log(`Plan not found with ID: ${planId}`);
res.status(status.NotFound).json({ success: false, message: "Plan not found or you do not have permission to edit it." });
return;
}
if(plan.userId.toString() !== req.session.userId) {
console.log(`User ${req.session.userId} does not have permission to edit plan ${planId}`);
res.status(status.Forbidden).json({ success: false, message: "You do not have permission to edit this plan." });
return;
}
const planSchema = joi.object({
name: joi.string().min(3).max(100).required(),
retirementAge: joi.number().min(18).max(120).required(),
retirementExpenses: joi.number().min(0).required(),
retirementAssets: joi.number().min(0).required(),
retirementLiabilities: joi.number().min(0).required(),
});
// Object for Joi validation - only fields from req.body
const dataToValidate = {
name: req.body.name,
retirementAge: Number(req.body.retirementAge),
retirementExpenses: parseFloat(req.body.retirementExpenses),
retirementAssets: parseFloat(req.body.retirementAssets),
retirementLiabilities: parseFloat(req.body.retirementLiabilities),
};
const { error, value } = planSchema.validate(dataToValidate);
if (error) {
console.error("Plan validation error:", error.details);
const errorMessage = "Invalid input: " + error.details.map(d => d.message.replace(/"/g, '')).join(', ');
res.status(status.BadRequest).json({ success: false, message: errorMessage });
return;
}
const progressCalculated = await calculateProgress(value, assets, users, req.session.userId);
const planToSet = {
name: value.name,
retirementAge: value.retirementAge,
retirementExpenses: value.retirementExpenses,
retirementAssets: value.retirementAssets,
retirementLiabilities: value.retirementLiabilities,
progress: progressCalculated.percentage,
};
try {
await plans.updateOne(
{ _id: new ObjectId(planId), userId: new ObjectId(req.session.userId) },
{ $set: planToSet }
);
await updateProgress(plans, assets, users, req.session.user._id);
res.status(status.Ok).json({ success: true, message: "Plan updated successfully." });
}
catch (err) {
console.error("Error updating plan:", err);
res.status(status.InternalServerError).json({ success: false, message: "An error occurred while updating your plan. Please try again." });
}
});
@@ -329,7 +435,7 @@ module.exports = (middleware, users, plans, assets) => {
}
let redirect = referrer.includes("?profile") ? "/profile" :
referrer != "/home" ? "/plans" : referrer;
referrer != "/home" ? "/plans" : referrer;
return res.status(status.Ok).redirect(redirect);
});
@@ -353,7 +459,7 @@ module.exports = (middleware, users, plans, assets) => {
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/profile");
}
@@ -405,6 +511,7 @@ module.exports = (middleware, users, plans, assets) => {
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.";
@@ -501,7 +608,7 @@ module.exports = (middleware, users, plans, assets) => {
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
res.status(status.BadRequest);
return res.redirect("/assets");
}
+84 -1
View File
@@ -42,4 +42,87 @@ async function updatePlanProgressInDB(planId, percentage, plans) {
}
}
module.exports = { calculatePlanProgress, updatePlanProgressInDB };
async function calculateProgress(plan, assets, users, userId) {
if (!plan || typeof plan !== 'object') {
console.error("Error with the plan");
return;
}
if (!assets || typeof assets.find !== 'function') {
console.error("Error with the assets collection");
return;
}
if (!users || typeof users.findOne !== 'function') {
console.error("Error with the users collection");
return;
}
if (!userId) {
console.error("No user ID provided");
return;
}
try {
const userAssets = await assets.find({ userId: new ObjectId(userId) }).toArray();
const totalUserAssetValue = userAssets.reduce((total, asset) => total + asset.value, 0);
const totalUserPlanValue = plan.retirementAssets;
const userDoc = await users.findOne({ _id: new ObjectId(userId) });
if (!userDoc || !userDoc.dob) {
console.error("[calculateProgress] User document or DOB not found for userId:", userId);
// Ensure a structured return even on error to avoid undefined.progress issues
return { monthlyInvestment: NaN, totalCostOfRetirement: NaN, monthsUntilRetirement: NaN, yearsRetired: NaN, yearsUntilRetirement: NaN, percentage: NaN };
}
const userDob = new Date(userDoc.dob);
if (isNaN(userDob.getTime())) {
console.error("[calculateProgress] userDob is an invalid date. Aborting calculation.");
return { monthlyInvestment: NaN, totalCostOfRetirement: NaN, monthsUntilRetirement: NaN, yearsRetired: NaN, yearsUntilRetirement: NaN, percentage: NaN };
}
const today = new Date();
const userUnalivedBy = new Date(userDob);
userUnalivedBy.setFullYear(userUnalivedBy.getFullYear() + 90);
const yearOfRetirement = userDob.getFullYear() + plan.retirementAge;
const monthsUntilRetirement = (yearOfRetirement - today.getFullYear()) * 12;
const yearsRetired = userUnalivedBy.getFullYear() - yearOfRetirement;
const totalCostOfRetirement = ((plan.retirementExpenses + plan.retirementLiabilities) * 12) * yearsRetired;
const monthlyInvestment = (totalUserPlanValue - totalUserAssetValue + totalCostOfRetirement) / monthsUntilRetirement;
const percentageCalculated = (totalUserAssetValue / (totalUserPlanValue + totalCostOfRetirement)) * 100;
const progress = {};
progress.monthlyInvestment = Math.round(monthlyInvestment);
progress.totalCostOfRetirement = totalCostOfRetirement;
progress.monthsUntilRetirement = monthsUntilRetirement;
progress.yearsRetired = yearsRetired;
progress.yearsUntilRetirement = (yearOfRetirement - today.getFullYear());
progress.percentage = percentageCalculated;
return progress;
} catch (err) {
console.error("Error in calculateProgress:", err);
// Ensure a structured return even on error to avoid undefined.progress issues
return { monthlyInvestment: NaN, totalCostOfRetirement: NaN, monthsUntilRetirement: NaN, yearsRetired: NaN, yearsUntilRetirement: NaN, percentage: NaN };
}
}
async function updateProgress(plans, assets, users, userId) {
const userPlansFromDB = await plans.find({ userId: new ObjectId(userId) }).toArray();
for (const plan of userPlansFromDB) {
const progress = await calculateProgress(plan, assets, users, userId);
await updatePlanProgressInDB(plan._id, progress.percentage, plans);
}
const updatedUserPlans = await plans.find({ userId: new ObjectId(userId) }).toArray();
return updatedUserPlans;
}
module.exports = { calculatePlanProgress, updatePlanProgressInDB, calculateProgress, updateProgress};
+7 -7
View File
@@ -7,18 +7,18 @@
<% } %>
<main class="pt-24 pb-16">
<section class="bg-white dark:bg-gray-900 py-12 md:py-20">
<section class="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>
<p class="mb-12 text-lg font-normal text-gray-500 lg:text-xl sm:px-16 dark:text-gray-400">Welcome to RCalculator, your partner in building a secure and fulfilling financial future.</p>
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none md:text-5xl lg:text-6xl text-white">About RCalculator</h1>
<p class="mb-12 text-lg font-normal lg:text-xl sm:px-16 text-gray-400">Welcome to RCalculator, your partner in building a secure and fulfilling financial future.</p>
</div>
<div class="max-w-screen-md mx-auto px-4">
<h2 class="mb-4 text-3xl font-bold tracking-tight text-gray-900 dark:text-white text-center">Our Mission</h2>
<p class="mb-6 font-normal text-gray-600 dark:text-gray-400 text-lg text-center">
<h2 class="mb-4 text-3xl font-bold tracking-tight text-white text-center">Our Mission</h2>
<p class="mb-6 font-normal text-gray-400 text-lg text-center">
Our mission is to empower you with the tools and insights needed to take control of your long-term financial goals.
</p>
<div class="prose lg:prose-lg dark:prose-invert mx-auto text-gray-600 dark:text-gray-400">
<div class="prose lg:prose-lg mx-auto text-gray-400">
<p class="mb-4">
We believe that planning for your desired future, especially retirement, shouldn't be daunting. It doesn't matter what your current age or career status is starting now is what counts.
</p>
@@ -33,7 +33,7 @@
<% if (!geoData) { %>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<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">
<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-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"/>
+23 -23
View File
@@ -1,27 +1,27 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<%- include("./partials/header") %>
<main class="pt-24 pb-14">
<!-- Buttons -->
<div class="flex justify-end gap-4 px-5 py-6">
<a href="/assets?popup"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Add Asset</a>
<a href="/newPlan"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Create new plan </a>
</div>
<div class="flex justify-center">
<div class="mb-12 grid gap-y-4 gap-x-6 md:grid-cols-2 mr-3 ml-3 ">
<% plans.forEach(plan=> { %>
<%- include('./partials/dashboardBox.ejs', {plan: plan}) %>
<% }); %>
</div>
</div>
</main>
<main class="pt-24 pb-14">
<!-- Buttons -->
<div class="flex justify-end gap-4 px-5 py-6">
<a href="/assets?popup"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Add Asset</a>
<a href="/newPlan"
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
type="button">Create new plan </a>
</div>
<div class="w-full">
<div class="mb-12 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-y-4 gap-x-6">
<% plans.forEach(plan=> { %>
<%- include('./partials/dashboardBox.ejs', {thing: plan}) %>
<% }); %>
</div>
</div>
</main>
<script src="/static/scripts/dollarFormat.js"></script>
<script src="/static/scripts/dollarFormat.js"></script>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
+102
View File
@@ -0,0 +1,102 @@
<%- include('./partials/fileHeader') %>
<%- include('./partials/header') %>
<main class="container mx-auto p-4 pt-28">
<div class="max-w-2xl mx-auto bg-gray-800 p-6 sm:p-8 rounded-xl shadow-xl">
<h2 class="text-2xl font-bold text-center text-white mb-8">Edit Plan: <%= plan.name %></h2>
<form id="editPlanForm" action="/plans/<%= plan._id %>/edit" method="POST" class="space-y-6">
<div>
<label for="name" class="block text-sm font-medium text-gray-300">Plan Name</label>
<input type="text" name="name" id="name" value="<%= plan.name %>" required
class="mt-1 block w-full px-4 py-2 border border-gray-600 rounded-md shadow-sm bg-gray-700 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm placeholder-gray-400">
</div>
<div>
<label for="retirementAge" class="block text-sm font-medium text-gray-300">Desired Retirement Age</label>
<input type="number" name="retirementAge" id="retirementAge" value="<%= plan.retirementAge %>" required min="18"
class="mt-1 block w-full px-4 py-2 border border-gray-600 rounded-md shadow-sm bg-gray-700 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm placeholder-gray-400">
</div>
<div>
<label for="retirementExpenses" class="block text-sm font-medium text-gray-300">Estimated Monthly Expenses at Retirement (<%= geoData.currency || 'CAD' %>)</label>
<input type="number" name="retirementExpenses" id="retirementExpenses" value="<%= plan.retirementExpenses %>" required min="0" step="any"
class="mt-1 block w-full px-4 py-2 border border-gray-600 rounded-md shadow-sm bg-gray-700 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm placeholder-gray-400">
</div>
<div>
<label for="retirementAssets" class="block text-sm font-medium text-gray-300">Target Retirement Assets (<%= geoData.currency || 'CAD' %>)</label>
<input type="number" name="retirementAssets" id="retirementAssets" value="<%= plan.retirementAssets %>" required min="0" step="any"
class="mt-1 block w-full px-4 py-2 border border-gray-600 rounded-md shadow-sm bg-gray-700 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm placeholder-gray-400">
</div>
<div>
<label for="retirementLiabilities" class="block text-sm font-medium text-gray-300">Estimated Monthly Liabilities at Retirement (<%= geoData.currency || 'CAD' %>)</label>
<input type="number" name="retirementLiabilities" id="retirementLiabilities" value="<%= plan.retirementLiabilities %>" required min="0" step="any"
class="mt-1 block w-full px-4 py-2 border border-gray-600 rounded-md shadow-sm bg-gray-700 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm placeholder-gray-400">
</div>
<div id="formErrorMessages" class="text-red-400 text-sm my-2" style="display: none;"></div>
<div class="flex items-center justify-end space-x-4 pt-4">
<a href="/plans/<%= plan._id %>" class="inline-flex justify-center py-2 px-4 border border-gray-600 rounded-md shadow-sm bg-gray-600 text-sm font-medium text-white hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-indigo-500">
Cancel
</a>
<button type="submit"
class="inline-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-offset-gray-800 focus:ring-indigo-500">
Save Changes
</button>
</div>
</form>
</div>
</main>
<script>
// Basic client-side form submission handler to process JSON response
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('editPlanForm');
const errorMessagesDiv = document.getElementById('formErrorMessages');
if (form) {
form.addEventListener('submit', async function(event) {
event.preventDefault(); // Prevent traditional form submission
errorMessagesDiv.textContent = '';
errorMessagesDiv.style.display = 'none';
const formData = new FormData(form);
const data = {};
formData.forEach((value, key) => {
data[key] = value;
});
try {
const response = await fetch(form.action, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
const result = await response.json();
if (response.ok && result.success) {
// alert('Plan updated successfully!'); // Optional: show an alert
window.location.href = `/plans/<%= plan._id %>`; // Redirect to plan detail page
} else {
errorMessagesDiv.textContent = result.message || 'An error occurred while updating the plan.';
errorMessagesDiv.style.display = 'block';
}
} catch (error) {
console.error('Error submitting form:', error);
errorMessagesDiv.textContent = 'A network error occurred. Please try again.';
errorMessagesDiv.style.display = 'block';
}
});
}
});
</script>
<%- include('./partials/navBar') %>
<%- include('./partials/scriptLoader') %>
<%- include('./partials/footer') %>
+1 -1
View File
@@ -7,7 +7,7 @@
<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="/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">
<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-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"/>
+1 -1
View File
@@ -1,7 +1,7 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main class="pt-12 bg-slate-100 min-h-screen">
<main class="pt-12">
<div class="flex justify-center items-center py-10">
<form action="/login" method="POST">
<div class="w-96 p-8 bg-white rounded-lg shadow-xl border border-slate-200">
-42
View File
@@ -1,42 +0,0 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main class="container mx-auto p-4 pt-30">
<h2 class="text-xl text-white font-semibold mb-4">Welcome: <%= user.name %></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">Retirement Plan</h3>
<form action="/newPlan" method="post" class="space-y-4">
<div>
<label for="name" class="block text-sm font-medium text-gray-700">Plan Name</label>
<input type="text" name="name" placeholder="e.g., Retirement Plan" 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">
</div>
<div>
<label for="retirementAge" class="block text-sm font-medium text-gray-700">Desired Retirement Age</label>
<input type="number" name="retirementAge" placeholder="e.g., 65" min="18" max="120" 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">
</div>
<div>
<label for="retirementExpenses" class="block text-sm font-medium text-gray-700">Estimated Monthly Retirement Expenses</label>
<input type="number" name="retirementExpenses" min="0" placeholder="e.g., 3000" 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">
</div>
<div>
<label for="retirementAssets" class="block text-sm font-medium text-gray-700">Estimated Retirement Assets</label>
<input type="number" name="retirementAssets" min="0" placeholder="e.g., 500000" 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">
</div>
<div>
<label for="retirementLiabilities" class="block text-sm font-medium text-gray-700">Estimated Retirement Liabilities</label>
<input type="number" name="retirementLiabilities" min="0" placeholder="e.g., 50000" 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">
</div>
<div>
<button 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">Save Plan</button>
</div>
</form>
</div>
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
+1 -1
View File
@@ -7,7 +7,7 @@
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-white md:text-5xl lg:text-6xl">404 - Not found</h1>
<p class="mb-8 text-lg font-normal text-gray-300 lg:text-xl sm:px-16 lg:px-48">It appears you stumbled accross a misleading page.</p>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<a href="/" 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="/" 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-900">
Go home
<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"/>
+6 -6
View File
@@ -2,21 +2,21 @@
<dialog id="<%= asset._id %>-delete-modal" class="w-lg mx-auto bg-transparent p-8 mt-10 rounded-lg shadow-md">
<div class="relative p-4 w-full max-w-md h-full md:h-auto">
<!-- Modal content -->
<div class="relative p-4 text-center bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5">
<div class="relative p-4 text-center rounded-lg shadow bg-gray-800 sm:p-5">
<form method="dialog">
<button type="submit" class="text-gray-400 absolute top-2.5 right-2.5 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white">
<button type="submit" class="text-gray-500 absolute top-2.5 right-2.5 bg-transparent rounded-lg text-sm p-1.5 ml-auto inline-flex items-center hover:bg-gray-600 hover:text-white">
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
<span class="sr-only">Close modal</span>
</button>
</form>
<svg class="text-gray-400 dark:text-gray-500 w-11 h-11 mb-3.5 mx-auto" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>
<p class="mb-4 text-gray-500 dark:text-gray-300">Are you sure you want to delete this item?</p>
<svg class="text-gray-500 w-11 h-11 mb-3.5 mx-auto" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>
<p class="mb-4 text-gray-300">Are you sure you want to delete this item?</p>
<div class="flex justify-center items-center space-x-4">
<div style="width: 100%;">
<form method="dialog" style="width: 100%;">
<button
type="submit"
class="py-2 px-3 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-primary-300 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
class="py-2 px-3 text-sm font-medium rounded-lg border focus:ring-4 focus:outline-none focus:ring-primary-300 focus:z-10 bg-gray-700 text-gray-300 border-gray-500 hover:text-white hover:bg-gray-600 focus:ring-gray-600"
>
No, cancel
</button>
@@ -27,7 +27,7 @@
<input id="id-delete-<%= asset._id %>" name="id" type="text" hidden value="<%= asset._id %>">
<button
type="submit"
class="py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-700 focus:ring-4 focus:outline-none focus:ring-red-300 dark:bg-red-500 dark:hover:bg-red-600 dark:focus:ring-red-900"
class="py-2 px-3 text-sm font-medium text-center text-white rounded-lg focus:ring-4 focus:outline-none bg-red-500 hover:bg-red-600 focus:ring-red-900"
>
Yes, I'm sure
</button>
+3 -3
View File
@@ -36,11 +36,11 @@
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="dropdown-icons-<%= asset._id %>" class="overflow-y-auto h-40 z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-32 dark:bg-gray-700">
<ul id="dropdown-<%= asset._id %>" class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdown-icon-button-<%= asset._id %>">
<div id="dropdown-icons-<%= asset._id %>" class="overflow-y-auto h-40 z-10 hidden divide-y divide-gray-100 rounded-lg shadow-sm w-32 bg-gray-700">
<ul id="dropdown-<%= asset._id %>" class="py-2 text-sm text-gray-200" aria-labelledby="dropdown-icon-button-<%= asset._id %>">
<% icons.forEach(icon => { %>
<li>
<button onclick="selectIcon(this, '<%= asset._id %>')" type="button" value="<%= icon %>" class="inline-flex w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">
<button onclick="selectIcon(this, '<%= asset._id %>')" type="button" value="<%= icon %>" class="inline-flex w-full px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 hover:text-white" role="menuitem">
<span class="inline-flex items-center">
<img src="/static/svgs/icons/<%= icon %>.svg" class="h-4 w-4 me-2" alt="<%= icon %>"> (<%= icon %>)
</span>
+3 -3
View File
@@ -44,11 +44,11 @@
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="dropdown-icons" class="overflow-y-auto h-40 z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-32 dark:bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdown-icon-button">
<div id="dropdown-icons" class="overflow-y-auto h-40 z-10 hidden divide-y divide-gray-100 rounded-lg shadow-sm w-32 bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-200" aria-labelledby="dropdown-icon-button">
<% icons.forEach(icon => { %>
<li>
<button onclick="selectIcon(this)" type="button" value="<%= icon %>" class="inline-flex w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">
<button onclick="selectIcon(this)" type="button" value="<%= icon %>" class="inline-flex w-full px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 hover:text-white" role="menuitem">
<span class="inline-flex items-center">
<img src="/static/svgs/icons/<%= icon %>.svg" class="h-4 w-4 me-2" alt="<%= icon %>"> (<%= icon %>)
</span>
+26 -25
View File
@@ -1,33 +1,34 @@
<div class="mt-12">
<a href="/plans/<%=plan._id%>">
<div class=" relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md w-full min-h-[150px] min-w-[380px]
md:min-h-[220px] md:min-w-[500px]">
<!-- <div -->
<!-- class="bg-clip-border mx-4 rounded-xl overflow-hidden bg-gradient-to-tr from-blue-600 to-blue-400 text-white shadow-blue-500/40 shadow-lg absolute mt-2 grid h-16 w-16 place-items-center"> -->
<!-- </div> -->
<div class="p-4 flex items-center justify-between">
<p class="font-sans text-2xl leading-normal font-bold text-blue-gray-600">
<%= plan.name %>
<div class="w-full h-full mt-3">
<a href="/plans/<%=thing._id%>"
class="block p-4 w-full h-full rounded-xl transition-shadow duration-300 ease-in-out hover:shadow-xl">
<div
class="relative flex flex-col bg-white text-gray-700 shadow-md rounded-xl w-full h-full overflow-hidden min-h-[175px]">
<!-- Header Section -->
<div class="p-4 flex items-center justify-between border-b ">
<p class="text-xl font-semibold text-blue-gray-700 truncate" title="<%= thing.name %>">
<%= thing.name %>
</p>
<h4
class="planGoal block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
<%= plan.retirementAssets %>
<h4 class="planGoal text-xl font-semibold whitespace-nowrap">
<%= thing.retirementAssets %>
</h4>
</div>
<div class="border-t border-blue-gray-50 p-10">
<p class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
<div class="float-left font-bold">
Status bar:
</div>
<strong class="text-green-500">
<div class="float-right mb-2">
<%=Math.floor(plan.progress) %>% complete
</div>
<div class="bg-gray-400 mt-7">
<div class="bg-green-600 h-2.5 rounded-full dark:bg-green-500"
style="width: <%= plan.progress %>%;"></div>
<!-- Progress Bar Section - Pushed to the bottom -->
<div class="mt-2">
<div class="p-4 mt-auto border-gray-900">
<div class="flex justify-between items-center mb-1">
<p class="text-sm font-medium text-blue-gray-600">
Progress:
</p>
<p class="text-sm font-semibold justify-between text-green-500">
<%=Math.floor(thing.progress)> 100 ? 100 : Math.floor(thing.progress) %>%
</p>
</div>
<div class="w-full bg-gray-300 rounded-full h-2.5">
<div class="bg-green-500 h-2.5 rounded-full"
style="width: <%= thing.progress > 100 ? 100 : thing.progress %>%;"></div>
</div>
</div>
</div>
</div>
</a>
-2
View File
@@ -19,5 +19,3 @@
</style>
</head>
<body class="bg-gray-900 overflow-y-auto">
+6 -6
View File
@@ -1,19 +1,19 @@
<div class="fixed end-6 bottom-20 group">
<div id="factMenu" class="absolute right-0 bottom-full mb-2 hidden">
<div id="factContainer" class="bg-white p-4 rounded-lg shadow-md dark:bg-gray-700 w-64">
<p class="mb-2 text-sm text-gray-700 dark:text-gray-300">Insert the kind of short fact you would like to know more about:</p>
<input type="text" id="factInput" placeholder="Enter your topic here" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-600 dark:border-gray-500 dark:text-white dark:placeholder-gray-400">
<button type="button" id="factSubmitButton" class="mt-3 w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-700">Submit</button>
<div id="factContainer" class="p-4 rounded-lg shadow-md bg-gray-700 w-64">
<p class="mb-2 text-sm text-gray-300">Insert the kind of short fact you would like to know more about:</p>
<input type="text" id="factInput" placeholder="Enter your topic here" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 bg-gray-600 border-gray-500 text-white placeholder-gray-400">
<button type="button" id="factSubmitButton" class="mt-3 w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-700">Submit</button>
</div>
</div>
<button type="button" id="factButton" class="flex items-center justify-center text-white bg-blue-700 rounded-full w-14 h-14 hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 focus:outline-none dark:focus:ring-blue-800 hidden">
<button type="button" id="factButton" class="flex items-center justify-center text-white rounded-full w-14 h-14 bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-none focus:ring-blue-800 hidden">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>
<span class="sr-only">Get a Fact</span>
</button>
</div>
<footer class="mt-16">
<div class="fixed bottom-0 left-0 z-50 hidden lg:block w-full h-16 bg-gray-800 border-t border-gray-700 p-6 text-center text-gray-400 text-sm">
<div class="fixed bottom-0 left-0 z-30 hidden lg:block w-full h-16 bg-gray-800 border-t border-gray-700 p-6 text-center text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
+54 -63
View File
@@ -1,15 +1,15 @@
<header>
<nav class="fixed bg-gray-800 border-b border-gray-700 z-50">
<nav class="fixed bg-gray-800 border-b border-gray-700 z-30">
<div class="w-screen flex flex-col md:flex-row flex-wrap items-center justify-between p-3">
<a href="/home" class="flex xl:w-[320px] items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
<span class="self-center text-2xl font-semibold whitespace-nowrap text-white">RCalculator</span>
</a>
<% if (!geoData.country) { %>
<div role="status" id="loading">
<svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg aria-hidden="true" class="w-8 h-8 animate-spin text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
</svg>
@@ -17,7 +17,7 @@
</div>
<div style="display: none;" class="flex items-center pt-2 md:pt-0 lg:pt-0" id="currencyExchange">
<div id="exFrom" class="shrink-0 z-10 inline-flex w-[115px] items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600">
<div id="exFrom" class="shrink-0 z-10 inline-flex w-[115px] items-center py-2.5 px-4 text-sm font-medium text-center border rounded-s-lg focus:ring-4 focus:outline-none bg-gray-700 focus:ring-gray-700 text-white border-gray-600">
<img src="" id="yourFlag" class="h-4 w-4 me-2" alt="">
<p id="flagTag"></p>
</div>
@@ -25,15 +25,15 @@
<p id="exchange" class="block text-center p-2.5 w-35 z-20 text-sm border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:border-blue-500">
</p>
</div>
<button id="dropdown-country-button" value="" data-dropdown-toggle="dropdown-country" class="shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-e-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600" type="button">
<button id="dropdown-country-button" value="" data-dropdown-toggle="dropdown-country" class="shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center border rounded-e-lg focus:ring-4 focus:outline-none bg-gray-700 hover:bg-gray-600 focus:ring-gray-700 text-white border-gray-600" type="button">
<img src="" id="exchangeFlag" class="h-4 w-4 me-2" alt="">
<p id="exFlagTag"></p>
<svg class="w-2.5 h-2.5 ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="dropdown-country" class="overflow-y-auto w-[115px] h-40 z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-32 dark:bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdown-country-button">
<div id="dropdown-country" class="overflow-y-auto w-[115px] h-40 z-10 hidden divide-y divide-gray-100 rounded-lg shadow-sm w-32 bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-200" aria-labelledby="dropdown-country-button">
</ul>
</div>
@@ -42,27 +42,27 @@
<p>error</p>
<% } else { %>
<div class="flex items-center pt-2 md:pt-0 lg:pt-0">
<div class="shrink-0 z-10 w-[115px] inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600">
<div class="shrink-0 z-10 w-[115px] inline-flex items-center py-2.5 px-4 text-sm font-medium text-center border rounded-s-lg focus:ring-4 focus:outline-none bg-gray-700 focus:ring-gray-700 text-white border-gray-600">
<img src="/static/svgs/flags/<%= geoData.country %>.svg" id="yourFlag" class="h-4 w-4 me-2" alt="<%= geoData.country %>"> (<%= geoData.country %>)
<p id="flagTag"></p>
</div>
<div class="relative w-full">
<p id="exchange" class="block text-center p-2.5 w-35 z-20 text-sm text-gray-900 bg-gray-50 border-s-0 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500">
<p id="exchange" class="block text-center p-2.5 w-35 z-20 text-sm border-s-0 border bg-gray-700 border-s-gray-700 border-gray-600 placeholder-gray-400 text-white focus:border-blue-500">
$1.00 = $<%= (1 * geoData.toCurrencyRates["USD"]).toFixed(2) %>
</p>
</div>
<button id="dropdown-country-button" value="" data-dropdown-toggle="dropdown-country" class="shrink-0 w-[115px] z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-e-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600" type="button">
<button id="dropdown-country-button" value="" data-dropdown-toggle="dropdown-country" class="shrink-0 w-[115px] z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center border rounded-e-lg focus:ring-4 focus:outline-none bg-gray-700 hover:bg-gray-600 focus:ring-gray-700 text-white border-gray-600" type="button">
<img src="/static/svgs/flags/USD.svg" class="h-4 w-4 me-2" alt="USD"> (USD)
<svg class="w-2.5 h-2.5 ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
</svg>
</button>
<div id="dropdown-country" class="overflow-y-auto h-40 z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-32 dark:bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdown-country-button">
<div id="dropdown-country" class="overflow-y-auto h-40 z-10 hidden divide-y divide-gray-100 rounded-lg shadow-sm w-32 bg-gray-700">
<ul id="dropdown" class="py-2 text-sm text-gray-200" aria-labelledby="dropdown-country-button">
<% let countries = Object.keys(geoData.toCurrencyRates);%>
<% countries.forEach(item => { %>
<li>
<button onclick="switchButton(this)" type="button" value="<%= geoData.toCurrencyRates[item] %>" class="countryButton inline-flex w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">
<button onclick="switchButton(this)" type="button" value="<%= geoData.toCurrencyRates[item] %>" class="countryButton inline-flex w-full px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 hover:text-white" role="menuitem">
<span class="inline-flex items-center">
<img src="/static/svgs/flags/<%= item %>.svg" class="h-4 w-4 me-2" alt="<%= item %>"> (<%= item %>)
</span>
@@ -74,23 +74,23 @@
</div>
<% } %>
<div class="hidden w-full lg:block lg:w-[320px]" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 lg:bg-transparent dark:bg-gray-800 lg:dark:bg-transparent dark:border-gray-700">
<ul class="flex flex-col font-medium mt-4 rounded-lg lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 bg-gray-800 lg:bg-transparent border-gray-700">
<li class="flex items-center justify-center">
<a href="/home" class="block w-full text-center 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">Dashboard</a>
<a href="/home" class="block w-full text-center py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg:hover:bg-transparent">Dashboard</a>
</li>
<li class="flex items-center justify-center">
<a href="/assets" class="block w-full text-center 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">Assets</a>
<a href="/assets" class="block w-full text-center py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg:hover:bg-transparent">Assets</a>
</li>
<li class="flex items-center justify-center">
<a href="/plans" class="block w-full text-center 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">Plans</a>
<a href="/plans" class="block w-full text-center py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg:hover:bg-transparent">Plans</a>
</li>
<li>
<div class="text-center">
<button class="flex flex-row text-white hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-full text-sm focus:outline-none dark:focus:ring-blue-800" type="button" data-drawer-target="drawer-navigation" data-drawer-show="drawer-navigation" data-drawer-placement="right" aria-controls="drawer-navigation">
<svg class="w-[30px] h-[30px] text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
<button class="flex flex-row text-white hover:bg-blue-700 focus:ring-4 font-medium rounded-full text-sm focus:outline-none focus:ring-blue-800" type="button" id="drawer-toggle" data-drawer-target="drawer-navigation" data-drawer-placement="right" aria-controls="drawer-navigation">
<svg class="w-[30px] h-[30px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
</svg>
<svg class="w-[30px] h-[30px] text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<svg class="w-[30px] h-[30px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5 7h14M5 12h14M5 17h14"/>
</svg>
@@ -101,49 +101,40 @@
</div>
<!-- drawer component -->
<div id="drawer-navigation" class="hidden lg:block fixed top-0 right-0 z-40 w-64 h-screen p-4 overflow-y-auto transition-transform translate-x-full bg-white dark:bg-gray-800" tabindex="-1" aria-labelledby="drawer-navigation-label">
<h5 id="drawer-navigation-label" class="text-base font-semibold text-gray-500 uppercase dark:text-gray-400"><%= user.name %></h5>
<button type="button" data-drawer-hide="drawer-navigation" aria-controls="drawer-navigation" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 end-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white" >
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
<span class="sr-only">Close menu</span>
</button>
<div class="">
<div class="w-full pt-5 pl-2.5">
<a href="/logout" class="text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-full text-sm px-20 py-2.5 text-center me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Logout
</a>
</div>
</div>
<div class="py-4 overflow-y-auto">
<ul class="space-y-2 font-medium">
<li>
<a href="/profile" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
<svg class="w-5 h-5 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21">
<path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
</svg>
<span class="ms-3">Profile</span>
</a>
</li>
<li>
<a href="/settings" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
<svg class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21">
<path d="M16.975 11H10V4.025a1 1 0 0 0-1.066-.998 8.5 8.5 0 1 0 9.039 9.039.999.999 0 0 0-1-1.066h.002Z"/>
<path d="M12.5 0c-.157 0-.311.01-.565.027A1 1 0 0 0 11 1.02V10h8.975a1 1 0 0 0 1-.935c.013-.188.028-.374.028-.565A8.51 8.51 0 0 0 12.5 0Z"/>
</svg>
<span class="ms-3">Settings</span>
</a>
</li>
<li>
<a href="aboutUs" class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
<svg class="shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
<path d="M14 2a3.963 3.963 0 0 0-1.4.267 6.439 6.439 0 0 1-1.331 6.638A4 4 0 1 0 14 2Zm1 9h-1.264A6.957 6.957 0 0 1 15 15v2a2.97 2.97 0 0 1-.184 1H19a1 1 0 0 0 1-1v-1a5.006 5.006 0 0 0-5-5ZM6.5 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 10H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z"/>
</svg>
<span class="flex-1 ms-3 whitespace-nowrap">About Us</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
<div id="drawer-navigation" class="lg:block fixed top-0 right-0 z-60 w-64 h-screen p-4 overflow-y-auto transition-transform translate-x-full bg-gray-800" tabindex="-1" aria-labelledby="drawer-navigation-label">
<h5 id="drawer-navigation-label" class="text-base font-semibold uppercase text-gray-400"><%= user.name %></h5>
<button type="button" data-drawer-hide="drawer-navigation" aria-controls="drawer-navigation" class="text-gray-400 bg-transparent rounded-lg text-sm p-1.5 absolute top-2.5 end-2.5 inline-flex items-center hover:bg-gray-600 hover:text-white" >
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
<span class="sr-only">Close menu</span>
</button>
<div class="">
<div class="w-full pt-5 pl-2.5">
<a href="/logout" class="text-white focus:outline-none focus:ring-4 font-medium rounded-full text-sm px-20 py-2.5 text-center me-2 mb-2 bg-blue-600 hover:bg-blue-700 focus:ring-blue-800">
Logout
</a>
</div>
</div>
<div class="py-4 overflow-y-auto">
<ul class="space-y-2 font-medium">
<li>
<a href="/profile" class="flex items-center p-2 rounded-lg text-white hover:bg-gray-700 group">
<svg class="w-5 h-5 text-gray-500 text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21">
<path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
</svg>
<span class="ms-3">Profile</span>
</a>
</li>
<li>
<a href="aboutUs" class="flex items-center p-2 rounded-lg text-white hover:bg-gray-700 group">
<svg class="shrink-0 w-5 h-5 transition duration-75 text-gray-400 group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
<path d="M14 2a3.963 3.963 0 0 0-1.4.267 6.439 6.439 0 0 1-1.331 6.638A4 4 0 1 0 14 2Zm1 9h-1.264A6.957 6.957 0 0 1 15 15v2a2.97 2.97 0 0 1-.184 1H19a1 1 0 0 0 1-1v-1a5.006 5.006 0 0 0-5-5ZM6.5 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 10H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z"/>
</svg>
<span class="flex-1 ms-3 whitespace-nowrap">About Us</span>
</a>
</li>
</ul>
</div>
</div>
</header>
+6 -6
View File
@@ -3,10 +3,10 @@
<div class="w-screen flex flex-wrap items-center justify-between p-4">
<a href="/" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
<span class="self-center text-2xl font-semibold whitespace-nowrap text-white">RCalculator</span>
</a>
<button data-collapse-toggle="navbar-solid-bg" type="button"
class="inline-flex items-center justify-center text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
class="inline-flex items-center justify-center text-sm rounded-lg lg:hidden focus:outline-none focus:ring-2 text-gray-400 hover:bg-gray-700 focus:ring-gray-600"
aria-controls="navbar-solid-bg" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="none" viewBox="0 0 17 14">
@@ -15,15 +15,15 @@
</svg>
</button>
<div class="hidden w-full lg:block lg:w-auto" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 lg:bg-transparent dark:bg-gray-800 lg:dark:bg-transparent dark:border-gray-700">
<ul class="flex flex-col font-medium mt-4 rounded-lg lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 bg-gray-800 lg:bg-transparent border-gray-700">
<li>
<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>
<a href="/" class="block py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg:hover:bg-transparent">Home</a>
</li>
<li>
<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>
<a href="/login" class="block py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg: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>
<a href="mailto:rcalculator@gmail.com" class="block py-2 px-3 lg:p-0 rounded lg:border-0 text-white lg:hover:text-blue-500 hover:bg-gray-700 hover:text-white lg:hover:bg-transparent">Contact us</a>
</li>
</ul>
</div>
+9 -9
View File
@@ -1,20 +1,20 @@
<div class="fixed block bottom-0 left-0 z-50 lg:hidden w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-gray-500 dark:text-gray-400 text-sm">
<div class="fixed block bottom-0 left-0 z-50 lg:hidden w-full h-16 bg-gray-800 border-t border-gray-700 text-gray-400 text-sm">
<div class="grid h-16 grid-cols-4 mx-auto font-medium">
<a href="/home" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<a href="/home" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-800 group">
<img src="/static/svgs/dashboard.svg" alt="dashboard">
<span class="text-gray-500 dark:text-gray-400 text-sm">Dashboard</span>
<span class="text-gray-400 text-sm">Dashboard</span>
</a>
<a href="/assets" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<a href="/assets" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-800 group">
<img src="/static/svgs/assets.svg" alt="assets">
<span class="text-gray-500 dark:text-gray-400 text-sm">Assets</span>
<span class="text-gray-400 text-sm">Assets</span>
</a>
<a href="/plans" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<a href="/plans" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-800 group">
<img src="/static/svgs/plans.svg" alt="plans">
<span class="text-gray-500 dark:text-gray-400 text-sm">Plans</span>
<span class="text-gray-400 text-sm">Plans</span>
</a>
<a href="/more" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<a href="/more" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-800 group">
<img src="/static/svgs/more.svg" alt="more">
<span class="text-gray-500 dark:text-gray-400 text-sm">More</span>
<span class="text-gray-400 text-sm">More</span>
</a>
</div>
</div>
+56 -29
View File
@@ -1,75 +1,102 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main class="container mx-auto p-4">
<h2 class="text-xl text-white font-semibold mb-4">Welcome: <%= user.name %></h2>
<div class="max-w-lg mx-auto bg-white p-6 sm:p-8 rounded-xl shadow-lg space-y-6 dark:bg-gray-800">
<main class="container mx-auto p-4 pt-28">
<div class="max-w-lg mx-auto p-6 sm:p-8 rounded-xl shadow-lg space-y-6 bg-gray-800">
<div class="text-center">
<h3 class="text-2xl font-bold text-gray-800 dark:text-white"><%= plan.name %></h3>
<h3 class="text-2xl font-bold text-white"><%= plan.name %></h3>
</div>
<div>
<div class="flex justify-between mb-1">
<span class="text-sm font-medium text-blue-700 dark:text-blue-400">Progress</span>
<span class="text-sm font-medium text-blue-700 dark:text-blue-400"><%= plan.progress %>%</span>
<span class="text-sm font-medium text-blue-400">Progress</span>
<span class="text-sm font-medium text-blue-400"><%-plan.progress > 100 ? 100 : plan.progress%>%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-3 dark:bg-gray-700">
<div class="bg-blue-600 h-3 rounded-full dark:bg-blue-500" style="width: <%= plan.progress %>%;"></div>
<div class="w-full rounded-full h-3 bg-gray-700">
<div class="h-3 rounded-full bg-blue-500" style="width: <%= plan.progress > 100 ? 100 : plan.progress %>%;"></div>
</div>
</div>
<div class="border-t border-gray-200 dark:border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-3">Assets:</h4>
<div>
<div class="flex justify-between mb-1">
<span class="text-sm font-medium text-blue-400">Calculated Monthly Investment</span>
<span class="text-sm font-medium text-blue-400"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(progress.monthlyInvestment > 0 ? progress.monthlyInvestment : 0) %></span>
</div>
</div>
<div class="border-t border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-300 mb-3">Assets:</h4>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4">
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Number of Assets:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= assets.length %></p>
<label class="block text-sm font-medium text-gray-400">Number of Assets:</label>
<p class="mt-1 text-md text-white"><%= assets.length %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Total Value:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= assets.reduce((total, asset) => total + asset.value, 0) %></p>
<label class="block text-sm font-medium text-gray-400">Total Value:</label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(assets.reduce((total, asset) => total + asset.value, 0)) %></p>
</div>
</div>
</div>
<div class="border-t border-gray-200 dark:border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-3">Plan Details:</h4>
<div class="border-t border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-300 mb-3">Plan Details:</h4>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4">
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Retirement Age:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= plan.retirementAge %></p>
<label class="block text-sm font-medium text-gray-400">Retirement Age:</label>
<p class="mt-1 text-md text-white"><%= plan.retirementAge %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Target Monthly Expenses:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= plan.retirementExpenses %></p>
<label class="block text-sm font-medium0 text-gray-400">Target Monthly Expenses (Minus Liabilities):</label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(plan.retirementExpenses) %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Target Retirement Assets:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= plan.retirementAssets %></p>
<label class="block text-sm font-medium text-gray-400">Target Retirement Assets (Total):</label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(plan.retirementAssets) %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-600 dark:text-gray-400">Target Retirement Liabilities:</label>
<p class="mt-1 text-md text-gray-900 dark:text-white"><%= plan.retirementLiabilities %></p>
<label class="block text-sm font-medium text-gray-400">Target Retirement Liabilities (Monthly):</label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(plan.retirementLiabilities) %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-400">Years Until Retirement:</label>
<p class="mt-1 text-md text-white"><%- progress.yearsUntilRetirement %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-400">Years Retired:</label>
<p class="mt-1 text-md text-white"><%- progress.yearsRetired %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-400">Total Cost of Retirement:</label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(progress.totalCostOfRetirement) %></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-400">Total amount needed (Assets + Retirement Expenses): </label>
<p class="mt-1 text-md text-white"><%- new Intl.NumberFormat('en-US', { style: 'currency', currency: geoData.currency ? geoData.currency : 'CAD' }).format(progress.totalCostOfRetirement + progress.monthlyInvestment * progress.monthsUntilRetirement) %></p>
</div>
</div>
</div>
<div class="border-t border-gray-200 dark:border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-3">Suggestions:</h4>
<div class="border-t border-gray-700 pt-6 space-y-4">
<h4 class="text-lg font-semibold text-gray-300 mb-3">Suggestions:</h4>
<div class="mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg dark:bg-gray-700 dark:border-gray-600">
<p class="text-sm text-blue-700 dark:text-blue-300">
<div class="mt-6 p-4 border rounded-lg bg-gray-700 border-gray-600">
<p class="text-sm text-blue-300">
<%= suggestions %>
</p>
</div>
</div>
<div class="flex items-center justify-center space-x-2">
<button type="button" 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 cursor-pointer" onclick="editPlan('<%= plan._id %>')">Edit Plan</button>
<button type="button" class="py-2 px-4 border border-red-600 rounded-md shadow-sm text-sm font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 cursor-pointer" onclick="deletePlan('<%= plan._id %>')">Delete Plan</button>
</div>
</div>
</main>
<script src="/static/scripts/planManager.js"></script>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<%- include("./partials/footer") %>
+129 -7
View File
@@ -2,24 +2,146 @@
<%- include("./partials/header") %>
<main class="container mx-auto p-4 pt-28">
<h2 class="text-xl text-white font-semibold mb-4">Welcome: <%= user.name %></h2>
<div class="max-w-md mx-auto bg-white p-8 mb-10 rounded-lg shadow-md space-y-4">
<h3 class="text-lg font-medium mb-6">My Retirement Plans</h3>
<a href="/newPlan" class="block max-w-sm p-2"><div class="text-center bg-blue-600 text-white py-1 w-full rounded-md hover:bg-blue-700 hover:text-white font-semibold">New Plan</div></a>
<!-- Changed link to a button to open modal -->
<button id="openNewPlanModalBtn" class="block w-full max-w-sm p-2"><div class="text-center bg-blue-600 text-white py-1 w-full rounded-md hover:bg-blue-700 hover:text-white font-semibold">New Plan</div></button>
<hr class="mt-3">
<% plans.forEach(plan => { %>
<a href="/plans/<%= plan._id %>" class="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow-sm hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"><%= plan.name %></h5>
<div class="w-full bg-black rounded-full h-2.5 mb-4 dark:bg-black">
<div class="bg-green-600 h-2.5 rounded-full dark:bg-green-500" style="width: <%= plan.progress %>%;"></div>
<a href="/plans/<%= plan._id %>" class="block max-w-sm p-6 border rounded-lg shadow-sm bg-gray-800 border-gray-700 hover:bg-gray-700">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-white"><%= plan.name %></h5>
<div class="w-full rounded-full h-2.5 mb-4 bg-black">
<div class=" h-2.5 rounded-full bg-green-500" style="width: <%= plan.progress > 100 ? 100 : plan.progress %>%;"></div>
</div>
<p class="font-normal text-gray-700 dark:text-gray-400"><%= plan.description %></p>
<p class="font-normal text-gray-400"><%= plan.description %></p>
</a>
<% }) %>
</div>
<!-- New Plan Modal - Styled like createAsset.ejs -->
<dialog id="newPlanDialog" class="w-lg mx-auto bg-white p-8 mt-10 rounded-lg shadow-md">
<!-- Header: Title and Cancel button -->
<div class="flex flex-row justify-between items-center mb-4">
<h3 class="text-lg font-bold text-gray-900">Create New Retirement Plan</h3>
<form method="dialog" id="cancelNewPlanDialogForm">
<button type="submit" 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 cursor-pointer">Cancel</button>
</form>
</div>
<!-- Form Content -->
<div>
<form id="newPlanForm" class="space-y-4">
<div>
<label for="name" class="block text-sm font-medium text-gray-700 text-left">Plan Name</label>
<input type="text" name="name" id="planName" placeholder="e.g., My Awesome Plan" 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" required>
</div>
<div>
<label for="retirementAge" class="block text-sm font-medium text-gray-700 text-left">Desired Retirement Age</label>
<input type="number" name="retirementAge" id="retirementAge" placeholder="e.g., 65" min="18" max="120" 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" required>
</div>
<div>
<label for="retirementExpenses" class="block text-sm font-medium text-gray-700 text-left">Estimated Monthly Retirement Expenses</label>
<input type="number" name="retirementExpenses" id="retirementExpenses" min="0" placeholder="e.g., 3000" 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" required>
</div>
<div>
<label for="retirementAssets" class="block text-sm font-medium text-gray-700 text-left">Estimated Retirement Assets</label>
<input type="number" name="retirementAssets" id="retirementAssets" min="0" placeholder="e.g., 500000" 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" required>
</div>
<div>
<label for="retirementLiabilities" class="block text-sm font-medium text-gray-700 text-left">Estimated Retirement Liabilities</label>
<input type="number" name="retirementLiabilities" id="retirementLiabilities" min="0" placeholder="e.g., 50000" 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" required>
</div>
<div id="newPlanError" class="text-red-500 text-sm mt-2" style="display: none;"></div>
<!-- Form Buttons: Save Plan and Reset -->
<div class="mt-6 flex flex-row justify-between">
<button type="button" id="resetNewPlanFormBtn" 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">Reset</button>
<button id="submitNewPlanBtn" type="submit" 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">Save Plan</button>
</div>
</form>
</div>
</dialog>
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/scriptLoader") %>
<script>
document.addEventListener('DOMContentLoaded', () => {
const openModalBtn = document.getElementById('openNewPlanModalBtn');
const newPlanDialog = document.getElementById('newPlanDialog');
const newPlanForm = document.getElementById('newPlanForm');
const submitNewPlanBtn = document.getElementById('submitNewPlanBtn');
const newPlanError = document.getElementById('newPlanError');
const resetNewPlanFormBtn = document.getElementById('resetNewPlanFormBtn');
openModalBtn.addEventListener('click', () => {
newPlanDialog.showModal();
// Error reset is now handled by 'close' event, but good to clear on open too
newPlanError.style.display = 'none';
newPlanError.textContent = '';
});
// Handles form reset and error clearing when dialog is closed by any means (Esc, Cancel button, backdrop click, successful submit)
newPlanDialog.addEventListener('close', () => {
newPlanForm.reset();
newPlanError.style.display = 'none';
newPlanError.textContent = '';
});
// Close dialog if user clicks on the backdrop
newPlanDialog.addEventListener('click', (event) => {
if (event.target === newPlanDialog) {
newPlanDialog.close(); // This will trigger the 'close' event listener above
}
});
resetNewPlanFormBtn.addEventListener('click', () => {
newPlanForm.reset();
newPlanError.style.display = 'none';
newPlanError.textContent = '';
});
newPlanForm.addEventListener('submit', async (event) => {
event.preventDefault();
submitNewPlanBtn.disabled = true;
submitNewPlanBtn.textContent = 'Saving...';
newPlanError.style.display = 'none';
const formData = new FormData(newPlanForm);
const data = Object.fromEntries(formData.entries());
try {
const response = await fetch('/newPlan', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
if (response.ok) {
const result = await response.json();
if (result.success) {
newPlanDialog.close(); // This will trigger the 'close' event listener
window.location.reload(); // Reload to see the new plan
} else {
newPlanError.textContent = result.message || 'Failed to create plan. Please try again.';
newPlanError.style.display = 'block';
}
} else {
const errorData = await response.json();
newPlanError.textContent = errorData.message || `Error: ${response.status} - ${response.statusText}`;
newPlanError.style.display = 'block';
}
} catch (error) {
console.error('Error submitting new plan:', error);
newPlanError.textContent = 'An unexpected error occurred. Please try again.';
newPlanError.style.display = 'block';
}
finally {
submitNewPlanBtn.disabled = false;
submitNewPlanBtn.textContent = 'Save Plan';
}
});
});
</script>
<%- include("./partials/footer") %>
+6 -6
View File
@@ -6,21 +6,21 @@
<dialog id="delete-warning-modal" class="w-lg mx-auto bg-transparent p-8 mt-10 rounded-lg shadow-md">
<div class="relative p-4 w-full max-w-md h-full md:h-auto">
<!-- Modal content -->
<div class="relative p-4 text-center bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5">
<div class="relative p-4 text-center rounded-lg shadow bg-gray-800 sm:p-5">
<form method="dialog">
<button type="submit" class="text-gray-400 absolute top-2.5 right-2.5 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white">
<button type="submit" class="text-gray-400 absolute top-2.5 right-2.5 bg-transparent rounded-lg text-sm p-1.5 ml-auto inline-flex items-center hover:bg-gray-600 hover:text-white">
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
<span class="sr-only">Close modal</span>
</button>
</form>
<svg class="text-gray-400 dark:text-gray-500 w-11 h-11 mb-3.5 mx-auto" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>
<p class="mb-4 text-gray-500 dark:text-gray-300">Are you sure you want to delete you account? This process cannot be undone.</p>
<svg class="text-gray-500 w-11 h-11 mb-3.5 mx-auto" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>
<p class="mb-4 text-gray-300">Are you sure you want to delete you account? This process cannot be undone.</p>
<div class="flex justify-center items-center space-x-4">
<div style="width: 100%;">
<form method="dialog" style="width: 100%;">
<button
type="submit"
class="py-2 px-3 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-primary-300 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
class="py-2 px-3 text-sm font-medium rounded-lg border focus:ring-4 focus:outline-none focus:z-10 bg-gray-700 text-gray-300 border-gray-500 hover:text-white hover:bg-gray-600 focus:ring-gray-600"
>
No, cancel
</button>
@@ -31,7 +31,7 @@
<input id="id" name="id" type="text" hidden value="<%= user._id %>">
<button
type="submit"
class="py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-700 focus:ring-4 focus:outline-none focus:ring-red-300 dark:bg-red-500 dark:hover:bg-red-600 dark:focus:ring-red-900"
class="py-2 px-3 text-sm font-medium text-center rounded-lg focus:ring-4 focus:outline-none focus:ring-red-300 bg-red-500 hover:bg-red-600 focus:ring-red-900"
>
Yes, I'm sure
</button>
+1 -1
View File
@@ -1,7 +1,7 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main class="pt-12 bg-slate-100 min-h-screen">
<main class="pt-12">
<div class="flex justify-center items-center py-10">
<form action="/signup" method="POST">
<div class="w-96 p-8 bg-white rounded-lg shadow-xl border border-slate-200">