feat(project): 타임라인을 아사나식 카드로 + 섹션 색 + 하위 작업 아이콘
- 작업 아이템을 vis template(요소 반환 → 정화 없음)으로 그린다: 담당자 사진 · 제목 · 하위 작업이 있으면 "N ⤷" 아이콘 · 댓글 💬N(누르면 대화창) / 둘째 줄 "마감일: 9월 23일" 또는 "시작 – 마감". 기간 막대는 행 색을 옅게 + 왼쪽 선, 하루짜리는 흰 카드 + 왼쪽 선, 글자는 막대 밖으로 이어서 보임. 완료는 취소선 - 행 색: "이 프로젝트"는 섹션에 지정한 색(없으면 프로젝트 색), 행 이름 앞 색 네모 (groupTemplate), 행 배경 띠도 같은 색 - 주말 세로줄 옅은 회색 - 도움말 13장 갱신, 정적 파일 버전 20260926u Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926u" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926u" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -354,6 +354,8 @@
|
||||
<h2><span class="pjh-num">13</span>타임라인 보기</h2>
|
||||
<ul>
|
||||
<li>기간이 있는(시작일 또는 마감일이 있는) 작업이 가로 막대로 나옵니다. <b>이 프로젝트</b>는 섹션별 줄, <b>전체 프로젝트</b>는 프로젝트별 줄이며 프로젝트 전체 기간이 옅은 배경으로 깔립니다.</li>
|
||||
<li>작업은 아사나처럼 <b>카드</b>로 보입니다 — 담당자 사진 · 제목 · 하위 작업이 있으면 <span class="pjh-ui">N ⤷</span> · 댓글이 있으면 <span class="pjh-ui">💬 N</span>(누르면 댓글 대화창), 아래 줄에 “마감일: 9월 23일”처럼 날짜. 기간이 있는 작업은 기간만큼 막대로 늘어납니다.</li>
|
||||
<li>줄 색은 <b>섹션 편집에서 정한 섹션 색</b>입니다(색이 없는 섹션은 프로젝트 색). 왼쪽 섹션 이름 앞에도 같은 색 네모가 붙습니다. 주말은 세로줄이 옅은 회색입니다.</li>
|
||||
<li>막대 <b>몸통을 끌면</b> 기간 전체가 이동하고, <b>양 끝을 끌면</b> 시작일이나 마감일만 바뀝니다.</li>
|
||||
<li><kbd>Ctrl</kbd> + 마우스 휠로 확대·축소, 그냥 끌면 좌우로 이동합니다. <span class="pjh-ui">오늘</span>로 오늘 날짜로 돌아옵니다.</li>
|
||||
<li>아래 날짜 줄은 캘린더와 같은 색입니다 — <span style="color:#1d4ed8;font-weight:700">토요일은 파랑</span>, <span style="color:#c22b10;font-weight:700">일요일·국경일·대체공휴일은 빨강</span>.</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926u" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -101,5 +101,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260926t" defer></script>
|
||||
<script src="/static/project.js?v=20260926u" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926u" />
|
||||
<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=20260926t" defer></script>
|
||||
<script src="/static/project.js?v=20260926u" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926u" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -473,5 +473,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260926t" defer></script>
|
||||
<script src="/static/project.js?v=20260926u" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926t" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926u" />
|
||||
<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=20260926t" defer></script>
|
||||
<script src="/static/project.js?v=20260926u" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -485,6 +485,36 @@
|
||||
그대로라 밑에 깔린 막대의 호버 감지를 방해하지 않는다. */
|
||||
#pj-timeline .pj-tl-hover-band { background: var(--pj-accent-tint) !important; opacity: .8; }
|
||||
|
||||
/* ── 타임라인 작업 카드(아사나식) — 담당자 사진 · 제목 · 하위 작업 N⤷ · 💬 / 둘째 줄 날짜.
|
||||
색은 행(섹션) 색 --pj-tl-color: 기간 막대는 그 색을 옅게 깔고 왼쪽 선, 하루짜리는 흰 카드 + 왼쪽 선.
|
||||
글자가 막대보다 길면 막대 밖으로 이어서 보인다. */
|
||||
#pj-timeline .vis-item.pj-tli-item {
|
||||
color: #1e1f21; border: none !important; border-left: 3px solid var(--pj-tl-color) !important;
|
||||
border-radius: 6px !important; box-shadow: 0 1px 2px rgba(16,24,40,.10);
|
||||
}
|
||||
#pj-timeline .vis-item.vis-range.pj-tli-item { background: color-mix(in srgb, var(--pj-tl-color) 18%, #fff) !important; }
|
||||
#pj-timeline .vis-item.vis-point.pj-tli-item { background: #fff !important; border: 1px solid #e2e4e8 !important; border-left: 3px solid var(--pj-tl-color) !important; }
|
||||
#pj-timeline .vis-item.vis-point.pj-tli-item .vis-dot { display: none; }
|
||||
#pj-timeline .vis-item.pj-tli-item .vis-item-overflow { overflow: visible; }
|
||||
#pj-timeline .vis-item.pj-tli-item .vis-item-content { padding: 4px 8px; font-weight: 400; }
|
||||
#pj-timeline .vis-item.pj-tli-item.vis-selected { box-shadow: 0 0 0 2px var(--pj-accent), 0 3px 10px rgba(16,24,40,.18); }
|
||||
.pj-tli { display: flex; align-items: center; gap: 7px; white-space: nowrap; line-height: 1.25; }
|
||||
.pj-tli-av { display: inline-flex; flex: 0 0 auto; }
|
||||
.pj-tli-av img.pj-avatar { width: 24px; height: 24px; border-radius: 50%; }
|
||||
.pj-tli-av .pj-gicon { font-size: 24px; color: #8f959d; }
|
||||
.pj-tli-text { display: flex; flex-direction: column; min-width: 0; }
|
||||
.pj-tli-title { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
|
||||
.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; }
|
||||
#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; }
|
||||
.pj-tlg-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
|
||||
/* 주말 세로줄을 옅은 회색으로(아사나) — vis 가 하루 단위로 볼 때 요일 class 를 단다 */
|
||||
#pj-timeline .vis-panel.vis-background .vis-grid.vis-minor.vis-saturday,
|
||||
#pj-timeline .vis-panel.vis-background .vis-grid.vis-minor.vis-sunday { background: rgba(15, 23, 42, .04); }
|
||||
|
||||
/* ── 모달 ── */
|
||||
.pj-modal { position: fixed; inset: 0; background: rgba(20,22,26,.46); display: flex; align-items: center; justify-content: center; z-index: 1000; }
|
||||
.pj-modal[hidden] { display: none; }
|
||||
|
||||
+49
-5
@@ -2625,15 +2625,19 @@
|
||||
|
||||
const items = [];
|
||||
const groupRows = [];
|
||||
const stageById = {};
|
||||
(stagesByProject[projectId] || []).forEach(function (s) { stageById[String(s.id)] = s; });
|
||||
groupOrder.forEach(function (gid) {
|
||||
const list = byGroup[gid];
|
||||
const grp = (groupBySession ? "S" : "P") + gid;
|
||||
const meta = groupBySession ? {} : (projById[gid] || {});
|
||||
const groupColor = list[0].project_color || meta.color || "#4573d2";
|
||||
// 행 색 — "이 프로젝트"는 섹션에 지정한 색(없으면 프로젝트 색), "전체 프로젝트"는 프로젝트 색
|
||||
const stageColor = groupBySession && stageById[gid] ? stageById[gid].color : null;
|
||||
const groupColor = stageColor || list[0].project_color || meta.color || "#4573d2";
|
||||
const groupName = groupBySession
|
||||
? (gid === "none" ? "미지정" : (list[0].stage_name || "섹션"))
|
||||
: (list[0].project_name || meta.name || "프로젝트");
|
||||
groupRows.push({ id: grp, content: escapeHtml(groupName) });
|
||||
groupRows.push({ id: grp, content: groupName, pjColor: groupColor });
|
||||
let minMs = Infinity, maxMs = -Infinity;
|
||||
list.forEach(function (t) {
|
||||
const s = t.start_date || t.due_date;
|
||||
@@ -2642,12 +2646,15 @@
|
||||
const endISO = e + (t.due_time ? "T" + t.due_time : "");
|
||||
const isRange = (e !== s) || (!!t.start_time && !!t.due_time && t.start_time !== t.due_time);
|
||||
items.push({
|
||||
// vis 가 HTML 을 정화(sanitize)하므로 아이콘 폰트 대신 이모지로 댓글 표시.
|
||||
// 내용은 opts.template(tlItemEl)이 아사나식 카드로 그린다 — 담당자 사진 · 제목 ·
|
||||
// 하위 작업 N⤷ · 댓글 💬N / 둘째 줄 날짜. 색은 행(섹션) 색을 CSS 변수로 넘긴다.
|
||||
id: t.id, group: grp,
|
||||
content: (t.title || "") + (t.comment_count ? " 💬" + t.comment_count : ""),
|
||||
content: t.title || "",
|
||||
start: startISO, end: isRange ? endISO : undefined,
|
||||
type: isRange ? "range" : "point",
|
||||
style: "background-color:" + (t.completed_at ? "#9aa5b1" : groupColor) + ";color:#fff;border:none;",
|
||||
className: "pj-tli-item" + (t.completed_at ? " is-done" : ""),
|
||||
style: "--pj-tl-color:" + (t.completed_at ? "#9aa5b1" : groupColor) + ";",
|
||||
pjTask: t,
|
||||
});
|
||||
const sm = new Date(startISO).getTime();
|
||||
const em = new Date(endISO).getTime();
|
||||
@@ -2676,8 +2683,45 @@
|
||||
// (setWindow 로 나중에 바꾸면 초기 autofit 이 rangechanged 로 덮어써 초기화됨)
|
||||
const saved = loadTLWindow();
|
||||
const tlHolidays = data.holidays || {};
|
||||
// 아사나식 카드 — 반환값이 요소(Element)면 vis 가 정화(sanitize)하지 않고 그대로 붙인다
|
||||
// (문자열은 정화돼 사진·아이콘이 빠진다). 글자는 전부 escapeHtml 로 넣는다.
|
||||
function tlDateText(t) {
|
||||
const s = t.start_date, d = t.due_date;
|
||||
if (s && d && s !== d) return fmtFieldDate(s) + " – " + fmtFieldDate(d);
|
||||
if (d) return "마감일: " + fmtFieldDate(d);
|
||||
return "시작일: " + fmtFieldDate(s);
|
||||
}
|
||||
function tlItemEl(item) {
|
||||
const t = item && item.pjTask;
|
||||
if (!t) return document.createTextNode("");
|
||||
const box = document.createElement("div");
|
||||
box.className = "pj-tli";
|
||||
box.innerHTML =
|
||||
(t.assignee_email ? '<span class="pj-tli-av" data-tip="' + escapeHtml(idOf(t.assignee_email)) + '">' +
|
||||
avatarHtml(t.assignee_email, "pj-gicon-sm") + "</span>" : "") +
|
||||
'<span class="pj-tli-text">' +
|
||||
'<span class="pj-tli-title"><span class="pj-tli-name">' + escapeHtml(t.title || "") + "</span>" +
|
||||
(t.subtask_total
|
||||
? '<span class="pj-tli-sub" title="하위 작업 ' + t.subtask_total + '개">' + t.subtask_total + SUBTASK_ICON_SVG + "</span>"
|
||||
: "") +
|
||||
cmtBadge(t) +
|
||||
"</span>" +
|
||||
'<span class="pj-tli-due">' + escapeHtml(tlDateText(t)) + "</span>" +
|
||||
"</span>";
|
||||
return box;
|
||||
}
|
||||
function tlGroupEl(group) {
|
||||
const g = document.createElement("div");
|
||||
g.className = "pj-tlg";
|
||||
if (!group) return g;
|
||||
g.innerHTML = '<span class="pj-tlg-dot" style="background:' + escapeHtml(group.pjColor || "#9aa5b1") + '"></span>' +
|
||||
'<span class="pj-tlg-name">' + escapeHtml(group.content || "") + "</span>";
|
||||
return g;
|
||||
}
|
||||
const opts = {
|
||||
stack: true, height: "520px",
|
||||
template: tlItemEl,
|
||||
groupTemplate: tlGroupEl,
|
||||
horizontalScroll: true, // 마우스 휠 = 좌우 이동(패닝)
|
||||
verticalScroll: false,
|
||||
zoomKey: "ctrlKey", // 확대/축소는 Ctrl+휠
|
||||
|
||||
Reference in New Issue
Block a user