feat(project): 아사나식 머리(제목·탭 2줄)·섹션 추가 위치·팝업 제목 KSN 프로그램
- 프로젝트 제목(색 네모 아이콘+이름)+멤버 / 뷰 탭을 왼쪽 위 2줄로 - "전체 프로젝트" 스코프면 제목을 "전체 프로젝트"로, 멤버 숨김 - "+ 섹션 추가"를 마지막 섹션 바로 오른쪽으로, 위쪽 바 "+ 작업 추가" 제거 - 수신함 오른쪽 작업 창(embed) 맨 위에 "프로젝트로 이동" 버튼 - 하위 작업에 또 하위 작업이 있으면 "N ⤷" 아이콘(작업 창·카드 펼침) - erp-dialog: 화면별 제목(window.ERP_DIALOG_TITLE)·erpPrompt 추가, project.js 의 alert/confirm/prompt 를 공용 창으로(제목 "KSN 프로그램") Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,20 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* erpPrompt 입력창 — 메시지 아래, 버튼 위 */
|
||||
.erp-dialog-input {
|
||||
display: block;
|
||||
width: calc(100% - 40px);
|
||||
margin: -8px 20px 20px;
|
||||
padding: 8px 10px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid var(--color-subtle-ash, #d4d4d4);
|
||||
border-radius: 8px;
|
||||
font: inherit;
|
||||
font-size: var(--text-body, 14px);
|
||||
}
|
||||
.erp-dialog-input:focus { outline: none; border-color: var(--color-rich-black, #0a0a0a); }
|
||||
|
||||
.erp-dialog-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
쓰는 법 (기본 창과 달리 **비동기**다 — Promise 를 돌려준다):
|
||||
erpConfirm("지울까요?").then(function (ok) { if (ok) ... });
|
||||
erpAlert("실패했습니다.").then(...)
|
||||
erpPrompt("주소를 입력하세요", "https://").then(function (v) { if (v) ... }); // 취소면 null
|
||||
|
||||
창 제목은 기본 "No.1 King ERP 프로그램". 화면마다 바꾸려면 그 화면 스크립트에서
|
||||
window.ERP_DIALOG_TITLE = "..." 를 두거나, 한 번만 options.title 로 넘긴다.
|
||||
|
||||
HTML 만으로 쓰려면 form 에 data-erp-confirm 을 달면 된다. 제출을 가로채
|
||||
확인을 받은 뒤 통과시킨다(가로챈 제출은 form.submit() 으로 다시 보내므로
|
||||
@@ -27,7 +31,12 @@
|
||||
'<circle cx="12" cy="17.1" r="1.05" fill="currentColor"/>' +
|
||||
"</svg>";
|
||||
|
||||
function titleOf(options) {
|
||||
return options.title || window.ERP_DIALOG_TITLE || TITLE;
|
||||
}
|
||||
|
||||
function build(message, options) {
|
||||
var TITLE_TEXT = titleOf(options);
|
||||
var backdrop = document.createElement("div");
|
||||
backdrop.className = "erp-dialog-backdrop";
|
||||
|
||||
@@ -35,11 +44,11 @@
|
||||
box.className = "erp-dialog" + (options.ask ? " erp-dialog-ask" : "");
|
||||
box.setAttribute("role", "alertdialog");
|
||||
box.setAttribute("aria-modal", "true");
|
||||
box.setAttribute("aria-label", TITLE);
|
||||
box.setAttribute("aria-label", TITLE_TEXT);
|
||||
|
||||
var title = document.createElement("h2");
|
||||
title.className = "erp-dialog-title";
|
||||
title.textContent = TITLE;
|
||||
title.textContent = TITLE_TEXT;
|
||||
|
||||
var body = document.createElement("div");
|
||||
body.className = "erp-dialog-body";
|
||||
@@ -54,6 +63,15 @@
|
||||
// HTML 로 해석되지 않게.
|
||||
text.textContent = String(message == null ? "" : message);
|
||||
|
||||
// 입력창(erpPrompt) — 메시지 아래 한 줄.
|
||||
var input = null;
|
||||
if (options.prompt) {
|
||||
input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "erp-dialog-input";
|
||||
input.value = options.defaultValue == null ? "" : String(options.defaultValue);
|
||||
}
|
||||
|
||||
var actions = document.createElement("div");
|
||||
actions.className = "erp-dialog-actions";
|
||||
|
||||
@@ -76,10 +94,11 @@
|
||||
body.appendChild(text);
|
||||
box.appendChild(title);
|
||||
box.appendChild(body);
|
||||
if (input) box.appendChild(input);
|
||||
box.appendChild(actions);
|
||||
backdrop.appendChild(box);
|
||||
|
||||
return { backdrop: backdrop, box: box, ok: ok, cancel: cancel };
|
||||
return { backdrop: backdrop, box: box, ok: ok, cancel: cancel, input: input };
|
||||
}
|
||||
|
||||
function open(message, options) {
|
||||
@@ -94,7 +113,9 @@
|
||||
document.removeEventListener("keydown", onKey, true);
|
||||
el.backdrop.remove();
|
||||
if (previous && typeof previous.focus === "function") previous.focus();
|
||||
resolve(result);
|
||||
// 입력창이면 확인 = 입력한 글자, 취소 = null
|
||||
if (el.input) resolve(result ? el.input.value : null);
|
||||
else resolve(result);
|
||||
}
|
||||
|
||||
function onKey(e) {
|
||||
@@ -106,7 +127,7 @@
|
||||
close(true);
|
||||
} else if (e.key === "Tab") {
|
||||
// 포커스가 창 밖으로 나가지 않게 두 버튼 사이에서만 돈다.
|
||||
var focusable = el.cancel ? [el.cancel, el.ok] : [el.ok];
|
||||
var focusable = (el.input ? [el.input] : []).concat(el.cancel ? [el.cancel, el.ok] : [el.ok]);
|
||||
var index = focusable.indexOf(document.activeElement);
|
||||
e.preventDefault();
|
||||
var next = e.shiftKey ? index - 1 : index + 1;
|
||||
@@ -125,7 +146,8 @@
|
||||
document.addEventListener("keydown", onKey, true);
|
||||
|
||||
document.body.appendChild(el.backdrop);
|
||||
el.ok.focus();
|
||||
if (el.input) { el.input.focus(); el.input.select(); }
|
||||
else el.ok.focus();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,6 +163,14 @@
|
||||
return open(message, opts).then(function () { return undefined; });
|
||||
};
|
||||
|
||||
window.erpPrompt = function (message, defaultValue, options) {
|
||||
var opts = options || {};
|
||||
opts.ask = true;
|
||||
opts.prompt = true;
|
||||
opts.defaultValue = defaultValue;
|
||||
return open(message, opts);
|
||||
};
|
||||
|
||||
// data-erp-confirm 이 달린 폼은 제출 전에 확인을 받는다.
|
||||
document.addEventListener("submit", function (e) {
|
||||
var form = e.target;
|
||||
|
||||
+47
-20
@@ -150,10 +150,15 @@
|
||||
.pj-avatar.pj-gicon-sm { width: 18px; height: 18px; }
|
||||
|
||||
/* ── 툴바 + 탭 ── */
|
||||
.pj-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex: none; }
|
||||
/* 제목 + 멤버 아이콘을 한 덩어리로 묶어 툴바 가운데에 둔다. */
|
||||
.pj-title-wrap { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
|
||||
.pj-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex: none; }
|
||||
/* 아사나식 머리 — 왼쪽 위에 두 줄: ① 아이콘·제목 + 멤버, ② 뷰 탭 */
|
||||
.pj-head-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
|
||||
.pj-title-wrap { max-width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; }
|
||||
.pj-project-title { min-width: 0; margin: 0; }
|
||||
/* 전체 프로젝트 스코프 — 제목을 "전체 프로젝트"로, 이 프로젝트 멤버는 숨긴다 */
|
||||
.pj-title-wrap .pj-all-title { display: none; }
|
||||
.pj-title-wrap.is-all-scope .pj-all-title { display: block; }
|
||||
.pj-title-wrap.is-all-scope > :not(.pj-all-title) { display: none; }
|
||||
/* 프로젝트 멤버 — 아사나처럼 살짝 겹친 아바타. 이름은 마우스를 올렸을 때만
|
||||
(data-tip → initHoverTips 가 커서 옆에 띄운다). */
|
||||
.pj-title-members { display: flex; align-items: center; flex: 0 0 auto; }
|
||||
@@ -171,20 +176,25 @@
|
||||
color: #6b7280; font-size: 15px; line-height: 1; cursor: pointer;
|
||||
}
|
||||
.pj-title-addmember:hover { border-style: solid; border-color: var(--pj-accent); color: var(--pj-accent); }
|
||||
/* 제목 알약 안 프로젝트 아이콘 */
|
||||
.pj-pill-ic { font-size: 26px; vertical-align: -5px; margin-right: 8px; }
|
||||
.pj-project-title-pill.is-light { color: #1e1f21; }
|
||||
.pj-project-title-pill {
|
||||
display: inline-block; max-width: 100%; vertical-align: middle;
|
||||
font-size: 22px; font-weight: 800; color: #fff;
|
||||
background: var(--pj-color, var(--pj-accent)); border-radius: 14px; padding: 8px 24px;
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
/* 제목 — 아사나처럼 프로젝트 색 네모 아이콘 + 진한 글자 제목 */
|
||||
.pj-project-title-pill, .pj-project-title-all {
|
||||
display: inline-flex; align-items: center; gap: 10px; max-width: 100%; vertical-align: middle;
|
||||
font-size: 21px; font-weight: 700; color: #1e1f21;
|
||||
border-radius: 8px; padding: 2px 8px 2px 0; white-space: nowrap;
|
||||
}
|
||||
/* 제목 바로 수정 — 마우스를 올리면 점선 테두리 + 글자 커서, 편집 중엔 흰 테두리 */
|
||||
.pj-project-title-pill.is-editable { cursor: text; box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s; }
|
||||
.pj-project-title-pill.is-editable:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4px var(--pj-color, var(--pj-accent)); }
|
||||
.pj-project-title-pill.is-editing { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pj-color, var(--pj-accent)); text-overflow: clip; }
|
||||
.pj-pill-name { outline: none; }
|
||||
.pj-pill-ic {
|
||||
flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
|
||||
width: 34px; height: 34px; border-radius: 9px; font-size: 21px;
|
||||
background: var(--pj-color, var(--pj-accent)); color: #fff;
|
||||
}
|
||||
.pj-project-title-pill.is-light .pj-pill-ic { color: #1e1f21; }
|
||||
.pj-project-title-all .pj-pill-ic { background: #5f6368; }
|
||||
.pj-pill-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; outline: none; padding: 2px 6px; border-radius: 6px; }
|
||||
/* 제목 바로 수정 — 마우스를 올리면 옅은 테두리 + 글자 커서, 편집 중엔 강조 테두리 */
|
||||
.pj-project-title-pill.is-editable { cursor: text; }
|
||||
.pj-project-title-pill.is-editable .pj-pill-name { box-shadow: 0 0 0 1px transparent; transition: box-shadow .12s; }
|
||||
.pj-project-title-pill.is-editable:hover .pj-pill-name { box-shadow: 0 0 0 1px #c9cdd3; }
|
||||
.pj-project-title-pill.is-editing .pj-pill-name { box-shadow: 0 0 0 2px var(--pj-color, var(--pj-accent)); text-overflow: clip; }
|
||||
.pj-pill-name[contenteditable="true"] { display: inline-block; min-width: 2em; white-space: pre; }
|
||||
/* 현재 활성 뷰(보드/리스트/달력/타임라인)가 pj-main 의 남은 세로 공간을
|
||||
차지 — 뷰 하나만 자체 스크롤(다른 칸과 스크롤이 서로 안 얽히게). 보드는
|
||||
@@ -203,6 +213,12 @@
|
||||
transition: transform .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
|
||||
}
|
||||
.pj-tab-highlight.pj-no-anim { transition: none; }
|
||||
/* 뷰 탭(보드/목록/…) — 아사나처럼 제목 아래 글자 탭 줄, 고른 탭만 옅은 배경 */
|
||||
.pj-view-tabs-line { background: transparent; padding: 0; gap: 2px; margin-left: -4px; }
|
||||
.pj-view-tabs-line .pj-tab { padding: 5px 10px; font-size: 14px; font-weight: 500; color: #525860; border-radius: 6px; }
|
||||
.pj-view-tabs-line .pj-tab:hover { color: #1e1f21; }
|
||||
.pj-view-tabs-line .pj-tab.is-active { color: #1e1f21; font-weight: 600; }
|
||||
.pj-view-tabs-line .pj-tab-highlight { top: 0; background: #ebe8fd; border-radius: 6px; box-shadow: none; }
|
||||
|
||||
/* 알림 벨 흔들림(미읽음 있을 때) */
|
||||
@keyframes pj-bell-ring {
|
||||
@@ -216,10 +232,9 @@
|
||||
}
|
||||
|
||||
/* ── 보드(칸반) — 아사나식. 세션은 가로로 한 줄에 나란히 놓이고, 화면을
|
||||
넘치면 아래로 접히지 않고 보드가 가로로 스크롤된다. "+ 세션 추가" 버튼은
|
||||
스크롤 영역 밖(pj-board-toolbar)에 있어 항상 보인다. ── */
|
||||
.pj-board-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; flex: none; }
|
||||
.pj-board-toolbar .pj-add-stage { width: auto; padding: 8px 18px; }
|
||||
넘치면 아래로 접히지 않고 보드가 가로로 스크롤된다. ── */
|
||||
/* "+ 섹션 추가" — 아사나처럼 마지막 섹션 바로 오른쪽(renderBoard 가 캔버스 끝에 붙인다) */
|
||||
.pj-add-stage.pj-board-addstage { flex: 0 0 240px; width: 240px; padding: 12px; text-align: left; }
|
||||
/* pj-board = 가로 스크롤 뷰포트(남은 세로 공간을 그대로 씀, 부모가 이미
|
||||
flex 로 높이를 정해준다). pj-board-canvas = 세션을 가로로 늘어놓는 flex
|
||||
컨테이너 — width:max-content 라서 세션이 늘어나는 만큼 캔버스가 넓어지고
|
||||
@@ -1003,6 +1018,14 @@
|
||||
.pj-card-sub.is-done .pj-card-sub-check .material-symbols-outlined { font-variation-settings: "FILL" 1; }
|
||||
.pj-card-sub-title { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-card-sub.is-done .pj-card-sub-title { color: #9aa1a9; }
|
||||
/* 하위 작업에 또 하위 작업이 있으면 제목 옆에 "N ⑂"(아사나) — 보드 카드 펼침·작업 창 하위 작업 줄 공용 */
|
||||
.pj-card-sub-nsubs, .pj-subtask-nsubs {
|
||||
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 1px;
|
||||
font-size: 11.5px; font-weight: 600; color: #6d6e6f; white-space: nowrap;
|
||||
}
|
||||
.pj-card-sub-nsubs svg, .pj-subtask-nsubs svg { width: 13px; height: 13px; margin-left: 2px; }
|
||||
.pj-subtask-nsubs { padding: 2px 5px; border-radius: 5px; }
|
||||
.pj-subtask-row:hover .pj-subtask-nsubs { background: #eceef0; }
|
||||
/* 마감일은 제목이 아무리 길어도 항상 보인다 — 줄어드는 건 제목(말줄임)뿐 */
|
||||
.pj-card-sub-due { flex: 0 0 auto; white-space: nowrap; font-size: 12px; color: var(--pj-ink-soft); }
|
||||
.pj-card-sub-due.is-overdue { color: #c22b10; }
|
||||
@@ -1564,6 +1587,10 @@ html.pj-embed #pj-modal-task .pj-task-modal-card {
|
||||
box-shadow: none; border-radius: 0; transition: none;
|
||||
}
|
||||
html.pj-embed .pj-task-panel-resizer { display: none; }
|
||||
/* 프로젝트로 이동 — 수신함 패널(embed)에서만 */
|
||||
.pj-btn-goto-project { display: none; }
|
||||
html.pj-embed .pj-btn-goto-project { display: inline-flex; align-items: center; gap: 4px; }
|
||||
.pj-btn-goto-project .material-symbols-outlined { font-size: 14px; }
|
||||
.pj-inbox-panel {
|
||||
position: fixed; top: 0; right: 0; bottom: 0; z-index: 900;
|
||||
width: min(640px, 92vw); background: #fff;
|
||||
|
||||
+75
-27
@@ -22,6 +22,20 @@
|
||||
}
|
||||
|
||||
function el(id) { return document.getElementById(id); }
|
||||
|
||||
// ── 확인/알림/입력 창 — 브라우저 기본 창 대신 공용 창(erp-dialog.js). 프로젝트
|
||||
// 관리 화면의 창 제목은 전부 "KSN 프로그램". 이 파일 안의 alert/confirm/prompt 는
|
||||
// 아래 함수가 가린다 — confirm/prompt 는 Promise 라서 쓰는 곳은 await 한다.
|
||||
window.ERP_DIALOG_TITLE = "KSN 프로그램";
|
||||
function alert(msg) {
|
||||
if (window.erpAlert) window.erpAlert(msg); else window.alert(msg);
|
||||
}
|
||||
function confirm(msg, opts) {
|
||||
return window.erpConfirm ? window.erpConfirm(msg, opts) : Promise.resolve(window.confirm(msg));
|
||||
}
|
||||
function prompt(msg, def) {
|
||||
return window.erpPrompt ? window.erpPrompt(msg, def) : Promise.resolve(window.prompt(msg, def));
|
||||
}
|
||||
// 화면 배율 토글(_help_btn.html, html.pj-ui-scale) — 켜면 .erp-app 을 0.75 로 줄여
|
||||
// 2880×1620·200%(CSS 화면 1440px 폭)에서도 1920×1080 기준 화면처럼 보이게 한다.
|
||||
// 팝업은 body 에 붙어 배율 밖이라 좌표를 그대로 쓰면 되고, 배율 안에서 마우스
|
||||
@@ -174,7 +188,7 @@
|
||||
async function shareTaskLink(taskId) {
|
||||
const url = location.origin + "/project/t/" + taskId;
|
||||
if (await copyToClipboard(url)) showToast("작업 링크를 복사했습니다.");
|
||||
else window.prompt("아래 주소를 복사하세요.", url);
|
||||
else prompt("아래 주소를 복사하세요.", url);
|
||||
}
|
||||
|
||||
// ── 날짜 표기 'YYYY-MM-DD' → 'mm/dd(요일)' — 서버 _fmt_date_kr 과 동일 규칙 ──
|
||||
@@ -582,8 +596,7 @@
|
||||
? name + "작업에 하위 작업이 " + n + "개 있습니다.\n하위 작업까지 모두 삭제할까요?" + tail
|
||||
: name + "작업을 삭제할까요?" + tail;
|
||||
const opts = { okText: n > 0 ? "하위 작업까지 삭제" : "삭제", cancelText: "취소" };
|
||||
if (window.erpConfirm) return await window.erpConfirm(msg, opts);
|
||||
return confirm(msg);
|
||||
return await confirm(msg, opts);
|
||||
}
|
||||
async function deleteTaskRequest(taskId) {
|
||||
const res = await api("DELETE", "/project/api/tasks/" + taskId);
|
||||
@@ -606,6 +619,23 @@
|
||||
'<rect x="7.3" y="8.2" width="9.4" height="8.6" rx="1.6"/>' +
|
||||
'<path d="M7.3 11.2h9.4M9.8 6.8v2.4M14.2 6.8v2.4" stroke-linecap="round"/>' +
|
||||
"</svg>";
|
||||
// 아사나의 하위 업무 아이콘(위 노드 하나에서 두 갈래로 뻗은 노드) — 보드 카드·
|
||||
// 타임라인·작업 창 하위 작업 줄 공용.
|
||||
const SUBTASK_ICON_SVG =
|
||||
'<svg class="pj-card-subtoggle-ic" viewBox="0 0 16 16" width="15" height="15" fill="none" ' +
|
||||
'stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
|
||||
'<circle cx="4" cy="3" r="1.7"/>' +
|
||||
'<path d="M4 4.7v6.3a1.5 1.5 0 0 0 1.5 1.5h3.8"/>' +
|
||||
'<path d="M4 7.5h5.3"/>' +
|
||||
'<circle cx="11.2" cy="7.5" r="1.7"/>' +
|
||||
'<circle cx="11.2" cy="12.5" r="1.7"/>' +
|
||||
"</svg>";
|
||||
// 하위 작업 줄에 붙는 "N ⑂" — 그 하위 작업에도 하위 작업이 있을 때만(아사나).
|
||||
function nestedSubsHtml(sub, cls) {
|
||||
const n = (sub && sub.subtask_total) || 0;
|
||||
if (!n) return "";
|
||||
return '<span class="' + cls + '" data-tip="하위 작업 ' + n + '개">' + n + SUBTASK_ICON_SVG + "</span>";
|
||||
}
|
||||
function personIconHtml(email) {
|
||||
if (!email) return '<span class="pj-person-ic is-empty">' + EMPTY_PERSON_SVG + "</span>";
|
||||
const url = pageAvatarUrl(email);
|
||||
@@ -1425,7 +1455,7 @@
|
||||
if (replyBtn) replyBtn.addEventListener("click", function () { setReplyTo(c); });
|
||||
if (mine) {
|
||||
li.querySelector(".pj-chat-del").addEventListener("click", async function () {
|
||||
if (!confirm("이 댓글을 삭제할까요? 첨부된 파일도 함께 삭제됩니다.")) return;
|
||||
if (!(await confirm("이 댓글을 삭제할까요? 첨부된 파일도 함께 삭제됩니다."))) return;
|
||||
try {
|
||||
await api("DELETE", "/project/api/comments/" + c.id);
|
||||
const n = await renderChat(taskId);
|
||||
@@ -1436,7 +1466,7 @@
|
||||
li.querySelectorAll(".pj-chat-att-del").forEach(function (btn) {
|
||||
btn.addEventListener("click", async function (e) {
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
if (!confirm("이 파일을 삭제할까요?")) return;
|
||||
if (!(await confirm("이 파일을 삭제할까요?"))) return;
|
||||
try {
|
||||
await api("DELETE", "/project/api/attachments/" + btn.dataset.id);
|
||||
await renderChat(taskId);
|
||||
@@ -2543,8 +2573,8 @@
|
||||
Object.assign(currentProject, p);
|
||||
const pillEl = document.querySelector(".pj-project-title-pill");
|
||||
if (pillEl) {
|
||||
pillEl.innerHTML = (currentProject.icon
|
||||
? '<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon) + "</span>" : "") +
|
||||
pillEl.innerHTML =
|
||||
'<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon || "folder") + "</span>" +
|
||||
'<span class="pj-pill-name">' + escapeHtml(currentProject.name || "") + "</span>";
|
||||
pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2");
|
||||
pillEl.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2"));
|
||||
@@ -2787,6 +2817,9 @@
|
||||
scopeToggle.querySelectorAll("[data-scope]").forEach(function (b) {
|
||||
b.classList.toggle("is-active", b === btn);
|
||||
});
|
||||
// 전체 프로젝트 보기 — 위 제목도 "전체 프로젝트"로(멤버 아이콘은 이 프로젝트 것이라 숨김).
|
||||
const titleWrap = el("pj-title-wrap");
|
||||
if (titleWrap) titleWrap.classList.toggle("is-all-scope", viewScope === "all");
|
||||
fillAssigneeFilter(); // 스코프가 바뀌면 담당자 후보도 달라진다
|
||||
renderView(currentView);
|
||||
updateFilterSummary();
|
||||
@@ -3516,9 +3549,13 @@
|
||||
const canvas = el("pj-board-canvas");
|
||||
canvas.innerHTML = "";
|
||||
const vis = visibleTasks();
|
||||
if (boardAddStageBtn) boardAddStageBtn.hidden = !(viewScope === "project" && canManage);
|
||||
if (viewScope === "project") renderBoardByStage(canvas, vis);
|
||||
else renderBoardByName(canvas, vis);
|
||||
// "+ 섹션 추가" — 아사나처럼 마지막 섹션 바로 오른쪽(캔버스 맨 끝)에.
|
||||
if (boardAddStageBtn) {
|
||||
boardAddStageBtn.hidden = !(viewScope === "project" && canManage);
|
||||
canvas.appendChild(boardAddStageBtn);
|
||||
}
|
||||
syncBoardHBar();
|
||||
}
|
||||
|
||||
@@ -3969,22 +4006,13 @@
|
||||
// dataTransfer 값을 읽을 수 없어서(보안상 type 만 보임) 여기 들고 있는다.
|
||||
let dragSub = null;
|
||||
const SUB_DRAG_TYPE = "application/x-pj-subtask";
|
||||
// 아사나의 하위 업무 아이콘(위 노드 하나에서 두 갈래로 뻗은 노드).
|
||||
const SUBTASK_ICON_SVG =
|
||||
'<svg class="pj-card-subtoggle-ic" viewBox="0 0 16 16" width="15" height="15" fill="none" ' +
|
||||
'stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
|
||||
'<circle cx="4" cy="3" r="1.7"/>' +
|
||||
'<path d="M4 4.7v6.3a1.5 1.5 0 0 0 1.5 1.5h3.8"/>' +
|
||||
'<path d="M4 7.5h5.3"/>' +
|
||||
'<circle cx="11.2" cy="7.5" r="1.7"/>' +
|
||||
'<circle cx="11.2" cy="12.5" r="1.7"/>' +
|
||||
"</svg>";
|
||||
function cardSubRowHtml(sub) {
|
||||
const di = dueInfo(sub.due_date, !!sub.completed_at);
|
||||
return '<div class="pj-card-sub' + (sub.completed_at ? " is-done" : "") + '" data-sub-id="' + sub.id + '">' +
|
||||
'<button type="button" class="pj-card-sub-check" title="' + (sub.completed_at ? "완료 취소" : "완료로 표시") + '">' +
|
||||
'<span class="material-symbols-outlined">check_circle</span></button>' +
|
||||
'<span class="pj-card-sub-title">' + escapeHtml(sub.title || "") + "</span>" +
|
||||
nestedSubsHtml(sub, "pj-card-sub-nsubs") +
|
||||
// 마감일 — 있으면 날짜, 없으면 아사나처럼 점선 원 달력 아이콘(줄에 마우스를
|
||||
// 올리면 보임). 둘 다 누르면 날짜 선택.
|
||||
(sub.due_date
|
||||
@@ -5430,7 +5458,7 @@
|
||||
});
|
||||
ul.querySelectorAll(".pj-attach-del").forEach(function (b) {
|
||||
b.addEventListener("click", async function () {
|
||||
if (!confirm("이 첨부 파일을 삭제할까요?")) return;
|
||||
if (!(await confirm("이 첨부 파일을 삭제할까요?"))) return;
|
||||
try { await api("DELETE", "/project/api/attachments/" + b.dataset.id); loadAttachments(taskId); }
|
||||
catch (e) { alert("삭제 실패: " + e.message); }
|
||||
});
|
||||
@@ -5521,7 +5549,7 @@
|
||||
if (btn.hasAttribute("data-reply")) { openReplyForm(item.closest(".pj-comment-thread"), rootId, c, taskId); return; }
|
||||
if (btn.hasAttribute("data-edit")) { editComment(item, c, taskId); return; }
|
||||
const n = hasReplies ? item.parentNode.querySelectorAll(".pj-comment-item.is-reply").length : 0;
|
||||
if (!confirm(n ? "이 댓글과 답글 " + n + "개를 삭제할까요?" : "이 댓글을 삭제할까요?")) return;
|
||||
if (!(await confirm(n ? "이 댓글과 답글 " + n + "개를 삭제할까요?" : "이 댓글을 삭제할까요?"))) return;
|
||||
try { await api("DELETE", "/project/api/comments/" + c.id); loadComments(taskId); }
|
||||
catch (err) { alert("삭제 실패: " + err.message); }
|
||||
});
|
||||
@@ -5640,6 +5668,17 @@
|
||||
if (id) shareTaskLink(id);
|
||||
});
|
||||
|
||||
// ── 프로젝트로 이동 — 수신함 오른쪽 패널(embed)에서만 보이는 버튼.
|
||||
// 패널(iframe)이 아니라 수신함 창 전체를 그 프로젝트 화면(작업 창 열린 채)으로 옮긴다.
|
||||
const gotoProjectBtn = el("pj-goto-project");
|
||||
if (gotoProjectBtn) gotoProjectBtn.addEventListener("click", function () {
|
||||
const id = el("pj-t-id").value;
|
||||
const t = tasks.find(function (x) { return String(x.id) === String(id); });
|
||||
const pid = (t && t.project_id) || projectId;
|
||||
const url = "/project/p/" + pid + (id ? "?task=" + id : "");
|
||||
(window.top || window).location.href = url;
|
||||
});
|
||||
|
||||
el("pj-delete-task").addEventListener("click", async function () {
|
||||
const id = el("pj-t-id").value;
|
||||
if (!id) return;
|
||||
@@ -5671,7 +5710,7 @@
|
||||
"</span>";
|
||||
}
|
||||
async function removeMember(email) {
|
||||
if (!confirm("이 멤버를 프로젝트에서 제외할까요?")) return;
|
||||
if (!(await confirm("이 멤버를 프로젝트에서 제외할까요?"))) return;
|
||||
try {
|
||||
await api("DELETE", "/project/api/projects/" + projectId + "/members/" + encodeURIComponent(email));
|
||||
members = members.filter(function (m) { return m.user_email !== email; });
|
||||
@@ -5925,9 +5964,19 @@
|
||||
box.focus();
|
||||
const cmd = btn.dataset.cmd;
|
||||
let arg = btn.dataset.arg || null;
|
||||
// 링크 — 입력 창(비동기)이 떠 있는 동안 선택 영역이 풀리므로 저장했다가 되돌린다.
|
||||
if (cmd === "createLink") {
|
||||
arg = prompt("연결할 주소(URL)를 입력하세요", "https://");
|
||||
if (!arg) return;
|
||||
const sel = window.getSelection();
|
||||
const saved = sel && sel.rangeCount ? sel.getRangeAt(0).cloneRange() : null;
|
||||
prompt("연결할 주소(URL)를 입력하세요", "https://").then(function (url) {
|
||||
if (!url) return;
|
||||
box.focus();
|
||||
if (saved) { sel.removeAllRanges(); sel.addRange(saved); }
|
||||
try { document.execCommand("createLink", false, url); } catch (_) {}
|
||||
normalizeEditorLinks(box);
|
||||
updateFmtState();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 체크리스트 — 글머리 목록처럼 켜고 끈다(줄마다 체크박스).
|
||||
if (cmd === "insertCheckbox") {
|
||||
@@ -6270,6 +6319,7 @@
|
||||
'<button type="button" class="pj-subtask-check">' +
|
||||
'<span class="material-symbols-outlined">check_circle</span></button>' +
|
||||
'<input type="text" class="pj-subtask-title" />' +
|
||||
nestedSubsHtml(sub, "pj-subtask-nsubs") +
|
||||
'<span class="pj-subtask-fill"></span>' +
|
||||
'<span class="pj-subtask-due"></span>' +
|
||||
'<span class="pj-subtask-av"></span>' +
|
||||
@@ -6498,7 +6548,7 @@
|
||||
(link.stage_name ? " · " + escapeHtml(link.stage_name) : "") +
|
||||
' <button type="button" class="pj-link-del" title="연결 해제">×</button>';
|
||||
span.querySelector(".pj-link-del").addEventListener("click", async function () {
|
||||
if (!confirm("'" + (link.project_name || "") + "' 연결을 해제할까요?")) return;
|
||||
if (!(await confirm("'" + (link.project_name || "") + "' 연결을 해제할까요?"))) return;
|
||||
try {
|
||||
await api("DELETE", "/project/api/tasks/" + taskId + "/links/" + link.project_id);
|
||||
span.remove();
|
||||
@@ -7077,9 +7127,7 @@
|
||||
const n = parseInt(btn.dataset.count || "1", 10);
|
||||
const msg = "'" + btn.dataset.title + "' 작업" + (n > 1 ? "(하위 작업 " + (n - 1) + "개 포함)" : "") +
|
||||
"을 복구할까요?\n원래 프로젝트·섹션 자리로 돌아갑니다.";
|
||||
const ok = window.erpConfirm
|
||||
? await window.erpConfirm(msg, { okText: "복구", cancelText: "취소" })
|
||||
: confirm(msg);
|
||||
const ok = await confirm(msg, { okText: "복구", cancelText: "취소" });
|
||||
if (!ok) return;
|
||||
btn.disabled = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user