diff --git a/views/dashboard.ejs b/views/dashboard.ejs index f9e67d1..91185c6 100644 --- a/views/dashboard.ejs +++ b/views/dashboard.ejs @@ -1,79 +1,190 @@ <%- include("_header") %> -
-
- -
-
-
🔗 개발 사이트 바로가기
-
- <% siteGroups.forEach(function(g){ %> -
<%= g.group %>
- - <% }); %> -
-
+<% + // 뷰 로컬 헬퍼 (빌드 없이 EJS 스크립틀릿으로) + function tagList(s) { return String(s || "").split(",").map(function (t) { return t.trim(); }).filter(Boolean); } + function fdate(d) { var x = new Date(d); return x.getFullYear() + "." + String(x.getMonth() + 1).padStart(2, "0") + "." + String(x.getDate()).padStart(2, "0"); } + function isoDate(d) { try { return new Date(d).toISOString().slice(0, 10); } catch (e) { return ""; } } + function searchText(p) { return (p.title + " " + (p.description || "") + " " + (p.tags || "") + " " + p.owner_sabun + " " + (p.owner_name || "")).toLowerCase(); } + var myTotal = myProjects.length; + var mySharedCount = myProjects.filter(function (p) { return p.is_public; }).length; + var myPrivateCount = myTotal - mySharedCount; + var starredCount = feedProjects.filter(function (p) { return p.starred; }).length; +%> -
-
📂 공유 프로젝트
- <% if (projects.length === 0) { %> -
아직 공유된 프로젝트가 없습니다. 오른쪽에서 추가해 보세요.
- <% } else { %> - <% projects.forEach(function(p){ %> -
- <%= p.title %> -
- <%= p.owner_name %> · <%= new Date(p.updated_at).toLocaleDateString("ko-KR") %> -   ⭐ <%= p.star_count %> -   💬 <%= p.comment_count %> -
- <% if (p.description) { %>
<%= p.description %>
<% } %> - <% if (p.tags) { %> -
- <% p.tags.split(",").map(t=>t.trim()).filter(Boolean).forEach(function(t){ %> - <%= t %> - <% }); %> -
- <% } %> -
- <% }); %> - <% } %> -
+
+ + +
+
+
+

개발 도구

+ SSO로 한 번에 로그인 · 새 탭으로 이동
+ <% if (user.isAdmin) { %> + <%- icon("lock", { size: 11 }) %>관리자 도구 표시 중 + <% } %> +
+ +
- -
-
-
➕ 프로젝트 공유
-
-
- - - - - - - - - - -
- -
-
+ +
+ +
+
+

내 프로젝트

+ <%= user.sabun %> 님의 작업 공간 +
+
+
+ + + +
+ +
+
+ +
+ <% myProjects.forEach(function (p) { var tags = tagList(p.tags); %> +
" data-open-id="<%= p.id %>" data-vis="<%= p.is_public ? "public" : "private" %>"> +
+
+ <%- icon("repo", { size: 16 }) %> + <%= p.title %> +
+ "> + <%- icon(p.is_public ? "globe" : "lock", { size: 11 }) %><%= p.is_public ? "공개" : "비공개" %> +
+
<%= p.description || "설명 없음" %>
+ <% if (tags.length) { %> +
<% tags.forEach(function (t) { %><%= t %><% }); %>
+ <% } %> +
+ <% if (p.is_public) { %> +
+ <% if (p.lang) { %><%= p.lang %><% } %> + <%- icon("heartFill", { size: 13 }) %><%= p.heart_count %> + <%- icon("starFill", { size: 13 }) %><%= p.star_count %> + <%- icon("comment", { size: 14 }) %><%= p.comment_count %> +
+
+ + +
+ <% } else { %> + 나만 볼 수 있어요 +
+ + +
+ <% } %> +
+
+ <% }); %> + + + <% if (myTotal === 0) { %> +
아직 등록한 프로젝트가 없습니다. 첫 프로젝트를 공유해 보세요.
+ <% } %> +
+
+ + +
+
+
+

공유 프로젝트

+ 동료들이 만든 결과물 둘러보기 +
+
+ +
+ +
+ + <% if (feedProjects.length === 0) { %> +
아직 공유된 프로젝트가 없습니다. 위에서 첫 프로젝트를 공개해 보세요.
+ <% } %> + + +
+ <% feedProjects.forEach(function (p) { var tags = tagList(p.tags); %> +
"> +
+
+ <%- icon("repo", { size: 16 }) %> + <%= p.title %> +
+
+ + +
+
+
<%= p.description || "설명 없음" %>
+ <% if (tags.length) { %> +
<% tags.forEach(function (t) { %><%= t %><% }); %>
+ <% } %> +
+
+ <%- identicon(p.owner_sabun, 22) %> + <%= p.owner_sabun %> + · <%= fdate(p.created_at) %> +
+
+ <% if (p.lang) { %><%= p.lang %><% } %> + <%- icon("comment", { size: 14 }) %><%= p.comment_count %> + <% if (p.app_url) { %> + 바로가기 <%- icon("ext", { size: 12 }) %> + <% } %> +
+
+
+ <% }); %> +
+
+
+ +
+ +
+ + +