From de5fd15cf24274c9c4e171bb835b41bcb1a2f5e8 Mon Sep 17 00:00:00 2001 From: king Date: Thu, 24 Sep 2026 00:24:51 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=EB=8B=B4=EB=8B=B9=EC=9E=90=20?= =?UTF-8?q?=EB=B0=B0=EC=A0=95=EC=9D=80=20=EC=96=B4=EB=94=94=EC=84=9C?= =?UTF-8?q?=EB=82=98=20=EC=95=84=EC=9D=B4=EC=BD=98=20+=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - showContextMenu 항목에 icon(HTML)·checked(오른쪽 ✓) 지원. - assigneeMenuItems: 카드·하위 업무 담당자 메뉴를 아바타 + 이름으로(미지정 = 점선 원 사람 아이콘). - enhanceAssigneeSelect: 업무 팝업 담당자·하위 업무 담당자·하위 업무 추가의 대신 보이는 담당자 버튼(enhanceAssigneeSelect) — 아이콘 + 이름 */ +.pj-assignee-btn { + display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; + margin: 0; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; + background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--pj-ink); + cursor: pointer; text-align: left; +} +.pj-assignee-btn:hover, .pj-assignee-btn:focus-visible { border-color: var(--pj-border); background: #f6f7f8; outline: none; } +.pj-assignee-btn:disabled { cursor: default; opacity: .6; } +.pj-assignee-btn.is-empty { color: var(--pj-ink-soft); font-weight: 500; } +.pj-assignee-btn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.pj-meta-cell-assignee .pj-assignee-btn { max-width: 150px; } +/* 하위 업무 줄/추가 폼 — 폭 고정, 글자 작게 */ +.pj-assignee-btn.pj-subtask-assignee { flex: 0 0 auto; width: 110px; font-size: 12px; font-weight: 500; padding: 2px 6px; } +.pj-assignee-btn[data-for="pj-subtask-add-assignee"] { + flex: 0 0 auto; width: 110px; font-size: 12px; font-weight: 500; padding: 3px 6px; + border-color: #d8dce2; border-radius: 8px; background: #fff; +} +.pj-assignee-btn.pj-subtask-assignee img.pj-person-ic, +.pj-assignee-btn[data-for="pj-subtask-add-assignee"] img.pj-person-ic { width: 18px; height: 18px; } +.pj-assignee-btn.pj-subtask-assignee .pj-person-ic svg, +.pj-assignee-btn[data-for="pj-subtask-add-assignee"] .pj-person-ic svg { width: 18px; height: 18px; } /* ── 대시보드 — 통계 카드 + 차트(전부 클라이언트 집계/렌더). 카드 자체는 pj-col 과 같은 흰 카드 톤(radius/shadow)을 재사용, 숫자·막대·도넛만 diff --git a/app/static/project.js b/app/static/project.js index 177a749..36822e1 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -109,8 +109,16 @@ } const b = document.createElement("button"); b.type = "button"; - b.className = "pj-ctxmenu-item" + (item.danger ? " is-danger" : ""); - b.textContent = item.label; + b.className = "pj-ctxmenu-item" + (item.danger ? " is-danger" : "") + (item.checked ? " is-checked" : ""); + // item.icon(HTML) — 담당자 메뉴의 아바타 등. item.checked — 현재 값 표시(오른쪽 ✓). + if (item.icon || item.checked) { + b.innerHTML = (item.icon ? '' + item.icon + "" : "") + + '' + + (item.checked ? 'check' : ""); + b.querySelector(".pj-ctxmenu-label").textContent = item.label; + } else { + b.textContent = item.label; + } b.addEventListener("click", function () { closeContextMenu(); item.onClick(); }); menu.appendChild(b); }); @@ -253,6 +261,78 @@ if (u.avatar && !pageAvatars[u.email.toLowerCase()]) pageAvatars[u.email.toLowerCase()] = u.avatar; }); } + // ── 담당자 고르기 — 어디서 배정하든 항상 "아이콘 + 이름" 메뉴(아사나처럼). + // 미지정 = 점선 원 사람 아이콘. + const EMPTY_PERSON_SVG = + '"; + function personIconHtml(email) { + if (!email) return '' + EMPTY_PERSON_SVG + ""; + const url = pageAvatarUrl(email); + return url + ? '' + : 'account_circle'; + } + // emails 후보 중 하나를 고르는 메뉴 항목들(맨 앞 "(미지정)"). cur = 현재 담당자. + function assigneeMenuItems(emails, cur, onPick) { + const c = String(cur || "").toLowerCase(); + const items = [{ label: "(미지정)", icon: personIconHtml(""), checked: !c, onClick: function () { onPick(""); } }]; + emails.forEach(function (e) { + items.push({ + label: idOf(e), icon: personIconHtml(e), checked: String(e).toLowerCase() === c, + onClick: function () { onPick(e); }, + }); + }); + return items; + } + // ` 는 `enhanceAssigneeSelect(sel)` 로 감싼다(select 는 숨겨 값 저장소로 유지). 미지정 = 점선 원 사람 아이콘. - **내 업무** (`/project/`): 프로젝트 모듈의 첫 화면. 예전 홈(프로젝트 카드 그리드)은 **없앴다** — 좌측 "내 업무" 메뉴와 같은 화면이다(`project/mytasks.html`).