message if no plans

This commit is contained in:
knighthawk4227 committed 2025-05-20 14:25:48 -07:00
1 parent dd1ad02b32
commit 436e242cf1
4 files changed
+36 -10

No files matched your search

+5 -2
View File
@@ -54,9 +54,12 @@ app.get('/', (req, res) => {
}); });
app.get('/signup', (req, res) => { app.get('/signup', (req, res) => {
let error = req.session.errMessage;
delete req.session.errMessage;
const ignore = ["User not found", "Incorrect password"]; const ignore = ["User not found", "Incorrect password"];
if (ignore.includes(req.session.errMessage)) req.session.errMessage = ""; if (ignore.includes(error)) error = "";
res.render('signup', { errMessage: req.session.errMessage }); res.render('signup', { errMessage: error });
return res.status(status.Ok); return res.status(status.Ok);
}); });
+9 -3
View File
@@ -2,8 +2,9 @@ const express = require('express');
const crypto = require('crypto'); const crypto = require('crypto');
const joi = require('joi'); const joi = require('joi');
const nodeMail = require('nodemailer'); const nodeMail = require('nodemailer');
const bcrypt = require('bcrypt'); const path = require('path');
require('dotenv').config(); require('dotenv').config();
const PATH = path.join(__dirname, '..', 'public', 'images', 'wallet.png');
const PORT = process.env.PORT; const PORT = process.env.PORT;
@@ -40,7 +41,7 @@ module.exports = (users) => {
const token = crypto.randomBytes(32).toString('hex'); const token = crypto.randomBytes(32).toString('hex');
console.log(`The reset token is ${token}`) console.log(`The reset token is ${token}`)
const expiration = Date.now() + 360000; const expiration = Date.now() + 3600000;
await users.updateOne({ email }, { await users.updateOne({ email }, {
$set: { resetToken: token, resetTokenExpires: expiration } $set: { resetToken: token, resetTokenExpires: expiration }
@@ -52,7 +53,12 @@ module.exports = (users) => {
from: process.env.EMAIL_USER, from: process.env.EMAIL_USER,
to: email, to: email,
subject: 'Password reset', subject: 'Password reset',
text: `reset your password here ${resetUrl} this link will expire within 1 hour`, text: `reset your password here ${resetUrl} this link will expire within 1 hour, \n Do not share this link with anyone
\n \n Thankyou, The RCalculator team.`,
html: `
<p>Reset your password <a href="${resetUrl}">here</a>. This link will expire in 1 hour.</p>
<p><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" alt="wallet icon" width="150"/></p>
<p>Thank you,<br/>The RCalculator team</p>`,
}; };
+19 -2
View File
@@ -13,9 +13,26 @@
</div> </div>
<div class="w-full"> <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"> <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=> { %> <% if (plans.length === 0) { %>
<div class="col-span-1 col-start-2 ml-28 mt-25">
<div class="w-86 p-4 bg-white rounded-lg shadow-xl border border-slate-200">
<h1 class="text-2xl block text-center font-semibold text-slate-700">Don't have any retirement plans? </h1>
<div class="mt-4 flex justify-center items-center">
<div class="mt-4 flex justify-center">
<a href="/plans" class="cursor-pointer border-2 border-indigo-600 bg-indigo-600 text-white py-2 px-6
rounded-md hover:bg-indigo-700 hover:border-indigo-700 font-semibold
transition-colors duration-200 focus:outline-none focus:ring-2
focus:ring-indigo-500 focus:ring-offset-2">Make one</a>
</div>
</div>
</div>
</div>
<% } else %>
<% plans.forEach(plan=> { %>
<%- include('./partials/dashboardBox.ejs', {thing: plan}) %> <%- include('./partials/dashboardBox.ejs', {thing: plan}) %>
<% }); %> <% }); %>
</div> </div>
</div> </div>
</main> </main>
+3 -3
View File
@@ -5,10 +5,10 @@
class="relative flex flex-col bg-white text-gray-700 shadow-md rounded-xl w-full h-full overflow-hidden min-h-[175px]"> 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 --> <!-- Header Section -->
<div class="p-4 flex items-center justify-between border-b "> <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 %>"> <p class="text-2xl font-bold tracking-tight text-blue-gray-700 truncate" title="<%= thing.name %>">
<%= thing.name %> <%= thing.name %>
</p> </p>
<h4 class="planGoal text-xl font-semibold whitespace-nowrap"> <h4 class="planGoal text-2xl font-bold tracking-tight whitespace-nowrap">
<%= thing.retirementAssets %> <%= thing.retirementAssets %>
</h4> </h4>
</div> </div>
@@ -17,7 +17,7 @@
<div class="mt-2"> <div class="mt-2">
<div class="p-4 mt-auto border-gray-900"> <div class="p-4 mt-auto border-gray-900">
<div class="flex justify-between items-center mb-1"> <div class="flex justify-between items-center mb-1">
<p class="text-sm font-medium text-blue-gray-600"> <p class="text-lg font-bold tracking-tight text-blue-gray-600">
Progress: Progress:
</p> </p>
<p class="text-sm font-semibold justify-between text-green-500"> <p class="text-sm font-semibold justify-between text-green-500">