Add CAD fit checks and revision previews

This commit is contained in:
gagushin committed 2026-11-29 08:23:24 +04:00
1 parent b4ef20db39
commit 78d33d01a6
18 files changed
+250 -23

No files matched your search

@@ -128,6 +128,17 @@ function renderDetail(card) {
section.append(wrapper);
return section;
}));
const previews = card.previews || [];
byId("detail-previews").hidden = !previews.length;
byId("preview-list").replaceChildren(...previews.map(({ file, caption, revision }) => {
const figure = node("figure");
const image = node("img");
image.alt = caption;
image.addEventListener("error", () => image.replaceWith(node("p", "Снимок недоступен", "card-empty")));
image.src = `/api/previews/${encodeURIComponent(file)}`;
figure.append(image, node("figcaption", `${revision} — ${caption}`));
return figure;
}));
byId("markdown").textContent = card.markdown;
}