From eb1bae9fc612aee51444d2cfde3797a75e6f0570 Mon Sep 17 00:00:00 2001 From: king Date: Wed, 16 Sep 2026 13:23:40 +0900 Subject: [PATCH] =?UTF-8?q?style(project):=20=EC=83=88=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=EC=A0=9D=ED=8A=B8=20=EB=AA=A8=EB=8B=AC=20=EB=A9=A4?= =?UTF-8?q?=EB=B2=84=20=EC=84=A0=ED=83=9D=EB=8F=84=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EB=B0=B0=EC=A0=95=20=EC=B0=BD=EA=B3=BC=20=EB=8F=99=EC=9D=BC?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /api/assignable-users 응답에 avatar 필드 추가하고, 아이콘/이름/체크박스 세로 카드(memberPickHtml)를 공용 함수로 뽑아 새 프로젝트 모달(홈·사이드바 둘 다)과 멤버 배정 모달 3곳이 전부 같은 모양을 쓰도록 통일. 홈 페이지는 avatars 맵이 따로 없어서 이 API 응답의 avatar 필드에만 의존하도록 함. --- app/modules/project/router.py | 1 + .../project/templates/project/inbox.html | 2 +- .../project/templates/project/index.html | 2 +- .../project/templates/project/project.html | 2 +- app/static/project.js | 39 ++++++++++++------- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/app/modules/project/router.py b/app/modules/project/router.py index 43ca4cd..d19bb6c 100644 --- a/app/modules/project/router.py +++ b/app/modules/project/router.py @@ -750,6 +750,7 @@ async def api_assignable_users(request: Request) -> JSONResponse: "email": u["email"], "name": u.get("name") or u["email"].split("@")[0], "id": u["email"].split("@")[0], + "avatar": u.get("picture") or "", } for u in user_store.list_all() if has_module(u, "project") diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 92a9728..8b9281f 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -45,5 +45,5 @@ {% endif %} - + {% endblock %} diff --git a/app/modules/project/templates/project/index.html b/app/modules/project/templates/project/index.html index 8245c94..0e17b32 100644 --- a/app/modules/project/templates/project/index.html +++ b/app/modules/project/templates/project/index.html @@ -393,5 +393,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 066b0a4..68c5be2 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -461,5 +461,5 @@ - + {% endblock %} diff --git a/app/static/project.js b/app/static/project.js index 1522d8a..ff5d25d 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -114,6 +114,21 @@ return mm + "/" + dd + "(" + wd + ")"; } + // 멤버 선택 후보 카드(아이콘 위 / 이름 가운데 / 체크박스 아래) — 새 프로젝트 + // 모달(홈·프로젝트 페이지)과 멤버 배정 모달 3곳이 전부 이 함수 하나를 쓴다. + // /api/assignable-users 응답의 avatar 필드를 그대로 쓰므로 페이지별 + // avatars 맵(홈 페이지엔 없음)에 기대지 않는다. + function memberPickHtml(u) { + const icon = u.avatar + ? '' + : 'account_circle'; + return '"; + } + // ── 색상 팔레트 렌더 ─────────────────────────────────────── function renderColorPalette(container, onPick, initial) { const colors = window.PJ_COLORS || ["#4573d2"]; @@ -477,10 +492,9 @@ try { const res = await api("GET", "/project/api/assignable-users"); const users = res.users || []; - membersBox.innerHTML = users.length ? users.map(function (u) { - return '"; - }).join("") : "배정 가능한 직원이 없습니다."; + membersBox.innerHTML = users.length + ? users.map(memberPickHtml).join("") + : "배정 가능한 직원이 없습니다."; } catch (e) { membersBox.innerHTML = "불러오기 실패"; } @@ -2503,10 +2517,9 @@ try { const res = await api("GET", "/project/api/assignable-users"); const users = res.users || []; - newProjMembersBox.innerHTML = users.length ? users.map(function (u) { - return '"; - }).join("") : "배정 가능한 직원이 없습니다."; + newProjMembersBox.innerHTML = users.length + ? users.map(memberPickHtml).join("") + : "배정 가능한 직원이 없습니다."; } catch (e) { newProjMembersBox.innerHTML = "불러오기 실패"; } @@ -2632,13 +2645,9 @@ const res = await api("GET", "/project/api/assignable-users"); const existing = new Set(members.map(function (m) { return m.user_email; })); const candidates = res.users.filter(function (u) { return !existing.has(u.email); }); - box.innerHTML = candidates.length ? candidates.map(function (u) { - return '"; - }).join("") : "배정 가능한 직원이 없습니다(권한 미부여 또는 전원 배정됨)"; + box.innerHTML = candidates.length + ? candidates.map(memberPickHtml).join("") + : "배정 가능한 직원이 없습니다(권한 미부여 또는 전원 배정됨)"; } catch (e) { box.innerHTML = "불러오기 실패: " + escapeHtml(e.message) + ""; }