diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html index 171dfb9..92dec78 100644 --- a/app/modules/cupang/templates/cupang/index.html +++ b/app/modules/cupang/templates/cupang/index.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + diff --git a/app/modules/notice/templates/notice/admin.html b/app/modules/notice/templates/notice/admin.html index 5be3748..c95ae2a 100644 --- a/app/modules/notice/templates/notice/admin.html +++ b/app/modules/notice/templates/notice/admin.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + {% endblock %} diff --git a/app/modules/project/templates/project/_options.html b/app/modules/project/templates/project/_options.html index 997758a..c3c3f2e 100644 --- a/app/modules/project/templates/project/_options.html +++ b/app/modules/project/templates/project/_options.html @@ -129,4 +129,4 @@ document.documentElement.dataset.pjFont = pf; } catch (_) {} - + diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index 04c1d86..6460e01 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 994006f..b739f8a 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 43c0f74..158950d 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 1a3c338..e9d6e20 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 %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index a1451f6..480699e 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 %} diff --git a/app/modules/project/templates/project/notifier.html b/app/modules/project/templates/project/notifier.html index 067bff6..88be521 100644 --- a/app/modules/project/templates/project/notifier.html +++ b/app/modules/project/templates/project/notifier.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 92974a0..927a7e9 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 %} - + diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index b3e349d..bce2ec9 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 %} diff --git a/app/static/project-options.js b/app/static/project-options.js index bf0826f..1046a0f 100644 --- a/app/static/project-options.js +++ b/app/static/project-options.js @@ -50,13 +50,95 @@ return { default_view: o.default_view, board_cover: !!o.board_cover, all_view_users: resolveAllView(o.all_view_users), daily_alert_times: (o.daily_alert_times || []).slice().sort() }; } - function timeInputs() { return timesBox ? Array.from(timesBox.querySelectorAll("input[type=time]")) : []; } + function timeBtns() { return timesBox ? Array.from(timesBox.querySelectorAll(".pj-time-btn")) : []; } // 고른 시각들 — 빈 칸은 빼고 중복 제거·정렬(서버도 같게 정규화) function pickedTimes() { const out = []; - timeInputs().forEach(function (i) { const v = (i.value || "").slice(0, 5); if (v && out.indexOf(v) < 0) out.push(v); }); + timeBtns().forEach(function (b) { const v = b.dataset.value || ""; if (v && out.indexOf(v) < 0) out.push(v); }); return out.sort(); } + function setTimeBtn(btn, v) { + btn.dataset.value = v || ""; + btn.querySelector(".pj-time-text").textContent = v || "시각 선택"; + btn.classList.toggle("is-empty", !v); + } + + // ── 시각 고르기 팝업(2026-11-11) — 날짜 팝업(.pj-datepop)과 같은 카드·꼬리·파란 선택. + // 시(00~23)·분(00~55, 5분 단위) 두 열, 브라우저 기본 시계처럼 돌아가지 않고 끝에서 멈춘다. + // 모달 창 위에 떠야 해서 popover(top layer)로 body 에 붙인다. 시 = 바꾸고 열어 둠, 분 = 바꾸고 닫음. + let timePop = null, timePopOff = null; + function closeTimePop() { + if (!timePop) return; + if (timePopOff) timePopOff(); + try { timePop.hidePopover(); } catch (_) {} + timePop.remove(); timePop = timePopOff = null; + } + function pad2(n) { return (n < 10 ? "0" : "") + n; } + function openTimePop(btn) { + closeTimePop(); + const cur = btn.dataset.value || ""; + let h = cur ? cur.slice(0, 2) : "", m = cur ? cur.slice(3, 5) : ""; + const pop = document.createElement("div"); + pop.className = "pj-datepop pj-timepop"; + pop.setAttribute("popover", "manual"); + function col(kind, list, sel) { + return '
' + list.map(function (v) { + return '"; + }).join("") + "
"; + } + const hours = [], mins = []; + for (let i = 0; i < 24; i++) hours.push(pad2(i)); + for (let i = 0; i < 60; i += 5) mins.push(pad2(i)); + function paintHead() { pop.querySelector(".pj-tp-value").textContent = (h || "--") + ":" + (m || "--"); } + pop.innerHTML = '
' + + '
시분
' + + '
' + col("h", hours, h) + col("m", mins, m) + "
" + + '
' + + '
'; + paintHead(); + document.body.appendChild(pop); // 배율(.pj-ui-scale) 밖 + try { pop.showPopover(); } catch (_) {} + function commit() { if (h) setTimeBtn(btn, h + ":" + (m || "00")); } + pop.addEventListener("click", function (e) { + const it = e.target.closest(".pj-tp-item"); + if (it) { + const kind = it.parentNode.dataset.kind; + it.parentNode.querySelectorAll(".is-selected").forEach(function (x) { x.classList.remove("is-selected"); }); + it.classList.add("is-selected"); + if (kind === "h") { h = it.dataset.v; if (!m) m = "00"; } else { m = it.dataset.v; if (!h) h = "09"; } + paintHead(); commit(); + if (kind === "m") closeTimePop(); + return; + } + const act = e.target.closest("[data-tp]"); + if (act && act.dataset.tp === "clear") setTimeBtn(btn, ""); + if (act) closeTimePop(); + }); + // 자리 — 앵커 아래(자리 없으면 위), 꼬리가 앵커 가운데(날짜 팝업 place 와 같음) + const r = btn.getBoundingClientRect(); + const vw = document.documentElement.clientWidth, vh = document.documentElement.clientHeight; + const w = pop.offsetWidth, ph = pop.offsetHeight, ax = r.left + r.width / 2; + const left = Math.min(Math.max(8, ax - w / 2), vw - w - 8); + const below = r.bottom + 10 + ph <= vh - 8 || r.top - 10 - ph < 8; + pop.classList.toggle("is-above", !below); + pop.style.left = left + "px"; + pop.style.top = (below ? r.bottom + 10 : r.top - 10 - ph) + "px"; + pop.style.setProperty("--pj-dp-tail", Math.min(Math.max(ax - left, 16), w - 16) + "px"); + // 고른 값이 보이게 — 열 안에서만 스크롤(맨 위 00 부터, 끝에서 멈춤) + pop.querySelectorAll(".pj-tp-col").forEach(function (c) { + const sel = c.querySelector(".is-selected"); + if (sel) c.scrollTop = sel.offsetTop - c.offsetTop - (c.clientHeight - sel.offsetHeight) / 2; + }); + function onDown(e) { if (!pop.contains(e.target) && !btn.contains(e.target)) closeTimePop(); } + function onKey(e) { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); closeTimePop(); btn.focus(); } } + document.addEventListener("pointerdown", onDown, true); + document.addEventListener("keydown", onKey, true); + timePop = pop; + timePopOff = function () { + document.removeEventListener("pointerdown", onDown, true); + document.removeEventListener("keydown", onKey, true); + }; + } function renumberTimes() { if (!timesBox) return; Array.from(timesBox.children).forEach(function (li, i) { li.firstChild.textContent = "알림 " + (i + 1); }); @@ -64,18 +146,21 @@ } function addTimeRow(v) { const li = document.createElement("li"); - li.innerHTML = '' + - ''; - li.querySelector("input").value = v || ""; - li.querySelector("input").disabled = !sys; - li.querySelector("button").disabled = !sys; - li.querySelector("button").addEventListener("click", function () { li.remove(); renumberTimes(); }); + li.innerHTML = '' + + ''; + const tb = li.querySelector(".pj-time-btn"), del = li.querySelector(".pj-time-del"); + setTimeBtn(tb, v); + tb.disabled = del.disabled = !sys; + tb.addEventListener("click", function () { if (timePop) closeTimePop(); else openTimePop(tb); }); + del.addEventListener("click", function () { closeTimePop(); li.remove(); renumberTimes(); }); timesBox.appendChild(li); renumberTimes(); return li; } function fillTimes(list) { if (!timesBox) return; + closeTimePop(); timesBox.innerHTML = ""; (list || []).forEach(addTimeRow); renumberTimes(); @@ -179,7 +264,8 @@ select.addEventListener("change", paint); if (timesAdd) timesAdd.addEventListener("click", function () { if (timesBox.children.length >= TIMES_MAX) return; - addTimeRow("").querySelector("input").focus(); + const tb = addTimeRow("").querySelector(".pj-time-btn"); + tb.focus(); openTimePop(tb); }); if (allPicker) { allPicker.addEventListener("change", paintAllView); @@ -196,7 +282,7 @@ cancel.addEventListener("click", close); closeX.addEventListener("click", close); dialog.addEventListener("cancel", function (e) { if (save.disabled) e.preventDefault(); }); - dialog.addEventListener("close", function () { openSeq++; button.focus(); }); + dialog.addEventListener("close", function () { closeTimePop(); openSeq++; button.focus(); }); form.addEventListener("submit", async function (e) { e.preventDefault(); if (save.disabled) return; const fontValue = select.value, font = names[fontValue]; diff --git a/app/static/project.css b/app/static/project.css index 140d23c..bda3e6d 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -3306,9 +3306,21 @@ label.pj-options-row[for] { cursor: pointer; } .pj-options-times { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; } .pj-options-times li { display: flex; align-items: center; gap: 8px; font-size: 13px; } .pj-options-times li > span:first-child { min-width: 52px; color: var(--pj-ink-soft); } -.pj-options-times input[type=time] { padding: 6px 8px; border: 1px solid #d8dce2; border-radius: 6px; font: inherit; } -.pj-options-times button { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: none; color: #6d6e6f; cursor: pointer; } -.pj-options-times button:hover { background: #fdecec; color: #b42318; } +.pj-options-times .pj-time-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid #d8dce2; border-radius: 8px; background: #fff; color: var(--pj-ink); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; } +.pj-options-times .pj-time-btn:hover { border-color: #4573d2; } +.pj-options-times .pj-time-btn .material-symbols-outlined { font-size: 18px; color: #6d6e6f; } +.pj-options-times .pj-time-btn.is-empty .pj-time-text { color: #9aa1a9; } +.pj-options-times .pj-time-del { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: none; color: #6d6e6f; cursor: pointer; } +.pj-options-times .pj-time-del:hover { background: #fdecec; color: #b42318; } +/* 시각 고르기 팝업 — 날짜 팝업(.pj-datepop) 모양 그대로 + 시·분 두 열(돌아가지 않는 목록). popover(top layer) 기본값을 지운다. */ +.pj-timepop[popover] { inset: auto; margin: 0; overflow: visible; width: 200px; } +.pj-tp-value { display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; } +.pj-tp-heads, .pj-tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } +.pj-tp-heads span { text-align: center; font-size: 12px; font-weight: 600; color: #6d6e6f; padding: 2px 0 4px; } +.pj-tp-col { height: 238px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; gap: 2px; } +.pj-tp-item { flex: none; height: 32px; border: 0; border-radius: 16px; background: transparent; font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--pj-ink); cursor: pointer; } +.pj-tp-item:hover { background: #f1f2f4; } +.pj-tp-item.is-selected { background: #4573d2; color: #fff; font-weight: 600; } .pj-options-times:empty::before { content: "알림 없음"; font-size: 12px; color: var(--pj-ink-soft); } .pj-options-allview:empty::before { content: "불러오는 중…"; padding: 6px; font-size: 12px; color: var(--pj-ink-soft); } /* 켜기/끄기 스위치 */