feat(project): 모든 날짜 칸을 아사나식 날짜 팝업으로(브라우저 기본 달력 제거)

- enhanceDateInput: input[type=date] 를 숨기고 날짜 버튼을 붙여 openDatePopover 를
  연다. input 은 값 저장소로 남아 기존 .value·change 코드가 그대로 동작
- 새 프로젝트 마감일, 프로젝트 수정 시작일·마감일(버튼 하나, 팝업의 "+ 시작일"),
  하위 작업 추가 줄 마감일에 적용
- 정적 파일 버전 20260925h

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 19:50:32 +09:00
parent 3620482913
commit d9fba4ad1f
8 changed files with 93 additions and 12 deletions
@@ -12,7 +12,9 @@
<h3>새 프로젝트</h3>
<label>이름<input type="text" id="pj-f-name" placeholder="프로젝트 이름" /></label>
<label>설명<textarea id="pj-f-desc" rows="2"></textarea></label>
<label>마감일<input type="date" id="pj-f-due" /></label>
{# 날짜 칸은 project.js enhanceDateInput 이 아사나식 날짜 버튼으로 바꾼다(input 은 숨긴 값 저장소).
label 로 감싸지 않는다 — label 안의 버튼을 누르면 숨긴 input 이 다시 눌리는 문제가 생긴다. #}
<div class="pj-field-label">마감일<input type="date" id="pj-f-due" /></div>
<label>색상
<span class="pj-color-palette" id="pj-f-colors"></span>
</label>
@@ -33,9 +35,10 @@
<input type="hidden" id="pj-e-id" />
<label>이름<input type="text" id="pj-e-name" placeholder="프로젝트 이름" /></label>
<label>설명<textarea id="pj-e-desc" rows="2"></textarea></label>
<div class="pj-form-row">
<label>시작일<input type="date" id="pj-e-start" /></label>
<label>마감일<input type="date" id="pj-e-due" /></label>
{# 시작일·마감일은 버튼 하나(아사나식 날짜 팝업의 "+ 시작일") — enhanceDateInput(startInput) #}
<div class="pj-field-label">시작일 · 마감일
<input type="date" id="pj-e-start" />
<input type="date" id="pj-e-due" />
</div>
<label>색상
<span class="pj-color-palette" id="pj-e-colors"></span>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925g" defer></script>
<script src="/static/project.js?v=20260925h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -98,5 +98,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260925g" defer></script>
<script src="/static/project.js?v=20260925h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -465,5 +465,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260925g" defer></script>
<script src="/static/project.js?v=20260925h" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925g" defer></script>
<script src="/static/project.js?v=20260925h" defer></script>
{% endblock %}
+12
View File
@@ -556,6 +556,18 @@
.pj-due-btn.has-date { color: var(--pj-ink); }
.pj-due-btn.is-overdue { color: #c22b10; }
.pj-due-text:empty { display: none; }
/* <input type="date"> 대신 쓰는 아사나식 날짜 버튼(enhanceDateInput) — 누르면 날짜 팝업 */
.pj-date-btn {
display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; height: 36px; padding: 0 12px;
border: 1px solid #d8dce2; border-radius: 8px; background: #fff; cursor: pointer;
font-size: 13.5px; font-family: inherit; font-weight: 500; color: var(--pj-ink); white-space: nowrap;
}
.pj-date-btn .material-symbols-outlined { font-size: 19px; color: #6d6e6f; }
.pj-date-btn:hover { background: #f6f7f8; border-color: #c4c9d0; }
.pj-date-btn.is-empty { color: #9aa1a9; }
.pj-date-btn.is-overdue { color: #c22b10; }
/* 하위 작업 추가 줄 안에서는 옆 칸들과 높이를 맞춘다 */
.pj-subtask-form .pj-date-btn { margin-top: 0; height: 32px; padding: 0 10px; font-size: 12.5px; }
/* 화면엔 안 보이지만 달력이 버튼 자리에 뜨도록 렌더는 유지(display:none 이면 showPicker 불가) */
.pj-meta-row-multi .pj-meta-cell-due input.pj-due-native {
position: absolute; left: 60px; bottom: 2px; width: 1px !important; height: 1px;
+62
View File
@@ -393,6 +393,63 @@
focusActive();
}
// ── <input type="date"> 를 아사나식 날짜 버튼으로 — 브라우저 기본 달력 대신
// 위 openDatePopover 를 연다. input 은 숨겨 값 저장소로 그대로 두므로 기존
// 코드의 input.value 읽기/쓰기와 change 이벤트가 그대로 동작한다(value 쓰기를
// 가로채 버튼 글자도 따라 바뀐다 — enhanceAssigneeSelect 와 같은 방식).
// opts.startInput 을 주면 시작일·마감일을 버튼 하나로(팝업의 "+ 시작일").
function enhanceDateInput(input, opts) {
if (!input || input.dataset.pjDate) return;
opts = opts || {};
const startInput = opts.startInput || null;
const inputs = startInput ? [startInput, input] : [input];
const btn = document.createElement("button");
btn.type = "button";
btn.className = "pj-date-btn";
input.after(btn);
const desc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
inputs.forEach(function (inp) {
inp.dataset.pjDate = "1";
inp.style.display = "none";
Object.defineProperty(inp, "value", {
configurable: true,
get: function () { return desc.get.call(this); },
set: function (v) { desc.set.call(this, v); sync(); },
});
});
function label(iso) { const di = dueInfo(iso, false); return di ? di.text : ""; }
function sync() {
const due = input.value, start = startInput ? startInput.value : "";
const text = start && due ? label(start) + " – " + label(due)
: start ? label(start) + " –" : label(due);
const di = dueInfo(due, false);
btn.innerHTML = '<span class="material-symbols-outlined">calendar_month</span>' +
'<span class="pj-date-btn-text"></span>';
btn.querySelector(".pj-date-btn-text").textContent = text || (opts.placeholder || "날짜 선택");
btn.classList.toggle("is-empty", !text);
btn.classList.toggle("is-overdue", !!di && di.cls === "is-overdue");
btn.title = text ? "날짜 변경" : "날짜 지정";
}
function set(inp, v) {
if ((inp.value || "") === (v || "")) return;
inp.value = v || "";
inp.dispatchEvent(new Event("input", { bubbles: true }));
inp.dispatchEvent(new Event("change", { bubbles: true }));
}
btn.addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
openDatePopover(btn, {
start: startInput ? startInput.value : "", due: input.value, allowStart: !!startInput,
onChange: function (patch) {
if (startInput) set(startInput, patch.start_date);
set(input, patch.due_date);
},
});
});
sync();
}
// ── 탭 그룹(뷰 탭/스코프 토글, 둘 다 .pj-view-tabs 마크업 공유)에 슬라이드
// 하이라이트를 붙인다 — is-active 를 단순 배경색 대신, 실제 위치가 움직이는
// 절대배치 요소 하나로 표현한다. 탭 클릭·초기 렌더·리사이즈마다 위치 재계산.
@@ -1075,6 +1132,10 @@
});
}
// 프로젝트 모달의 날짜 칸 — 브라우저 기본 달력 대신 아사나식 날짜 팝업.
enhanceDateInput(el("pj-f-due"), { placeholder: "마감일 없음" });
enhanceDateInput(el("pj-e-due"), { startInput: el("pj-e-start"), placeholder: "날짜 없음" });
// "+" — 새 최상위 프로젝트. 기본은 만든 프로젝트 화면으로 이동한다.
initNewProjectModal(isAdmin, cfg.onCreated || function (project) {
location.href = "/project/p/" + project.id;
@@ -4947,6 +5008,7 @@
const addAssignee = el("pj-subtask-add-assignee");
enhanceAssigneeSelect(addAssignee);
const addDue = el("pj-subtask-add-due");
enhanceDateInput(addDue, { placeholder: "마감일" }); // 아사나식 날짜 팝업
const addBtn = el("pj-subtask-add");
let taskId = null, projectId = null, canDeleteFn = function () { return false; }, onChange = null, onOpen = null;
+4
View File
@@ -57,6 +57,10 @@
(`fitTitle`)이고 줄의 빈 곳을 누르면 하위 작업 열기, 마감일은 날짜 글자만(없으면 점선 달력
아이콘, 누르면 아사나식 날짜 팝업 `openDatePopover`), 담당자는 아이콘만(누르면 아이콘+이름 메뉴).
삭제는 우클릭 메뉴(줄에 × 없음).
- **날짜 고르기는 전부 아사나식 날짜 팝업(`openDatePopover`)** — 브라우저 기본 달력(`input[type=date]`)을
화면에 두지 않는다. 보드 카드·작업 팝업·하위 작업 줄은 직접 팝업을 열고, 폼의 날짜 칸(새 프로젝트 마감일,
프로젝트 수정 시작일·마감일(버튼 하나), 하위 작업 추가 마감일)은 `enhanceDateInput` 이 숨긴 input 옆에
날짜 버튼을 붙인다(input 은 값 저장소 — `.value` 읽기/쓰기·change 이벤트 그대로). 새 날짜 칸도 이 함수를 쓴다.
- **멀티호밍(다른 프로젝트에 연결)** — `task_project_links` 테이블. 작업 하나가
원래 소속(기본 홈, `tasks.project_id`/`stage_id`)과 무관하게 다른 프로젝트의
한 섹션에도 동시에 나타날 수 있다(아사나의 "Add to project"). 작업 편집