diff --git a/views/_project_detail.ejs b/views/_project_detail.ejs new file mode 100644 index 0000000..358e536 --- /dev/null +++ b/views/_project_detail.ejs @@ -0,0 +1,134 @@ +<% + // 상세(모달/단독 페이지 공용) — locals: p, comments[], me, returnTo, modal(bool) + function tagList(s) { return String(s || "").split(",").map(function (t) { return t.trim(); }).filter(Boolean); } + function reltime(d) { + var s = Math.floor((Date.now() - new Date(d).getTime()) / 1000); + if (s < 60) return "방금 전"; + var m = Math.floor(s / 60); if (m < 60) return m + "분 전"; + var h = Math.floor(m / 60); if (h < 24) return h + "시간 전"; + var dd = Math.floor(h / 24); if (dd < 7) return dd + "일 전"; + var x = new Date(d); return x.getFullYear() + "." + String(x.getMonth() + 1).padStart(2, "0") + "." + String(x.getDate()).padStart(2, "0"); + } + function isLgtm(b) { return /\blgtm\b/i.test(b || ""); } + var pdTags = tagList(p.tags); + var tops = comments.filter(function (c) { return !c.parent_id; }); + var repliesOf = function (id) { return comments.filter(function (c) { return String(c.parent_id) === String(id); }); }; +%> +
<%= p.description || "설명 없음" %>
+