%
// 상세(모달/단독 페이지 공용) — 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); }); };
%>
<%- icon("repo", { size: 18 }) %>
<%= p.title %>
"><%- icon(p.is_public ? "globe" : "lock", { size: 11 }) %><%= p.is_public ? "공개" : "비공개" %>
<%- identicon(p.owner_sabun, 24) %>
<%= p.owner_name || p.owner_sabun %>
· <%= reltime(p.created_at) %> 공유
<% if (p.lang) { %><%= p.lang %><% } %>
<% if (modal) { %>
<% } else { %>
← 대시보드
<% } %>
<% if (pdTags.length) { %>
<% pdTags.forEach(function (t) { %><%= t %><% }); %>
<% } %>
<% if (p.description && p.description.trim()) { %>
<%- renderMarkdown(p.description) %>
<% } else { %>
설명 없음
<% } %>
<% if (p.app_url) { %>
바로가기 <%- icon("ext", { size: 12, fill: "#fff" }) %>
<% } %>
<% if (p.repo_url) { %>
<%- icon("code", { size: 14 }) %>저장소
<% } %>
<% if (p.owner_sabun === me) { %>
<% } %>