diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html
index 88ac7ac..cd654f7 100644
--- a/app/modules/project/templates/project/help.html
+++ b/app/modules/project/templates/project/help.html
@@ -1,8 +1,8 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
-
+
+
{% endblock %}
@@ -355,6 +355,7 @@
기간이 있는(시작일 또는 마감일이 있는) 작업이 가로 막대로 나옵니다. 이 프로젝트 는 섹션별 줄, 전체 프로젝트 는 프로젝트별 줄이며 프로젝트 전체 기간이 옅은 배경으로 깔립니다.
작업은 아사나처럼 카드 로 보입니다 — 담당자 사진 · 제목 · 하위 작업이 있으면 N ⤷ · 댓글이 있으면 💬 N (누르면 댓글 대화창), 아래 줄에 “마감일: 9월 23일”처럼 날짜. 기간이 있는 작업은 기간만큼 막대로 늘어납니다.
+ 하위 작업 펼치기 — 카드의 N ⤷ ▸ 를 누르면 그 작업 바로 아래에 하위 작업들이 각자 날짜 자리에 작은 카드(점선 테두리)로 나옵니다. 다시 누르면(▾ ) 접힙니다. 하위 작업 카드를 더블클릭하면 열리고, 우클릭하면 열기 · 상위 작업 열기 . 날짜가 없는 하위 작업은 타임라인에 나오지 않습니다.
줄 색은 섹션 편집에서 정한 섹션 색 입니다(색이 없는 섹션은 프로젝트 색). 왼쪽 섹션 이름 앞에도 같은 색 네모가 붙습니다. 주말은 세로줄이 옅은 회색입니다.
막대 몸통을 끌면 기간 전체가 이동하고, 양 끝을 끌면 시작일이나 마감일만 바뀝니다.
Ctrl + 마우스 휠로 확대·축소, 그냥 끌면 좌우로 이동합니다. 오늘 로 오늘 날짜로 돌아옵니다.
diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html
index 83fc3cd..5e37527 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 %}
@@ -101,5 +101,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html
index 12966ce..7af4a9a 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 %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html
index 305c671..d42894f 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 %}
-
+
@@ -473,5 +473,5 @@
-
+
{% endblock %}
diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html
index 24d619a..79417de 100644
--- a/app/modules/project/templates/project/trash.html
+++ b/app/modules/project/templates/project/trash.html
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
-
+
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
-
+
{% endblock %}
diff --git a/app/static/project.css b/app/static/project.css
index d33465b..c1a71c0 100644
--- a/app/static/project.css
+++ b/app/static/project.css
@@ -507,6 +507,17 @@
.pj-tli-due { font-size: 11px; color: #6d6e6f; }
.pj-tli-sub { display: inline-flex; align-items: center; gap: 1px; font-size: 11.5px; font-weight: 600; color: #6d6e6f; }
.pj-tli-sub svg { width: 13px; height: 13px; }
+/* 타임라인 하위 작업 펼치기 버튼(N ⤷ ▸) — 누르면 부모 아래에 하위 작업 카드 */
+.pj-tli-sub.is-toggle { cursor: pointer; border-radius: 5px; padding: 0 1px 0 4px; }
+.pj-tli-sub.is-toggle:hover { background: rgba(0,0,0,.07); color: #1e1f21; }
+.pj-tli-sub.is-open { background: color-mix(in srgb, var(--pj-tl-color, #7b68ee) 22%, #fff); color: #1e1f21; }
+.pj-tli-caret { font-size: 16px; margin-left: -2px; }
+/* 펼친 하위 작업 카드 — 조금 작게, 점선 테두리(아사나의 하위 작업 묶음 느낌) */
+#pj-timeline .vis-item.pj-tli-subitem { border-style: dashed !important; border-left-style: solid !important; box-shadow: none; }
+#pj-timeline .vis-item.pj-tli-subitem .vis-item-content { padding: 2px 7px; }
+#pj-timeline .vis-item.pj-tli-subitem .pj-tli-title { font-size: 12px; font-weight: 500; }
+#pj-timeline .vis-item.pj-tli-subitem .pj-tli-av img.pj-avatar { width: 20px; height: 20px; }
+#pj-timeline .vis-item.pj-tli-subitem .pj-tli-av .pj-gicon { font-size: 20px; }
#pj-timeline .vis-item.pj-tli-item.is-done .pj-tli-name { text-decoration: line-through; color: #8f959d; }
/* 행(섹션) 이름 — 앞에 섹션 색 네모 */
.pj-tlg { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #1e1f21; padding: 2px 4px; }
diff --git a/app/static/project.js b/app/static/project.js
index 57d3f61..3cc30cc 100644
--- a/app/static/project.js
+++ b/app/static/project.js
@@ -2594,6 +2594,23 @@
});
})();
+ // 타임라인 하위 작업 펼치기(아사나) — 카드의 "N ⤷" 를 누르면 그 작업 바로 아래에 하위
+ // 작업들이 각자 날짜 자리에 작은 카드로 나온다. 펼친 작업·받아 둔 하위 작업은 타임라인을
+ // 다시 그려도 유지(작업 창이 닫히면 캐시는 비운다 — 거기서 하위 작업을 고쳤을 수 있다).
+ const tlExpanded = new Set();
+ const tlSubCache = {};
+ let tlToggleSubs = null;
+ (function () {
+ const node = el("pj-timeline");
+ if (!node) return;
+ node.addEventListener("click", function (e) {
+ const b = e.target.closest && e.target.closest(".pj-tli-sub[data-task-id]");
+ if (!b) return;
+ e.preventDefault(); e.stopPropagation();
+ if (tlToggleSubs) tlToggleSubs(parseInt(b.dataset.taskId, 10));
+ }, true);
+ })();
+
// ── 타임라인 (vis-timeline) — 프로젝트별 행(그룹), 행마다 전체 일정 배경 + 업무 막대 ──
function renderTimeline() {
const node = el("pj-timeline");
@@ -2625,6 +2642,21 @@
const items = [];
const groupRows = [];
+ // 펼친 작업의 하위 작업 → 작은 카드 아이템(날짜 있는 것만, 끌어 옮기기는 안 됨 — 열어서 고친다)
+ function subItemsFor(parent, grp, color) {
+ const pStart = new Date(parent.start_date || parent.due_date).getTime();
+ return (tlSubCache[parent.id] || []).filter(function (s) { return s.start_date || s.due_date; }).map(function (s) {
+ const st = s.start_date || s.due_date, en = s.due_date || s.start_date;
+ const isRange = en !== st;
+ return {
+ id: "sub-" + s.id, group: grp, content: s.title || "",
+ start: st, end: isRange ? en : undefined, type: isRange ? "range" : "point",
+ className: "pj-tli-item pj-tli-subitem" + (s.completed_at ? " is-done" : ""),
+ style: "--pj-tl-color:" + (s.completed_at ? "#9aa5b1" : color) + ";",
+ editable: false, pjTask: s, pjParentId: parent.id, pjParentStart: pStart,
+ };
+ });
+ }
const stageById = {};
(stagesByProject[projectId] || []).forEach(function (s) { stageById[String(s.id)] = s; });
groupOrder.forEach(function (gid) {
@@ -2654,8 +2686,10 @@
type: isRange ? "range" : "point",
className: "pj-tli-item" + (t.completed_at ? " is-done" : ""),
style: "--pj-tl-color:" + (t.completed_at ? "#9aa5b1" : groupColor) + ";",
- pjTask: t,
+ pjTask: t, pjColor: t.completed_at ? "#9aa5b1" : groupColor,
+ pjExpanded: tlExpanded.has(t.id),
});
+ if (tlExpanded.has(t.id)) subItemsFor(t, grp, groupColor).forEach(function (x) { items.push(x); });
const sm = new Date(startISO).getTime();
const em = new Date(endISO).getTime();
if (sm < minMs) minMs = sm;
@@ -2702,7 +2736,12 @@
'' +
'' + escapeHtml(t.title || "") + " " +
(t.subtask_total
- ? '' + t.subtask_total + SUBTASK_ICON_SVG + " "
+ ? (item.pjParentId
+ ? '' + t.subtask_total + SUBTASK_ICON_SVG + " "
+ : '' +
+ t.subtask_total + SUBTASK_ICON_SVG +
+ '' + (item.pjExpanded ? "arrow_drop_down" : "arrow_right") + " ")
: "") +
cmtBadge(t) +
" " +
@@ -2722,6 +2761,17 @@
stack: true, height: "520px",
template: tlItemEl,
groupTemplate: tlGroupEl,
+ // 쌓는 순서: 작업(시작일순) 바로 뒤에 그 작업의 하위 작업들 — 펼친 하위 작업이 부모 아래에 붙는다
+ order: function (a, b) {
+ function key(it) {
+ if (it.pjParentId != null) return [it.pjParentStart, it.pjParentId, 1, new Date(it.start).getTime()];
+ if (it.pjTask) return [new Date(it.start).getTime(), it.id, 0, 0];
+ return [0, 0, 0, 0];
+ }
+ const ka = key(a), kb = key(b);
+ for (let i = 0; i < 4; i++) { if (ka[i] !== kb[i]) return ka[i] < kb[i] ? -1 : 1; }
+ return 0;
+ },
horizontalScroll: true, // 마우스 휠 = 좌우 이동(패닝)
verticalScroll: false,
zoomKey: "ctrlKey", // 확대/축소는 Ctrl+휠
@@ -2817,12 +2867,47 @@
}
timeline.on("changed", paintTLDays);
paintTLDays();
+ tlToggleSubs = function (id) {
+ const parent = itemsDS.get(id);
+ if (!parent || !parent.pjTask) return;
+ const subIds = function () { return itemsDS.getIds({ filter: function (it) { return it.pjParentId === id; } }); };
+ if (tlExpanded.has(id)) {
+ tlExpanded.delete(id);
+ itemsDS.remove(subIds());
+ itemsDS.update({ id: id, pjExpanded: false });
+ return;
+ }
+ tlExpanded.add(id);
+ itemsDS.update({ id: id, pjExpanded: true });
+ function addSubs() {
+ if (!tlExpanded.has(id) || !itemsDS.get(id)) return;
+ itemsDS.remove(subIds());
+ const subs = subItemsFor(parent.pjTask, parent.group, parent.pjColor || "#4573d2");
+ itemsDS.add(subs);
+ const undated = (tlSubCache[id] || []).length - subs.length;
+ if (undated > 0) showToast("날짜가 없는 하위 작업 " + undated + "개는 타임라인에 나오지 않습니다.");
+ }
+ if (tlSubCache[id]) { addSubs(); return; }
+ api("GET", "/project/api/tasks/" + id).then(function (res) {
+ tlSubCache[id] = (res && res.task && res.task.subtasks) || [];
+ addSubs();
+ }).catch(function (err) {
+ tlExpanded.delete(id);
+ if (itemsDS.get(id)) itemsDS.update({ id: id, pjExpanded: false });
+ showToast("하위 작업을 불러오지 못했습니다: " + err.message, "error");
+ });
+ };
+ // 다시 그렸는데 펼친 작업의 하위 작업 캐시가 비어 있으면(작업 창을 닫아 비웠다 등) 새로 받는다.
+ Array.from(tlExpanded).forEach(function (id) {
+ if (!tlSubCache[id] && itemsDS.get(id)) { tlExpanded.delete(id); tlToggleSubs(id); }
+ });
// 단일 클릭은 선택만(드래그로 기간 조절할 때 양 끝 손잡이가 나타나려면
// 먼저 선택 상태여야 한다 — vis 의 자체 동작) — 여기서 모달을 열면
// 손잡이가 나타나자마자 모달이 덮어써서 드래그를 할 수가 없다. 편집은
// 더블클릭이나 우클릭 메뉴의 "열기"로.
timeline.on("doubleClick", function (props) {
if (!canManage || props.item == null || String(props.item).indexOf("bg") === 0) return;
+ if (String(props.item).indexOf("sub-") === 0) { openTaskById(parseInt(String(props.item).slice(4), 10)); return; }
const t = tasks.find(function (x) { return x.id === props.item; });
if (t) openTaskModal(t);
});
@@ -2830,6 +2915,15 @@
timeline.on("contextmenu", function (props) {
if (props.event && props.event.preventDefault) props.event.preventDefault();
if (!canManage || props.item == null || String(props.item).indexOf("bg") === 0) return;
+ if (String(props.item).indexOf("sub-") === 0) {
+ const subId = parseInt(String(props.item).slice(4), 10);
+ const it = itemsDS.get(props.item);
+ showContextMenu(props.event.clientX, props.event.clientY, [
+ { label: "열기", onClick: function () { openTaskById(subId); } },
+ { label: "상위 작업 열기", onClick: function () { if (it) openTaskById(it.pjParentId); } },
+ ]);
+ return;
+ }
const t = tasks.find(function (x) { return x.id === props.item; });
if (t) showContextMenu(props.event.clientX, props.event.clientY, taskContextItems(t));
});
@@ -4938,6 +5032,11 @@
if (!taskModal.hidden) return;
Object.keys(subsCache).forEach(function (k) { delete subsCache[k]; });
if (expandedSubs.size && currentView === "board") renderBoard();
+ Object.keys(tlSubCache).forEach(function (k) { delete tlSubCache[k]; });
+ if (tlExpanded.size && currentView === "timeline" && tlToggleSubs) {
+ // 펼친 상태는 두고 하위 작업만 새로 받는다
+ Array.from(tlExpanded).forEach(function (id) { tlExpanded.delete(id); tlToggleSubs(id); });
+ }
}).observe(taskModal, { attributes: true, attributeFilter: ["hidden"] });
}