feat(project): 날짜 팝업에 일요일·공휴일 빨강, 토요일 파랑
KR_HOLIDAYS 를 Jinja 전역(pj_kr_holidays)으로 두고 공용 사이드바에서 window.PJ_HOLIDAYS 로 넘겨, 프로젝트 관리 모든 화면의 마감일/시작일 팝업(openDatePopover)이 국경일·공휴일·대체공휴일을 빨강으로 칠한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -157,6 +157,12 @@ from .modules.dispatch.store import ( # noqa: E402
|
||||
templates.env.filters["courier_logo"] = _courier_logo_url
|
||||
templates.env.filters["courier_track"] = _courier_tracking_url
|
||||
|
||||
# 프로젝트 관리 날짜 팝업(일=빨강·토=파랑·공휴일=빨강)용 대한민국 공휴일 표 —
|
||||
# 프로젝트 화면들이 공용 사이드바(_side.html)에서 window.PJ_HOLIDAYS 로 넘긴다.
|
||||
from .modules.project.store import KR_HOLIDAYS as _PJ_KR_HOLIDAYS # noqa: E402
|
||||
|
||||
templates.env.globals["pj_kr_holidays"] = _PJ_KR_HOLIDAYS
|
||||
|
||||
oauth = build_google_oauth()
|
||||
user_store = UserStore(DATA_DIR / "users.json")
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
is_admin 프로젝트 생성/수정/삭제 권한
|
||||
목록 동작은 project.js 의 initSideTree(첫 화면을 같은 마크업으로 다시 그림),
|
||||
새 프로젝트/수정 모달은 각 화면이 include 하는 project/_side_modals.html. #}
|
||||
{# 날짜 팝업(openDatePopover)이 공휴일을 빨강으로 칠할 때 쓰는 표 — 이 사이드바는
|
||||
프로젝트 관리의 모든 화면에 들어가므로 여기서 한 번 넘긴다(main.py 의 Jinja 전역). #}
|
||||
<script>window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
|
||||
<aside class="pj-side" data-is-admin="{{ 'true' if is_admin else 'false' }}"
|
||||
data-is-super="{{ 'true' if user.is_super_admin else 'false' }}"
|
||||
data-me="{{ user.email }}">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928k" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260929a" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928k" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260929a" />
|
||||
<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=20260928k" defer></script>
|
||||
<script src="/static/project.js?v=20260929a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928k" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260929a" />
|
||||
<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=20260928k" defer></script>
|
||||
<script src="/static/project.js?v=20260929a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928k" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260929a" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -491,5 +491,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260928k" defer></script>
|
||||
<script src="/static/project.js?v=20260929a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260928k" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260929a" />
|
||||
<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=20260928k" defer></script>
|
||||
<script src="/static/project.js?v=20260929a" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1515,13 +1515,17 @@ img.pj-person-ic { width: 22px; height: 22px; }
|
||||
.pj-dp-day { z-index: 0; }
|
||||
.pj-dp-day > * { position: relative; }
|
||||
.pj-dp-day:hover::before { background: #f1f2f4; }
|
||||
.pj-dp-day.is-weekend, .pj-dp-day.is-out { color: #8b929b; }
|
||||
.pj-dp-day.is-out { color: #b3b8bf; }
|
||||
/* 일요일·공휴일(국경일·대체공휴일) 빨강, 토요일 파랑 — 다른 달 날짜는 옅게 */
|
||||
.pj-dp-day.is-sun, .pj-dp-wd.is-sun { color: #d93025; }
|
||||
.pj-dp-day.is-sat, .pj-dp-wd.is-sat { color: #1a73e8; }
|
||||
.pj-dp-day.is-out.is-sun { color: #efaaa3; }
|
||||
.pj-dp-day.is-out.is-sat { color: #a8c6f3; }
|
||||
/* 오늘 = 파란 테두리 원 + 굵게 */
|
||||
.pj-dp-day.is-today { font-weight: 800; }
|
||||
.pj-dp-day.is-today::before { border: 1.5px solid #4573d2; }
|
||||
/* 선택 = 파란 원 + 흰 글자 (숫자가 원 위에 보이도록 글자는 z 위로) */
|
||||
.pj-dp-day.is-selected { color: #fff; font-weight: 600; }
|
||||
.pj-dp-day.is-selected, .pj-dp-day.is-selected.is-sun, .pj-dp-day.is-selected.is-sat { color: #fff; font-weight: 600; }
|
||||
.pj-dp-day.is-selected::before { background: #4573d2; border: 0; }
|
||||
.pj-dp-day.is-inrange { background: #e8effb; }
|
||||
.pj-dp-day { isolation: isolate; }
|
||||
|
||||
+14
-3
@@ -256,6 +256,9 @@
|
||||
const same = d.getFullYear() === new Date().getFullYear();
|
||||
return (same ? "" : d.getFullYear() + "년 ") + (d.getMonth() + 1) + "월 " + d.getDate() + "일";
|
||||
}
|
||||
function pageHolidays() {
|
||||
try { return JSON.parse((el("pj-data") || {}).textContent || "{}").holidays || {}; } catch (_) { return {}; }
|
||||
}
|
||||
function openDatePopover(anchor, opts) {
|
||||
closeDatePopover();
|
||||
const today = isoToday();
|
||||
@@ -265,6 +268,8 @@
|
||||
let active = "due";
|
||||
const base = new Date((due || start || today) + "T00:00:00");
|
||||
let viewY = base.getFullYear(), viewM = base.getMonth();
|
||||
// 공휴일 표 — 공용 사이드바가 넘긴 것(모든 프로젝트 화면), 없으면 프로젝트 화면 데이터.
|
||||
const holidays = window.PJ_HOLIDAYS || pageHolidays();
|
||||
|
||||
const pop = document.createElement("div");
|
||||
pop.className = "pj-datepop";
|
||||
@@ -289,11 +294,15 @@
|
||||
const iso = isoOf(d);
|
||||
const cls = ["pj-dp-day"];
|
||||
if (d.getMonth() !== viewM) cls.push("is-out");
|
||||
if (d.getDay() === 0 || d.getDay() === 6) cls.push("is-weekend");
|
||||
// 일요일·공휴일(국경일·대체공휴일 포함) = 빨강, 토요일 = 파랑. 공휴일 이름은 말풍선.
|
||||
const holName = holidays[iso] || "";
|
||||
if (d.getDay() === 0 || holName) cls.push("is-sun");
|
||||
else if (d.getDay() === 6) cls.push("is-sat");
|
||||
if (iso === today) cls.push("is-today");
|
||||
if (iso === due || (showStart && iso === start)) cls.push("is-selected");
|
||||
if (showStart && start && due && iso > start && iso < due) cls.push("is-inrange");
|
||||
days += '<button type="button" class="' + cls.join(" ") + '" data-iso="' + iso + '">' + d.getDate() + "</button>";
|
||||
days += '<button type="button" class="' + cls.join(" ") + '" data-iso="' + iso + '"' +
|
||||
(holName ? ' data-tip="' + escapeHtml(holName) + '"' : "") + ">" + d.getDate() + "</button>";
|
||||
}
|
||||
pop.innerHTML =
|
||||
'<div class="pj-dp-fields">' +
|
||||
@@ -308,7 +317,9 @@
|
||||
'<button type="button" class="pj-dp-navbtn" data-nav="1" title="다음 달"><span class="material-symbols-outlined">chevron_right</span></button>' +
|
||||
"</div>" +
|
||||
'<div class="pj-dp-grid">' +
|
||||
["일", "월", "화", "수", "목", "금", "토"].map(function (w) { return '<span class="pj-dp-wd">' + w + "</span>"; }).join("") +
|
||||
["일", "월", "화", "수", "목", "금", "토"].map(function (w, i) {
|
||||
return '<span class="pj-dp-wd' + (i === 0 ? " is-sun" : i === 6 ? " is-sat" : "") + '">' + w + "</span>";
|
||||
}).join("") +
|
||||
days +
|
||||
"</div>" +
|
||||
'<div class="pj-dp-foot">' +
|
||||
|
||||
@@ -78,6 +78,9 @@
|
||||
아이콘, 누르면 아사나식 날짜 팝업 `openDatePopover`), 담당자는 아이콘만(누르면 아이콘+이름 메뉴).
|
||||
삭제는 우클릭 메뉴(줄에 × 없음). 그 하위 작업에도 하위 작업이 있으면 제목 옆에 "N ⤷"
|
||||
아이콘(`nestedSubsHtml`, `list_tasks` 의 `subtask_total`) — 보드 카드 펼친 목록도 같다.
|
||||
- **날짜 팝업 색** — 일요일·공휴일(국경일·대체공휴일, `store.KR_HOLIDAYS`) 빨강, 토요일 파랑, 공휴일 이름은 말풍선.
|
||||
공휴일 표는 `main.py` Jinja 전역 `pj_kr_holidays` → 공용 사이드바 `_side.html` 이 `window.PJ_HOLIDAYS` 로 넘긴다
|
||||
(새 연도는 `KR_HOLIDAYS` 에만 추가하면 캘린더·타임라인·날짜 팝업 모두 반영).
|
||||
- **날짜 고르기는 전부 아사나식 날짜 팝업(`openDatePopover`)** — 브라우저 기본 달력(`input[type=date]`)을
|
||||
화면에 두지 않는다. 보드 카드·작업 팝업·하위 작업 줄은 직접 팝업을 열고, 폼의 날짜 칸(새 프로젝트 마감일,
|
||||
프로젝트 수정 시작일·마감일(버튼 하나), 하위 작업 추가 마감일)은 `enhanceDateInput` 이 숨긴 input 옆에
|
||||
|
||||
Reference in New Issue
Block a user