feat(projects): 등록한 프로젝트 수정 기능 추가

- 상세(모달/단독) 소유자 영역에 '수정' 버튼 → 등록 모달을 현재 값으로 채워 재사용
- POST /projects/:id/edit 라우트 + db.updateProject(소유자 조건으로 타인 수정 차단)
- 등록/수정 공용 모달을 _project_form_modal.ejs 로 추출(dashboard·project 에서 include)
- pencil 아이콘 추가, modals.js 에 openEdit/openShare 초기화 로직

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 16:55:09 +09:00
parent 459f37608e
commit 7fe3a8fead
8 changed files with 168 additions and 62 deletions

View File

@@ -72,6 +72,16 @@
<% } %>
<% if (p.owner_sabun === me) { %>
<div class="modal-actions-owner">
<button type="button" class="comment-link" data-open-edit style="font-size:12.5px"
data-id="<%= p.id %>"
data-title="<%= p.title %>"
data-desc="<%= p.description || '' %>"
data-tags="<%= p.tags || '' %>"
data-repo="<%= p.repo_url || '' %>"
data-app="<%= p.app_url || '' %>"
data-lang="<%= p.lang || '' %>"
data-public="<%= p.is_public ? '1' : '0' %>"
data-return="<%= returnTo %>"><%- icon("pencil", { size: 13 }) %>수정</button>
<form method="post" action="/projects/<%= p.id %>/delete">
<input type="hidden" name="return_to" value="/" />
<button type="submit" class="comment-link comment-del" data-confirm="이 프로젝트를 삭제할까요? 댓글·반응도 함께 삭제됩니다." style="font-size:12.5px"><%- icon("trash", { size: 13 }) %>프로젝트 삭제</button>