Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ h1,h2,h3,h4,h5,h6{
.container-fluid-custom{
max-width: 1600px;
}
.card small {
font-size: 0.8rem;
display: block;
margin-top: 10px;
color: #6c757d;
}

.btn{
padding-left: 1.6rem;
Expand Down
6 changes: 4 additions & 2 deletions server/controllers/dashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ exports.dashboard = async (req, res) => {
{ $sort: { updatedAt: -1 } },
{ $match: { user: new mongoose.Types.ObjectId(req.user.id) } },
{
$project: {
$project: {
title: { $substr: ["$title", 0, 30] },
body: { $substr: ["$body", 0, 100] },
},
createdAt: 1,
updatedAt: 1
}
},
])
.skip(perPage * page - perPage)
Expand Down
5 changes: 5 additions & 0 deletions views/dashboard/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<a href="/dashboard/item/ <%= notes[i]._id %>" class="card-body text-decoration-none">
<h5 class="card-title"><%= notes[i].title %></h5>
<p class="card-text"><%= notes[i].body %></p>
<small class="position-absolute bottom-0 end-0 m-2 text-muted small">
Created: <%= new Date(notes[i].createdAt).toLocaleString() %>
<br>
Updated: <%= new Date(notes[i].updatedAt).toLocaleString() %>
</small>
</a>
</div>
</div>
Expand Down