Skip to content
Snippets Groups Projects
Commit 5a089b28 authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Comment timestamps

parent 0dfac2c3
Branches
Tags
No related merge requests found
...@@ -14,16 +14,30 @@ $(() => { ...@@ -14,16 +14,30 @@ $(() => {
const unread = data.filter(n => !n.is_read); const unread = data.filter(n => !n.is_read);
const read = data.filter(n => n.is_read); const read = data.filter(n => n.is_read);
console.log(read);
unread.forEach(notification => { unread.forEach(notification => {
const item = $(`<div class="widget is-teal h-m-0 h-m-b-2"><div class="widget--body h-p-2"><div class="h-c-tertiary-600 h-fs-caption">${notification.community_name} &middot; <strong>unread</strong></div><a href="${notification.link}" data-id="${notification.id}" class="h-fw-bold is-not-underlined">${notification.content}</a></div></div>`); const item = $(`<div class="widget is-teal h-m-0 h-m-b-2">
<div class="widget--body h-p-2">
<div class="h-c-tertiary-600 h-fs-caption">
${notification.community_name} &middot; <strong>unread</strong> &middot;
<span data-livestamp="${notification.created_at}">${notification.created_at}</span>
</div>
<a href="${notification.link}" data-id="${notification.id}" class="h-fw-bold is-not-underlined">${notification.content}</a>
</div>
</div>`);
$inboxContainer.append(item); $inboxContainer.append(item);
}); });
$inboxContainer.append(`<div role="separator" class="header-slide--separator"></div>`); $inboxContainer.append(`<div role="separator" class="header-slide--separator"></div>`);
read.forEach(notification => { read.forEach(notification => {
const item = $(`<div class="widget h-m-0 h-m-b-2"><div class="widget--body h-p-2"><div class="h-c-tertiary-600 h-fs-caption">${notification.community_name} &middot; read</div><a href="${notification.link}" data-id="${notification.id}" class="h-fw-bold is-not-underlined">${notification.content}</a></div></div>"`); const item = $(`<div class="widget h-m-0 h-m-b-2">
<div class="widget--body h-p-2">
<div class="h-c-tertiary-600 h-fs-caption">
${notification.community_name} &middot; read &middot;
<span data-livestamp="${notification.created_at}">${notification.created_at}</span>
</div>
<a href="${notification.link}" data-id="${notification.id}" class="h-fw-bold is-not-underlined">${notification.content}</a>
</div>
</div>"`);
$inboxContainer.append(item); $inboxContainer.append(item);
}); });
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment