feat(project): 타임라인 날짜 색을 캘린더와 같게(토 파랑, 일·국경일·대체공휴일 빨강)
- 프로젝트 화면 데이터에 공휴일 표(store.KR_HOLIDAYS) 추가 - 타임라인 minorLabels 에 보이지 않는 표시 글자(빨강 U+2063 / 파랑 U+2064)를 붙이고, 다시 그릴 때마다(changed) 표시를 보고 색 클래스를 단다 — vis 는 확대 단계에 따라 요일 class 를 안 붙이고 공휴일은 모르므로 직접 판단 - 도움말 13장에 날짜 색 안내, 정적 파일 버전 20260926s Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -803,6 +803,8 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"stage_color_palette": list(store.STAGE_COLOR_PALETTE),
|
||||
"today": today.isoformat(),
|
||||
# 타임라인 날짜 색(일요일·국경일·대체공휴일 빨강) — 캘린더와 같은 공휴일 표
|
||||
"holidays": store.KR_HOLIDAYS,
|
||||
"year": year,
|
||||
"month": month,
|
||||
"prev_y": prev_y, "prev_m": prev_m,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926s" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926s" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -356,6 +356,7 @@
|
||||
<li>기간이 있는(시작일 또는 마감일이 있는) 작업이 가로 막대로 나옵니다. <b>이 프로젝트</b>는 섹션별 줄, <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>
|
||||
<li>막대 <b>더블클릭</b> → 작업 편집 창, <b>우클릭</b> → 작업 메뉴. 마우스를 올리면 작업 정보가 보입니다.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926s" />
|
||||
<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=20260926r" defer></script>
|
||||
<script src="/static/project.js?v=20260926s" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926s" />
|
||||
<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=20260926r" defer></script>
|
||||
<script src="/static/project.js?v=20260926s" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926s" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -467,10 +467,11 @@
|
||||
"stagesByProject": {{ stages_by_project | tojson }},
|
||||
"boardStages": {{ board_stage_names | tojson }},
|
||||
"avatars": {{ avatars | tojson }},
|
||||
"holidays": {{ (holidays or {}) | tojson }},
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260926r" defer></script>
|
||||
<script src="/static/project.js?v=20260926s" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926r" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926s" />
|
||||
<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=20260926r" defer></script>
|
||||
<script src="/static/project.js?v=20260926s" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -419,6 +419,9 @@
|
||||
.pj-today .pj-day-num.pj-blue { background: #1d4ed8; }
|
||||
.pj-red { color: #c22b10 !important; }
|
||||
.pj-blue { color: #1d4ed8 !important; }
|
||||
/* 타임라인 날짜 라벨 — 캘린더와 같은 색(토요일 파랑, 일요일·국경일·대체공휴일 빨강) */
|
||||
#pj-timeline .vis-time-axis .vis-text.pj-tl-blue { color: #1d4ed8; }
|
||||
#pj-timeline .vis-time-axis .vis-text.pj-tl-red { color: #c22b10; }
|
||||
.pj-day-holiday {
|
||||
display: block; font-size: 10.5px; color: #c22b10; font-weight: 600;
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
|
||||
|
||||
+19
-1
@@ -2663,6 +2663,7 @@
|
||||
// 저장된 보던 구간이 있으면 생성 옵션에 start/end 로 넣어 자동맞춤(autofit)을 막는다.
|
||||
// (setWindow 로 나중에 바꾸면 초기 autofit 이 rangechanged 로 덮어써 초기화됨)
|
||||
const saved = loadTLWindow();
|
||||
const tlHolidays = data.holidays || {};
|
||||
const opts = {
|
||||
stack: true, height: "520px",
|
||||
horizontalScroll: true, // 마우스 휠 = 좌우 이동(패닝)
|
||||
@@ -2675,7 +2676,14 @@
|
||||
switch (scale) {
|
||||
case "millisecond": case "second": case "minute": case "hour":
|
||||
return pad2(d.getHours()) + ":" + pad2(d.getMinutes());
|
||||
case "weekday": case "day": return d.getDate() + "일 (" + koWd(d) + ")";
|
||||
case "weekday": case "day": {
|
||||
// 캘린더와 같은 색 — 일요일·국경일·대체공휴일 빨강, 토요일 파랑. 라벨은 글자만
|
||||
// 받으므로 맨 앞에 보이지 않는 표시 글자(U+2063 빨강 / U+2064 파랑)를 붙이고
|
||||
// 그린 뒤 paintTLDays 가 그 표시로 색 클래스를 단다.
|
||||
const red = d.getDay() === 0 || !!tlHolidays[isoOf(d)];
|
||||
const blue = !red && d.getDay() === 6;
|
||||
return (red ? "\u2063" : blue ? "\u2064" : "") + d.getDate() + "일 (" + koWd(d) + ")";
|
||||
}
|
||||
case "week": return d.getDate() + "일";
|
||||
case "month": return (d.getMonth() + 1) + "월";
|
||||
case "year": return d.getFullYear() + "년";
|
||||
@@ -2743,6 +2751,16 @@
|
||||
|
||||
const itemsDS = new vis.DataSet(items);
|
||||
timeline = new vis.Timeline(node, itemsDS, groups, opts);
|
||||
// 날짜 라벨 색 — 다시 그릴 때마다(vis 가 라벨 class 를 새로 쓴다) 표시 글자를 보고 색 클래스를 단다.
|
||||
function paintTLDays() {
|
||||
node.querySelectorAll(".vis-time-axis .vis-text.vis-minor").forEach(function (lab) {
|
||||
const c = (lab.textContent || "").charAt(0);
|
||||
lab.classList.toggle("pj-tl-red", c === "\u2063");
|
||||
lab.classList.toggle("pj-tl-blue", c === "\u2064");
|
||||
});
|
||||
}
|
||||
timeline.on("changed", paintTLDays);
|
||||
paintTLDays();
|
||||
// 단일 클릭은 선택만(드래그로 기간 조절할 때 양 끝 손잡이가 나타나려면
|
||||
// 먼저 선택 상태여야 한다 — vis 의 자체 동작) — 여기서 모달을 열면
|
||||
// 손잡이가 나타나자마자 모달이 덮어써서 드래그를 할 수가 없다. 편집은
|
||||
|
||||
Reference in New Issue
Block a user