previews on home
This commit is contained in:
@@ -410,10 +410,15 @@ function noteList(notes) {
|
||||
const meta = el("div", { class: "note-meta" });
|
||||
if (isCommon) meta.appendChild(el("span", { class: "common-badge", text: "common" }));
|
||||
meta.appendChild(document.createTextNode(`${n.username} · ${relTime(n.updated_at)}`));
|
||||
ul.appendChild(el("li", { class: isCommon ? "note-item note-common" : "note-item", onclick: () => openNote(n.id) }, [
|
||||
if (n.attachments) meta.appendChild(el("span", { class: "attach-count", text: n.attachments + " attachment" + (n.attachments === 1 ? "" : "s") }));
|
||||
const bodyEl = el("div", { class: "note-body" }, [
|
||||
el("div", { class: "note-title", text: n.title || "Untitled" }),
|
||||
meta,
|
||||
el("div", { class: "note-tags", text: tags }),
|
||||
]);
|
||||
ul.appendChild(el("li", { class: isCommon ? "note-item note-common" : "note-item", onclick: () => openNote(n.id) }, [
|
||||
n.image ? el("img", { class: "note-thumb", src: n.image, alt: "", loading: "lazy" }) : null,
|
||||
bodyEl,
|
||||
]));
|
||||
}
|
||||
return ul;
|
||||
|
||||
Reference in New Issue
Block a user