diff --git a/app/modules/project/store.py b/app/modules/project/store.py index fb6dc71..db14744 100644 --- a/app/modules/project/store.py +++ b/app/modules/project/store.py @@ -109,9 +109,13 @@ PROJECT_ICONS: tuple[str, ...] = ( "build", # 도구 ) -# 세션(칸반 컬럼) 색상 팔레트 — 아사나 태그/커스텀필드에서 쓰는 10색. -# 세션 생성/편집 팝업의 색상표가 이 순서 그대로 노출된다. -STAGE_COLOR_PALETTE: tuple[str, ...] = ( +# 섹션(칸반 컬럼) 색상표 — 모든 편집창이 프로젝트 색상표(아사나 16색) 하나를 쓴다. +# 섹션에서는 첫 칸(연회색 #c7c4c4, 아사나의 "색 없음")을 고르면 색 없음(NULL, 기본 회색 머리). +STAGE_COLOR_PALETTE: tuple[str, ...] = COLOR_PALETTE +STAGE_NO_COLOR = COLOR_PALETTE[0] + +# 예전 섹션 색상표(10색) — 이 색으로 칠해 둔 섹션은 그대로 유지(저장해도 지워지지 않게). +LEGACY_STAGE_COLORS: tuple[str, ...] = ( "#4573d2", # blue "#37a3a3", # teal "#62a420", # green @@ -263,9 +267,12 @@ def validate_project_icon(icon: Any) -> str | None: def validate_stage_color(color: Any) -> str | None: - """세션 색상 — 팔레트 밖 값/빈값은 저장 안 함(NULL, 기본 회색 표시).""" + """섹션 색상 — 색상표(또는 예전 10색) 안의 값만. 첫 칸(색 없음)·빈값·목록 밖은 + 저장 안 함(NULL, 기본 회색 머리).""" v = norm_str(color).lower() - return v if v in STAGE_COLOR_PALETTE else None + if v == STAGE_NO_COLOR: + return None + return v if (v in STAGE_COLOR_PALETTE or v in LEGACY_STAGE_COLORS) else None def validate_date(d: Any) -> str | None: diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 8c72430..d7b71a7 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 %} @@ -99,5 +99,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index a36e3db..a5b3f37 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 %} @@ -98,5 +98,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 214b2de..e1c9ce4 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 %} - + @@ -466,5 +466,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 07d2519..ad69ee6 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 %} @@ -68,5 +68,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/project.css b/app/static/project.css index 055645b..7b1efc8 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -129,6 +129,7 @@ color: #fff; font-size: 11px; font-weight: 700; } .pj-tree-avatar .pj-proj-ic { font-size: 16px; color: #fff; } +.pj-tree-avatar.is-light, .pj-tree-avatar.is-light .pj-proj-ic { color: #1e1f21; } .pj-tree-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pj-tree-acts { display: none; gap: 0; flex: 0 0 auto; } .pj-tree-row:hover .pj-tree-acts { display: inline-flex; } @@ -172,6 +173,7 @@ .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; @@ -278,6 +280,14 @@ .pj-col-head.pj-col-head-colored .pj-col-actions .pj-icon-btn { color: #fff; } .pj-col-head.pj-col-head-colored .pj-col-actions .pj-icon-btn:hover { background: rgba(255,255,255,.22); } .pj-col-head.pj-col-head-colored .pj-chip { background: rgba(255,255,255,.28); color: #fff; } +/* 밝은 색 머리(연노랑·하늘·연분홍 등) — 흰 글자 대신 어두운 글자(isLightColor) */ +.pj-col-head.pj-col-head-colored.is-light .pj-col-name, +.pj-col-head.pj-col-head-colored.is-light .pj-col-actions .pj-icon-btn, +.pj-col-head-colored.is-light .pj-col-assignee .pj-gicon { color: #1e1f21; } +.pj-col-head.pj-col-head-colored.is-light .pj-col-count { color: rgba(0,0,0,.55); } +.pj-col-head.pj-col-head-colored.is-light .pj-col-actions .pj-icon-btn:hover, +.pj-col-head-colored.is-light .pj-col-name.pj-col-name-editable:hover { background: rgba(0,0,0,.08); } +.pj-col-head.pj-col-head-colored.is-light .pj-chip { background: rgba(0,0,0,.08); color: #1e1f21; } /* 업무 수 — 아사나처럼 이름 바로 오른쪽에 숫자만(배지 없음) */ .pj-col-count { color: var(--pj-ink-soft); font-weight: 500; font-size: 14px; margin-left: 2px; } /* 오른쪽 끝 + (업무 추가) / … (세션 메뉴) */ diff --git a/app/static/project.js b/app/static/project.js index 8897755..faa3c7b 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -503,6 +503,21 @@ return "rgba(" + r + "," + g + "," + b + "," + alpha + ")"; } + // 밝은 색인지 — 아사나 16색에는 연노랑·하늘·연분홍처럼 흰 글자가 안 보이는 색이 있어 + // 그 위에서는 글자·아이콘을 어둡게 쓴다. alpha/바탕색을 주면 비쳐 보이는 실제 색으로 판단. + function isLightColor(hex, alpha, overHex) { + function rgb(h) { + h = String(h || "").replace("#", ""); + if (h.length === 3) h = h.split("").map(function (c) { return c + c; }).join(""); + return [parseInt(h.substr(0, 2), 16), parseInt(h.substr(2, 2), 16), parseInt(h.substr(4, 2), 16)]; + } + const c = rgb(hex); + if (c.some(isNaN)) return false; + const a = alpha == null ? 1 : alpha, o = rgb(overHex || "#ffffff"); + const m = c.map(function (v, i) { return v * a + o[i] * (1 - a); }); + return (0.299 * m[0] + 0.587 * m[1] + 0.114 * m[2]) / 255 > 0.72; + } + // 멤버 선택 후보 카드(아이콘 위 / 이름 가운데 / 체크박스 아래) — 새 프로젝트 // 모달(홈·프로젝트 페이지)과 멤버 배정 모달 3곳이 전부 이 함수 하나를 쓴다. // /api/assignable-users 응답의 avatar 필드를 그대로 쓰므로 페이지별 @@ -983,7 +998,8 @@ (p.id === currentId ? "is-active" : "") + '">' + handle + '' + - '' + + '' + projBadgeInner(p) + "" + '' + escapeHtml(p.name) + "" + acts + ""; } @@ -2127,6 +2143,7 @@ ? '' + escapeHtml(currentProject.icon) + "" : "") + escapeHtml(currentProject.name || ""); pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2"); + pillEl.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2")); } }, // 새 최상위 프로젝트 — 이 화면에선 이동하지 않고 트리/뷰에만 추가한다. @@ -2136,6 +2153,10 @@ }, }); function renderTree() { sideTree.render(); } + (function () { + const pill = document.querySelector(".pj-project-title-pill"); + if (pill) pill.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2")); + })(); // 댓글 말풍선 더블클릭 팝업 — 공용 구현(initCommentsChat, 위쪽 정의). // 제목은 이 화면이 이미 들고 있는 업무 목록에서 찾는다. const cmt = initCommentsChat(function (taskId) { @@ -2793,8 +2814,10 @@ el("pj-stage-modal-title").textContent = stage ? "\"" + stage.name + "\" 섹션 편집" : "새 섹션"; el("pj-stg-id").value = stage ? stage.id : ""; el("pj-stg-name").value = stage ? stage.name : ""; + // 프로젝트와 같은 색상표. 색이 없는 섹션은 첫 칸(연회색 = 색 없음)이 선택된 채로. + const noColor = (window.PJ_STAGE_COLORS || [])[0]; getStageColor = renderColorPalette( - el("pj-stg-colors"), null, stage ? stage.color : null, window.PJ_STAGE_COLORS + el("pj-stg-colors"), null, (stage && stage.color) || noColor, window.PJ_STAGE_COLORS ); // 기본 담당자 후보 = 업무 담당자 후보와 같다(프로젝트 멤버 + owner). // 지금 지정된 사람이 멤버에서 빠졌어도 선택지에 남겨 칸이 비지 않게 한다. @@ -2957,7 +2980,8 @@ col.className = "pj-col" + (s.is_done_stage ? " pj-col-done" : ""); col.dataset.stageId = s.id; col.innerHTML = - '
' + // 아사나처럼: 이름 바로 오른쪽에 업무 수(숫자만), 맨 오른쪽에 + / … 버튼. diff --git a/docs/PROJECT_MODULE.md b/docs/PROJECT_MODULE.md index d0369db..e8b6662 100644 --- a/docs/PROJECT_MODULE.md +++ b/docs/PROJECT_MODULE.md @@ -17,6 +17,9 @@ — 아사나의 실제 아이콘 이미지는 쓰지 않는다), `projects.icon`(마이그레이션 011, NULL = 색 + 첫 글자). 새 프로젝트·프로젝트 수정 팝업의 "아이콘" 격자(`renderIconPalette`, 첫 칸 "Aa" = 아이콘 없음), 사이드바 배지· 제목 알약에 흰 아이콘(`projBadgeInner`). 아이콘은 고르거나 바꿨을 때만 서버로 보내므로 011 전에도 다른 수정은 된다. +**색상표는 모든 편집창이 이 하나** — 섹션 편집도 같은 16색(`STAGE_COLOR_PALETTE = COLOR_PALETTE`). 섹션에서 첫 칸(연회색)은 +"색 없음"(NULL, 기본 회색 머리), 예전 10색으로 칠한 섹션은 그대로(`LEGACY_STAGE_COLORS`). 밝은 색(연노랑·하늘·연분홍 등) +위에서는 글자·아이콘을 어둡게(`isLightColor` → `.is-light`: 섹션 머리·사이드바 배지·제목 알약). ## 1. 개요