previews on home

This commit is contained in:
schmeeve
2026-09-23 19:10:01 -07:00
parent 197da6754f
commit 7788c10fde
3 changed files with 52 additions and 9 deletions

View File

@@ -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;