feat(project): 댓글 입력칸 @태그 버튼, 답글 들여쓰기 + ↳ 화살표
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928i" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
@@ -294,7 +294,7 @@
|
||||
</ol>
|
||||
<p>작업은 하나라서 어느 보드에서 고쳐도 모두 같이 바뀝니다.</p>
|
||||
<h3>댓글</h3>
|
||||
<p>작업 창 맨 아래에 항상 고정된 댓글 칸에 쓰고 <kbd>Enter</kbd>(스크롤해도 그 자리에 있습니다). 내가 쓴 댓글은 <span class="pjh-ui">✎</span>로 고치고 <span class="pjh-ui">×</span>로 지웁니다. 댓글 속 웹 주소는 링크가 됩니다.</p>
|
||||
<p>작업 창 맨 아래에 항상 고정된 댓글 칸에 쓰고 <kbd>Enter</kbd>(스크롤해도 그 자리에 있습니다). 칸 오른쪽 <span class="pjh-ui">☺</span>는 이모티콘, <span class="pjh-ui">@</span>는 멤버 태그입니다. 답글은 원 댓글 아래 들여 쓰여 <span class="pjh-ui">↳</span> 표시와 함께 보입니다. 내가 쓴 댓글은 <span class="pjh-ui">✎</span>로 고치고 <span class="pjh-ui">×</span>로 지웁니다. 댓글 속 웹 주소는 링크가 됩니다.</p>
|
||||
</section>
|
||||
|
||||
<!-- 9. 작업 창의 하위 작업 -->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -104,5 +104,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260928h" defer></script>
|
||||
<script src="/static/project.js?v=20260928i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -100,5 +100,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260928h" defer></script>
|
||||
<script src="/static/project.js?v=20260928i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928i" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -491,5 +491,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260928h" defer></script>
|
||||
<script src="/static/project.js?v=20260928i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -70,5 +70,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260928h" defer></script>
|
||||
<script src="/static/project.js?v=20260928i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1678,8 +1678,13 @@ html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center;
|
||||
|
||||
.pj-comment-thread { border-top: 1px solid #f0f1f3; padding-top: 2px; }
|
||||
.pj-comment-thread:first-child { border-top: none; }
|
||||
.pj-comment-replies { margin-left: 30px; }
|
||||
/* 답글 — 원 댓글 본문 위치보다 더 들여 쓰고, 들여쓴 자리 왼쪽에 ↳ 화살표 */
|
||||
.pj-comment-replies { margin-left: 52px; }
|
||||
.pj-comment-item.is-reply { padding-top: 5px; padding-bottom: 5px; }
|
||||
.pj-reply-arrow {
|
||||
position: absolute; left: -26px; top: 6px;
|
||||
font-size: 20px; color: #a3a8b0; pointer-events: none;
|
||||
}
|
||||
.pj-reply-form { margin: 4px 0 8px; }
|
||||
.pj-reply-form input { padding: 5px 9px; font-size: 12.5px; }
|
||||
.pj-reply-form .pj-btn { padding: 5px 12px; font-size: 12px; }
|
||||
|
||||
@@ -1315,6 +1315,7 @@
|
||||
const cmInput = el("pj-cm-input");
|
||||
attachMentionInput(cmInput);
|
||||
attachEmojiPicker(cmInput);
|
||||
attachMentionButton(cmInput);
|
||||
if (cmInput) cmInput.addEventListener("paste", function (e) {
|
||||
const cd = e.clipboardData || window.clipboardData || {};
|
||||
// 글자(웹페이지 주소 등)가 있으면 글자 붙여넣기가 먼저 — 일부 프로그램은 복사할 때
|
||||
@@ -1947,6 +1948,33 @@
|
||||
});
|
||||
input.insertAdjacentElement("afterend", btn);
|
||||
}
|
||||
// @ 버튼 — 이모티콘 버튼 오른쪽. 누르면 커서 자리에 "@"를 넣고 멤버 메뉴를 연다
|
||||
// (attachMentionInput 의 input 이벤트가 메뉴를 띄운다). mousedown 을 막아 입력칸
|
||||
// 포커스를 유지한다 — 안 막으면 blur 로 메뉴 닫기 타이머가 돌아 방금 연 메뉴가 닫힌다.
|
||||
function attachMentionButton(input) {
|
||||
if (!input || input.dataset.pjMentionBtn) return;
|
||||
input.dataset.pjMentionBtn = "1";
|
||||
const btn = document.createElement("button");
|
||||
btn.type = "button";
|
||||
btn.className = "pj-emoji-btn pj-mention-btn";
|
||||
btn.title = "멤버 태그(@)";
|
||||
btn.innerHTML = '<span class="material-symbols-outlined">alternate_email</span>';
|
||||
btn.addEventListener("mousedown", function (e) { e.preventDefault(); });
|
||||
btn.addEventListener("click", function () {
|
||||
if (document.activeElement !== input) input.focus();
|
||||
const start = input.selectionStart == null ? input.value.length : input.selectionStart;
|
||||
const end = input.selectionEnd == null ? start : input.selectionEnd;
|
||||
const before = input.value.slice(0, start);
|
||||
const ins = (before && !/\s$/.test(before) ? " " : "") + "@";
|
||||
input.value = before + ins + input.value.slice(end);
|
||||
const caret = start + ins.length;
|
||||
input.setSelectionRange(caret, caret);
|
||||
input.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
});
|
||||
const after = input.nextElementSibling && input.nextElementSibling.classList.contains("pj-emoji-btn")
|
||||
? input.nextElementSibling : input;
|
||||
after.insertAdjacentElement("afterend", btn);
|
||||
}
|
||||
|
||||
// ════════════════════════════════════════════════════════════
|
||||
// 댓글 공용 — 작업 창 댓글 목록과 채팅형 댓글 팝업이 같이 쓴다
|
||||
@@ -5533,6 +5561,8 @@
|
||||
const mine = (c.author_email || "").toLowerCase() === me;
|
||||
const hasReplies = !c.parent_id;
|
||||
item.innerHTML =
|
||||
// 답글 — 들여쓴 자리 왼쪽에 ↳ 화살표(원 댓글에 달린 글임을 한눈에).
|
||||
(c.parent_id ? '<span class="material-symbols-outlined pj-reply-arrow" aria-hidden="true">subdirectory_arrow_right</span>' : "") +
|
||||
avatarHtml(c.author_email, "pj-gicon-sm") +
|
||||
'<div class="pj-comment-main"><div class="pj-comment-head">' +
|
||||
escapeHtml(idOf(c.author_email)) + ' <span class="pj-comment-time">' +
|
||||
@@ -5570,6 +5600,7 @@
|
||||
const inp = form.querySelector("input");
|
||||
attachMentionInput(inp);
|
||||
attachEmojiPicker(inp);
|
||||
attachMentionButton(inp);
|
||||
async function send() {
|
||||
const body = inp.value.trim();
|
||||
if (!body) return;
|
||||
@@ -5654,6 +5685,7 @@
|
||||
}
|
||||
attachMentionInput(el("pj-comment-input"));
|
||||
attachEmojiPicker(el("pj-comment-input"));
|
||||
attachMentionButton(el("pj-comment-input"));
|
||||
el("pj-comment-send").addEventListener("click", sendComment);
|
||||
el("pj-comment-input").addEventListener("keydown", function (e) {
|
||||
if (e.key === "Enter") { e.preventDefault(); sendComment(); }
|
||||
|
||||
Reference in New Issue
Block a user