dashboard col issue
This commit is contained in:
1 parent
edb0021cc6
commit
8c0e07abb3
4 files changed
+38
-32
No files matched your search
@@ -1,14 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Function takes in a number and formats it to currency
|
||||||
|
* @param {integer}
|
||||||
|
* @returns nuber formatted in currency
|
||||||
|
*/
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const number = document.querySelectorAll(".planGoal");
|
const number = document.querySelectorAll(".planGoal");
|
||||||
number.forEach(value => {
|
number.forEach(value => {
|
||||||
num = parseFloat(value.textContent);
|
num = parseFloat(value.textContent);
|
||||||
if (num >= 999999) {
|
if (num >= 999999) {
|
||||||
value.textContent = (num /= 1000000).toFixed(2) + "M";
|
value.textContent = "$" + (num /= 1000000) + "M";
|
||||||
console.log(value.textContent);
|
|
||||||
} else if (num > 999) {
|
} else if (num > 999) {
|
||||||
value.textContent = (num /= 1000).toFixed(2) + "K";
|
value.textContent = "$" + (num /= 1000) + "k";
|
||||||
} else {
|
} else {
|
||||||
return num;
|
return "$" + num;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-1
@@ -98,7 +98,8 @@ module.exports = (middleware, users, plans, assets) => {
|
|||||||
res.render('dashboard', {
|
res.render('dashboard', {
|
||||||
user: req.session.user,
|
user: req.session.user,
|
||||||
geoData: req.session.geoData,
|
geoData: req.session.geoData,
|
||||||
plans: updatedUserPlans, });
|
plans: updatedUserPlans,
|
||||||
|
});
|
||||||
|
|
||||||
return res.status(status.Ok);
|
return res.status(status.Ok);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
class="text-center cursor-pointer min-w-[150px] bg-green-600 px-4 py-2 text-white rounded hover:bg-green-800"
|
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>
|
type="button">Create new plan </a>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center sm:px-6 w-full ">
|
<div class="w-full">
|
||||||
<div class="mb-12 grid gap-y-4 gap-x-6 md:grid-cols-2 ">
|
<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=> { %>
|
<% plans.forEach(plan=> { %>
|
||||||
<%- include('./partials/dashboardBox.ejs', {plan: plan}) %>
|
<%- include('./partials/dashboardBox.ejs', {thing: plan}) %>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
<div class="mt-12">
|
<div class="w-full h-full mt-3">
|
||||||
<a href="/plans/<%=plan._id%>">
|
<a href="/plans/<%=thing._id%>"
|
||||||
<div class=" relative flex flex-col bg-clip-border rounded-xl bg-white text-gray-700 shadow-md w-full min-h-[130px] min-w-[340px]
|
class="block p-4 w-full h-full rounded-xl transition-shadow duration-300 ease-in-out hover:shadow-xl">
|
||||||
md:min-h-[220px] md:min-w-[500px]">
|
<div
|
||||||
<!-- <div -->
|
class="relative flex flex-col bg-white text-gray-700 shadow-md rounded-xl w-full h-full overflow-hidden min-h-[175px]">
|
||||||
<!-- 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"> -->
|
<!-- Header Section -->
|
||||||
<!-- </div> -->
|
<div class="p-4 flex items-center justify-between border-b ">
|
||||||
<div class="p-4 flex items-center justify-between">
|
<p class="text-xl font-semibold text-blue-gray-700 truncate" title="<%= thing.name %>">
|
||||||
<p class="font-sans text-2xl leading-normal font-bold text-blue-gray-600">
|
<%= thing.name %>
|
||||||
<%= plan.name %>
|
|
||||||
</p>
|
</p>
|
||||||
<h4
|
<h4 class="planGoal text-xl font-semibold whitespace-nowrap">
|
||||||
class="planGoal block text-right antialiased tracking-normal font-sans text-2xl font-semibold leading-snug text-blue-gray-900">
|
<%= thing.retirementAssets %>
|
||||||
<%= plan.retirementAssets %>
|
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-blue-gray-50 p-10">
|
|
||||||
<div class="float-left font-bold">
|
<!-- Progress Bar Section - Pushed to the bottom -->
|
||||||
<p class=" antialiased font-sans text-base leading-relaxed font-normal text-blue-gray-600">
|
<div class="mt-2">
|
||||||
Status bar:
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<strong class="text-green-500">
|
<div class="w-full bg-gray-300 rounded-full h-2.5">
|
||||||
<div class="float-right mb-2">
|
<div class="bg-green-500 h-2.5 rounded-full"
|
||||||
<%=Math.floor(plan.progress) > 100 ? 100 : Math.floor(plan.progress) %>% complete
|
style="width: <%= thing.progress > 100 ? 100 : thing.progress %>%;"></div>
|
||||||
</div>
|
</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 > 100 ? 100 : plan.progress %>%;"></div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user