From ddff4b250d9fc15c0a6268a1f17dfe07dd0da006 Mon Sep 17 00:00:00 2001 From: king Date: Wed, 23 Sep 2026 21:16:43 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=EB=8C=93=EA=B8=80=20=EC=B1=84?= =?UTF-8?q?=ED=8C=85=EC=97=90=20=EC=83=81=EB=8C=80=EB=B0=A9=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=95=84=EC=9D=B4=EC=BD=98=20+=20?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=20=EC=84=B8=EC=85=98=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EC=9D=B8=EB=9D=BC=EC=9D=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../project/templates/project/inbox.html | 4 +- .../project/templates/project/mytasks.html | 4 +- .../project/templates/project/project.html | 4 +- app/static/project.css | 16 +++++ app/static/project.js | 62 ++++++++++++++++++- 5 files changed, 81 insertions(+), 9 deletions(-) diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 9846911..15ae3a4 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -96,5 +96,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index 1a0fc5e..7f7104d 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -117,5 +117,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index c131610..7ef7da5 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -518,5 +518,5 @@ - + {% endblock %} diff --git a/app/static/project.css b/app/static/project.css index 70d71d3..976f963 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -244,6 +244,15 @@ } /* 세션 제목 — 업무 카드 제목(pj-card-title 13.5px/600)보다 뚜렷하게 크고 굵게 */ .pj-col-name { font-size: 15.5px; font-weight: 800; } +/* 이름 클릭 → 인라인 이름 변경 */ +.pj-col-name.pj-col-name-editable { cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; } +.pj-col-name.pj-col-name-editable:hover { background: rgba(0,0,0,.06); } +.pj-col-head-colored .pj-col-name.pj-col-name-editable:hover { background: rgba(255,255,255,.22); } +.pj-col-name-input { + font: inherit; font-size: 15.5px; font-weight: 800; color: var(--pj-ink); + min-width: 0; flex: 1 1 auto; max-width: 70%; padding: 2px 6px; + border: 1px solid var(--pj-accent); border-radius: 6px; background: #fff; outline: none; +} /* 세션 색상 지정 시 — 점 대신 헤더(윗부분) 전체를 그 색으로 칠한다. .pj-col 의 padding(12px)만큼 밀어내 컬럼 테두리에 딱 맞춘다. */ .pj-col-head.pj-col-head-colored { @@ -670,6 +679,13 @@ .pj-chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; } .pj-chat-msg.mine { align-self: flex-end; align-items: flex-end; } .pj-chat-name { font-size: 11px; color: #6b7280; margin-bottom: 2px; padding: 0 2px; } +/* 상대방 댓글 — 왼쪽 프로필 아이콘 + (이름/말풍선/시간) 세로 묶음 */ +.pj-chat-msg.other { flex-direction: row; align-items: flex-start; gap: 8px; } +.pj-chat-av { flex: 0 0 auto; display: inline-flex; } +.pj-avatar.pj-chat-avatar { width: 34px; height: 34px; } +.pj-gicon.pj-chat-avatar { font-size: 36px; line-height: 1; color: #9aa1a9; } +.pj-chat-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; } +.pj-chat-msg.other .pj-chat-name { font-size: 12px; font-weight: 600; color: #4b5563; } .pj-chat-bubble { background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 13.5px; color: #1e1f21; white-space: pre-wrap; word-break: break-word; diff --git a/app/static/project.js b/app/static/project.js index f3f1fe3..5495ca6 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -440,19 +440,26 @@ comments.forEach(function (c) { const mine = (c.author_email || "").toLowerCase() === me; const li = document.createElement("li"); - li.className = "pj-chat-msg" + (mine ? " mine" : ""); + li.className = "pj-chat-msg" + (mine ? " mine" : " other"); const atts = attByComment[c.id] || []; const attsHtml = atts.length ? '
' + atts.map(function (a) { return attachmentHtml(a, me); }).join("") + "
" : ""; - li.innerHTML = - (mine ? "" : '' + escapeHtml(idOf(c.author_email)) + "") + + const inner = (c.body ? '
' : "") + attsHtml + '' + (mine ? '' : "") + '' + (c.created_at || "").slice(0, 16).replace("T", " ") + "" + ""; + // 상대방 댓글 — 카톡처럼 왼쪽에 프로필 아이콘, 그 옆에 이름 + 말풍선. + li.innerHTML = mine + ? inner + : '' + avatarHtml(c.author_email, "pj-chat-avatar") + "" + + '
' + + '' + escapeHtml(idOf(c.author_email)) + "" + + inner + + "
"; const bubble = li.querySelector(".pj-chat-bubble"); if (bubble) bubble.textContent = c.body; if (mine) { @@ -2079,6 +2086,55 @@ renderBoard(); } catch (err) { showToast("삭제 실패: " + err.message, "error"); } } + // 세션 이름 클릭 → 그 자리에서 이름 변경(Enter/포커스 이탈=저장, Esc=취소). + // 헤더가 드래그(세션 재정렬) 대상이라 편집 중엔 draggable 을 꺼 둔다 — + // 안 끄면 입력칸 안에서 글자 선택하려고 끌면 컬럼이 끌려간다. + const nameEl = col.querySelector(".pj-col-name"); + if (nameEl) { + nameEl.classList.add("pj-col-name-editable"); + nameEl.title = "클릭해서 이름 변경"; + nameEl.addEventListener("click", function (e) { + e.stopPropagation(); + const head = col.querySelector(".pj-col-head"); + const wasDraggable = head.getAttribute("draggable"); + head.setAttribute("draggable", "false"); + const input = document.createElement("input"); + input.type = "text"; + input.className = "pj-col-name-input"; + input.value = s.name; + input.maxLength = 100; + nameEl.replaceWith(input); + input.focus(); + input.select(); + let done = false; + async function finish(save) { + if (done) return; + done = true; + const name = input.value.trim(); + if (!save || !name || name === s.name) { + input.replaceWith(nameEl); + if (wasDraggable) head.setAttribute("draggable", wasDraggable); + return; + } + try { + await api("PUT", "/project/api/projects/" + projectId + "/stages/" + s.id, { name: name }); + await reloadStagesForCurrentProject(); + renderBoard(); + } catch (err) { + showToast("이름 변경 실패: " + err.message, "error"); + input.replaceWith(nameEl); + if (wasDraggable) head.setAttribute("draggable", wasDraggable); + } + } + input.addEventListener("keydown", function (ev) { + if (ev.isComposing) return; // 한글 조합 중 Enter 는 무시 + if (ev.key === "Enter") { ev.preventDefault(); finish(true); } + else if (ev.key === "Escape") { ev.preventDefault(); finish(false); } + }); + input.addEventListener("blur", function () { finish(true); }); + input.addEventListener("click", function (ev) { ev.stopPropagation(); }); + }); + } const renameBtn = col.querySelector(".pj-col-rename"); if (renameBtn) renameBtn.addEventListener("click", function (e) { e.stopPropagation(); editStage(); }); const doneBtn = col.querySelector(".pj-col-toggledone");