feat(project): add Asana-style board completion checks

This commit is contained in:
2026-10-02 17:55:31 +09:00
parent 20232baf06
commit 22af196d56
11 changed files with 88 additions and 15 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -296,5 +296,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261002g" defer></script>
<script src="/static/project.js?v=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<link rel="stylesheet" href="/static/project-help.css?v=20261002d" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -239,6 +239,7 @@
<li><b>상단 작업 추가</b> — 섹션 머리의 <span class="pjh-ui">+</span>는 오른쪽에서 작업 상세창을 엽니다. 제목·설명·담당자·우선순위·마감일을 설정할 수 있습니다.</li>
<li><b>하단 작업 추가</b> — 섹션 맨 아래 <span class="pjh-ui">+ 작업 추가</span>는 보드 안에 간단한 입력 카드를 엽니다. <b>작업 이름·담당자·마감일</b>을 정한 뒤 <kbd>Enter</kbd>를 누르거나 카드 밖을 클릭하면 저장됩니다. Enter로 저장하면 다음 작업을 계속 입력할 수 있고, <kbd>Esc</kbd>로 취소할 수 있습니다.</li>
<li><b>열기</b> — 카드를 누르면 오른쪽에 작업 편집 창이 열립니다. (<a href="#task">8장</a>)</li>
<li><b>완료 체크</b> — 카드 제목 왼쪽의 원형 체크 버튼을 누르면 완료됩니다. 완료된 작업은 <b>녹색 원 안 흰 체크</b>와 흐린 회색 제목으로 표시되며 취소선은 없습니다. 다시 누르면 완료를 취소합니다. 읽기 전용 작업은 상태만 표시합니다.</li>
<li><b>담당자·마감일 바로 바꾸기</b> — 카드의 사람 아이콘이나 날짜를 누르면 그 자리에서 바꿉니다. 비어 있으면 카드에 마우스를 올렸을 때 점선 원 아이콘이 나타납니다.</li>
<li><b>옮기기</b> — 카드를 끌어 다른 섹션에 놓으면 섹션이 바뀌고, 같은 섹션 안에서 위아래로 놓으면 순서가 바뀝니다.</li>
<li><b>우클릭 메뉴</b> — <span class="pjh-ui">열기 · 작업 링크 복사 · 완료로 표시 · 삭제</span></li>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<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=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<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=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -496,5 +496,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261002g" />
<link rel="stylesheet" href="/static/project.css?v=20261002h" />
<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=20261002g" defer></script>
<script src="/static/project.js?v=20261002h" defer></script>
{% endblock %}
+13 -1
View File
@@ -421,7 +421,7 @@
.pj-card-sub.pj-sub-drop-before { box-shadow: inset 0 2px var(--pj-accent); }
.pj-card-sub.pj-sub-drop-after { box-shadow: inset 0 -2px var(--pj-accent); }
.pj-card.is-sub-drop { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: var(--pj-accent-tint); }
.pj-card.is-done .pj-card-title { text-decoration: line-through; color: #9aa1a9; }
.pj-card.is-done .pj-card-title { color: #9aa1a9; }
.pj-card-title { font-size: var(--pj-text-size); font-weight: 400; color: var(--pj-ink); line-height: var(--pj-text-leading); }
.pj-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.pj-card-due { margin-left: auto; font-size: var(--pj-small-size); color: var(--pj-ink-soft); font-weight: 400; line-height: var(--pj-small-leading); }
@@ -437,6 +437,17 @@
.pj-card-head .pj-card-title {
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; flex: none;
}
.pj-card-title-row { display: flex; align-items: flex-start; gap: 6px; flex: none; }
.pj-card-title-row .pj-card-title { flex: 1; min-width: 0; }
.pj-card-check {
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 22px;
padding: 0; border: none; background: transparent; border-radius: 50%; color: #6d6e6f; cursor: pointer;
}
.pj-card-check .material-symbols-outlined { font-size: 18px; }
.pj-card-check:hover:not(:disabled) { color: #58a182; }
.pj-card-check:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
.pj-card-check:disabled { cursor: default; }
.pj-card-check[aria-busy="true"] { opacity: .5; }
.pj-card-head:has(.pj-card-proj) .pj-card-title { -webkit-line-clamp: 1; }
.pj-card:has(.pj-card-subs-wrap.is-open) .pj-card-head { height: 96px; } /* 펼침 때 아래 10px 여백(음수 margin)만큼 */
.pj-card-head .pj-card-meta { margin-top: auto; padding-top: 6px; flex: none; }
@@ -1336,6 +1347,7 @@ label.pj-desc-fmtbtn {
.pj-subtask-check .material-symbols-outlined { font-size: 21px; }
.pj-subtask-check:hover { color: #3f8f6b; }
.pj-subtask-row.is-done .pj-subtask-check { color: #3f8f6b; }
.pj-card.is-done .pj-card-check .material-symbols-outlined,
.pj-card-sub.is-done .pj-card-sub-check .material-symbols-outlined,
.pj-subtask-row.is-done .pj-subtask-check .material-symbols-outlined {
display: inline-block; width: 1em; height: 1em; color: transparent;
+30 -1
View File
@@ -5227,6 +5227,7 @@
});
}
const cardCompletionSaving = new Set();
function taskCard(t) {
const card = document.createElement("div");
card.className = "pj-card" + (t.completed_at ? " is-done" : "");
@@ -5247,7 +5248,13 @@
(showProjTag && t.project_name
? '<div class="pj-card-proj" style="color:' + (t.project_color || "#4573d2") + '">● ' + escapeHtml(t.project_name) + "</div>"
: "") +
'<div class="pj-card-title">' + escapeHtml(t.title) + "</div>" +
'<div class="pj-card-title-row"><button type="button" class="pj-card-check" role="checkbox" aria-checked="' + (!!t.completed_at) +
'" aria-label="' + escapeHtml((t.completed_at ? "완료 취소: " : "완료로 표시: ") + t.title) +
'" title="' + (t.completed_at ? "완료 취소" : "완료로 표시") + '"' +
(!(canManage && taskAccessLevel(t) === "full") || cardCompletionSaving.has(t.id) ? " disabled" : "") +
(cardCompletionSaving.has(t.id) ? ' aria-busy="true"' : "") +
'><span class="material-symbols-outlined" aria-hidden="true">check_circle</span></button>' +
'<div class="pj-card-title">' + escapeHtml(t.title) + "</div></div>" +
'<div class="pj-card-meta">' +
(t.priority && t.priority !== "normal"
? '<span class="pj-pri pj-pri-' + t.priority + '">' + (priorityLabels[t.priority] || t.priority) + "</span>"
@@ -5301,6 +5308,28 @@
: "");
const subsBox = card.querySelector(".pj-card-subs");
if (subsBox) fillCardSubs(subsBox, t);
const check = card.querySelector(".pj-card-check");
check.addEventListener("click", async function (e) {
e.stopPropagation();
if (!canManage || taskAccessLevel(t) !== "full" || cardCompletionSaving.has(t.id)) return;
cardCompletionSaving.add(t.id); check.disabled = true; check.setAttribute("aria-busy", "true");
let updated = false;
const hadFocus = document.activeElement === check;
try {
const res = await api("PUT", "/project/api/tasks/" + t.id, { completed: !t.completed_at });
mergeTask(res.task); updated = true;
} catch (err) { showToast("완료 상태 변경 실패: " + err.message, "error"); }
finally {
cardCompletionSaving.delete(t.id);
const restoreFocus = hadFocus && (document.activeElement === check || document.activeElement === document.body);
refreshActiveView();
if (restoreFocus) {
const liveCheck = document.querySelector('.pj-card[data-task-id="' + t.id + '"] .pj-card-check');
if (liveCheck) liveCheck.focus();
}
}
if (updated) refreshMyOpenBadge();
});
card.addEventListener("click", function (e) {
// 하위 업무 펼치기/접기 — 보기 권한만 있어도 된다.
const tog = e.target.closest(".pj-card-subtoggle");