feat(project): 카드 하위 업무 마감일 추가 아이콘
마감일 없는 하위 업무 줄에 마우스를 올리면 점선 원 달력 아이콘 + '마감일 추가' 말풍선. 누르면 날짜 선택(있는 날짜도 클릭해 변경/지우기). openDuePicker 에 저장 콜백 인자 추가. 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=20260924e" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924f" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -98,5 +98,5 @@
|
||||
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260924e" defer></script>
|
||||
<script src="/static/project.js?v=20260924f" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924e" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924f" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -119,5 +119,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260924e" defer></script>
|
||||
<script src="/static/project.js?v=20260924f" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924e" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924f" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -505,5 +505,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260924e" defer></script>
|
||||
<script src="/static/project.js?v=20260924f" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -831,6 +831,15 @@
|
||||
/* 마감일은 제목이 아무리 길어도 항상 보인다 — 줄어드는 건 제목(말줄임)뿐 */
|
||||
.pj-card-sub-due { flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--pj-ink-soft); }
|
||||
.pj-card-sub-due.is-overdue { color: #c22b10; }
|
||||
.pj-card-sub-due { cursor: pointer; border-radius: 4px; }
|
||||
.pj-card-sub-due:not(.is-empty):hover { background: #eceef0; }
|
||||
/* 마감일 없음 — 줄에 마우스를 올릴 때만 점선 원 달력 아이콘(아사나) */
|
||||
.pj-card-sub-due.is-empty {
|
||||
display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
|
||||
border-radius: 50%; color: #6d6e6f; opacity: 0; transition: opacity .12s;
|
||||
}
|
||||
.pj-card-sub:hover .pj-card-sub-due.is-empty { opacity: 1; }
|
||||
.pj-card-sub-due.is-empty:hover { color: #1e1f21; background: #eceef0; }
|
||||
.pj-card-sub-av { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
|
||||
/* 담당자 없음 — 줄에 마우스를 올릴 때만 점선 원 아이콘(아사나) */
|
||||
.pj-card-sub-av.is-empty { color: #6d6e6f; opacity: 0; transition: opacity .12s; }
|
||||
|
||||
+29
-5
@@ -2577,8 +2577,11 @@
|
||||
function onInlineDateDown(e) {
|
||||
if (inlineDateEl && !inlineDateEl.contains(e.target)) closeInlineDate();
|
||||
}
|
||||
function openDuePicker(t, anchorEl) {
|
||||
// onPick(v) 를 주면 저장을 그쪽에 맡긴다(카드의 하위 업무 줄 — 보드 전체가
|
||||
// 아니라 그 목록만 다시 그림). 없으면 applyTaskPatch 로 업무에 저장.
|
||||
function openDuePicker(t, anchorEl, onPick) {
|
||||
closeInlineDate();
|
||||
const save = onPick || function (v) { applyTaskPatch(t, { due_date: v }, "마감일 변경 실패"); };
|
||||
const box = document.createElement("div");
|
||||
box.className = "pj-inline-date";
|
||||
box.innerHTML = '<input type="date" value="' + (t.due_date || "") + '" />' +
|
||||
@@ -2595,12 +2598,12 @@
|
||||
const v = input.value || null;
|
||||
closeInlineDate();
|
||||
if (v === (t.due_date || null)) return;
|
||||
applyTaskPatch(t, { due_date: v }, "마감일 변경 실패");
|
||||
save(v);
|
||||
});
|
||||
box.querySelector("button").addEventListener("click", function () {
|
||||
closeInlineDate();
|
||||
if (!t.due_date) return;
|
||||
applyTaskPatch(t, { due_date: null }, "마감일 변경 실패");
|
||||
save(null);
|
||||
});
|
||||
setTimeout(function () {
|
||||
document.addEventListener("mousedown", onInlineDateDown, true);
|
||||
@@ -2630,9 +2633,12 @@
|
||||
'<button type="button" class="pj-card-sub-check" title="' + (sub.completed_at ? "완료 취소" : "완료로 표시") + '">' +
|
||||
'<span class="material-symbols-outlined">check_circle</span></button>' +
|
||||
'<span class="pj-card-sub-title">' + escapeHtml(sub.title || "") + "</span>" +
|
||||
// 마감일 — 있으면 날짜, 없으면 아사나처럼 점선 원 달력 아이콘(줄에 마우스를
|
||||
// 올리면 보임). 둘 다 누르면 날짜 선택.
|
||||
(sub.due_date
|
||||
? '<span class="pj-card-sub-due' + (overdue ? " is-overdue" : "") + '">' + escapeHtml(fmtDateKr(sub.due_date)) + "</span>"
|
||||
: "") +
|
||||
? '<span class="pj-card-sub-due' + (overdue ? " is-overdue" : "") + '" data-tip="마감일 변경">' +
|
||||
escapeHtml(fmtDateKr(sub.due_date)) + "</span>"
|
||||
: '<span class="pj-card-sub-due is-empty" data-tip="마감일 추가">' + DUE_EMPTY_ICON_SVG + "</span>") +
|
||||
// 담당자 — 있으면 아바타, 없으면 아사나처럼 점선 원 사람 아이콘(줄에
|
||||
// 마우스를 올리면 보임). 누르면 멤버 선택, 말풍선은 data-tip(initHoverTips).
|
||||
(sub.assignee_email
|
||||
@@ -2641,6 +2647,13 @@
|
||||
: '<span class="pj-card-sub-av is-empty" data-tip="이 작업 배정">' + ASSIGN_EMPTY_ICON_SVG + "</span>") +
|
||||
"</div>";
|
||||
}
|
||||
// 마감일 미지정 아이콘(아사나 모양: 점선 원 안의 달력).
|
||||
const DUE_EMPTY_ICON_SVG =
|
||||
'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true">' +
|
||||
'<circle cx="12" cy="12" r="10.3" stroke-dasharray="2.6 2.2"/>' +
|
||||
'<rect x="7.3" y="8.2" width="9.4" height="8.6" rx="1.6"/>' +
|
||||
'<path d="M7.3 11.2h9.4M9.8 6.8v2.4M14.2 6.8v2.4" stroke-linecap="round"/>' +
|
||||
"</svg>";
|
||||
// 담당자 미지정 아이콘(아사나 모양: 점선 원 안의 사람).
|
||||
const ASSIGN_EMPTY_ICON_SVG =
|
||||
'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true">' +
|
||||
@@ -2706,6 +2719,17 @@
|
||||
box.querySelectorAll(".pj-card-sub").forEach(function (row) {
|
||||
const sub = subs.find(function (x) { return String(x.id) === row.dataset.subId; });
|
||||
if (!sub) return;
|
||||
const due = row.querySelector(".pj-card-sub-due");
|
||||
if (due && canManage) due.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
openDuePicker(sub, due, async function (v) {
|
||||
try {
|
||||
await api("PUT", "/project/api/tasks/" + sub.id, { due_date: v });
|
||||
sub.due_date = v;
|
||||
if (box.isConnected) fillCardSubs(box, t);
|
||||
} catch (err) { showToast("마감일 변경 실패: " + err.message, "error"); }
|
||||
});
|
||||
});
|
||||
const av = row.querySelector(".pj-card-sub-av");
|
||||
if (av && canManage) av.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user