Merge branch 'feat/project-options-timepicker'
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block head_extra %}
|
||||
{# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<link rel="stylesheet" href="/static/cupang.css?v=20261023d" />
|
||||
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block head_extra %}
|
||||
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -129,4 +129,4 @@
|
||||
document.documentElement.dataset.pjFont = pf;
|
||||
} catch (_) {}
|
||||
</script>
|
||||
<script src="/static/project-options.js?v=20261111b" defer></script>
|
||||
<script src="/static/project-options.js?v=20261111c" defer></script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<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=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111c" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261111d" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -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 '<div class="pj-tp-col" data-kind="' + kind + '">' + list.map(function (v) {
|
||||
return '<button type="button" class="pj-tp-item' + (v === sel ? " is-selected" : "") + '" data-v="' + v + '">' + v + "</button>";
|
||||
}).join("") + "</div>";
|
||||
}
|
||||
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 = '<div class="pj-dp-fields"><span class="pj-dp-field is-active pj-tp-value"></span></div>' +
|
||||
'<div class="pj-tp-heads"><span>시</span><span>분</span></div>' +
|
||||
'<div class="pj-tp-cols">' + col("h", hours, h) + col("m", mins, m) + "</div>" +
|
||||
'<div class="pj-dp-foot"><button type="button" class="pj-dp-link" data-tp="clear">지우기</button>' +
|
||||
'<button type="button" class="pj-dp-link" data-tp="ok">확인</button></div>';
|
||||
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 = '<span></span><input type="time" step="60" aria-label="알림 시각">' +
|
||||
'<button type="button" title="이 알림 빼기" aria-label="이 알림 빼기"><span class="material-symbols-outlined">delete</span></button>';
|
||||
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 = '<span></span><button type="button" class="pj-time-btn" aria-label="알림 시각" title="시각 바꾸기">' +
|
||||
'<span class="pj-time-text"></span><span class="material-symbols-outlined">schedule</span></button>' +
|
||||
'<button type="button" class="pj-time-del" title="이 알림 빼기" aria-label="이 알림 빼기"><span class="material-symbols-outlined">delete</span></button>';
|
||||
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];
|
||||
|
||||
+15
-3
@@ -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); }
|
||||
/* 켜기/끄기 스위치 */
|
||||
|
||||
Reference in New Issue
Block a user