feat(project): meeting numbers in sales unit, member add/remove, quick-task polish

- Header numbers use the goal table sales unit (e.g. 백만원); exact won
  amounts in tooltips.
- Notes title: 결정사항 : 진행상황 수시 공유 및 완료 되어야 함.
- Member dialog shows current members checked: check to add, uncheck to
  remove (owner locked); member APIs also require project access.
- Quick task table: centered bold headers, assignee shown as avatar + name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 16:50:42 +09:00
parent 261267a523
commit a0722f26ca
13 changed files with 132 additions and 45 deletions
+6 -4
View File
@@ -1174,9 +1174,10 @@ def api_list_members(request: Request, project_id: int) -> JSONResponse:
def api_add_member(
request: Request, project_id: int, payload: dict[str, Any] = Body(...)
) -> JSONResponse:
"""사용자를 프로젝트에 배정 — 관리자 전용."""
_require_admin(request)
"""사용자를 프로젝트에 배정 — 관리자 전용(그 프로젝트를 볼 수 있는 관리자)."""
user = _require_admin(request)
st = _db_or_503(request)
_require_manage(request, st, user, project_id)
try:
member = st.add_member(
project_id=project_id,
@@ -1193,8 +1194,9 @@ def api_add_member(
def api_remove_member(
request: Request, project_id: int, user_email: str
) -> JSONResponse:
_require_admin(request)
user = _require_admin(request)
st = _db_or_503(request)
_require_manage(request, st, user, project_id)
st.remove_member(project_id=project_id, user_email=user_email)
return JSONResponse({"ok": True})
@@ -3065,7 +3067,7 @@ def _meeting_view(request: Request, st: Any, *, year: int, month: int, week: dat
fresh = perf.freshness()
head = {
"sales_unit": targets["sales_unit"], "sales_target": targets["sales_target"],
"month_target_won": month_target_won,
"month_target_won": month_target_won, "unit_mult": mult, # 머리 숫자를 목표 표 매출 단위(예: 백만원)로 보여 줄 배수
"week_targets_set": bool(wt), "cum_target": cum_unit, "cum_target_won": cum_target_won,
"mtd": mtd, "mtd_end": mtd_end.isoformat() if mtd_end >= first else "", "gap": gap, "rate": rate,
"prev_exists": bool(pm and pm["week_start"] == prev_start.isoformat()),
@@ -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=20261007e" />
<link rel="stylesheet" href="/static/project.css?v=20261007f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -13,6 +13,8 @@
{% block content %}
{% set h = head if head is defined and head else {} %}
{% set unk = h.unknown or [] %}
{#- 머리 숫자 — 목표 표 매출 단위(예: 백만원)로, 원이거나 모르는 단위면 원. 정확한 원 금액은 말풍선 -#}
{%- macro unitv(v) -%}{% if h.unit_mult and h.unit_mult > 1 %}{{ "{:,.1f}".format(v / h.unit_mult).rstrip('0').rstrip('.') }}<small>{{ h.sales_unit }}</small>{% else %}{{ won(v) }}<small>원</small>{% endif %}{%- endmacro -%}
{%- macro unknown_val() -%}<span class="pj-meet-unknown" title="실적 조회 실패 — 알 수 없는 값이라 0 으로 보이지 않습니다">미확인</span>{%- endmacro -%}
{# 주간 회의록 — 목표 표 월 머리를 누르면 열린다(/project/goals/{연도}/meetings/{월}?week=주차 시작일).
주차(store.month_weeks — 그 달 안, 1주차는 1일부터)마다 회의록 하나: 머리 영역 3칸(월 계획 + 숫자 한 줄 | 결정 사항·메모 | 작업 등록)
@@ -68,17 +70,17 @@
<span class="pj-meet-kpi-label">월 목표</span>
<span class="pj-meet-kpi-val">{% if h.sales_target is not none %}{{ num(h.sales_target) }}<small>{{ h.sales_unit }}</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
</span>
<span class="pj-meet-kpi" title="월 누적 목표 매출 — 연간 목표 표에서 입력한 주차별 매출 목표의 1주차~{{ week_n }}주차 합계{% if not h.week_targets_set %} — 목표 표에서 주차별 목표를 입력하세요{% endif %}">
<span class="pj-meet-kpi" title="월 누적 목표 매출{% if h.cum_target_won is not none %} {{ won(h.cum_target_won) }}원{% endif %} — 연간 목표 표에서 입력한 주차별 매출 목표의 1주차~{{ week_n }}주차 합계{% if not h.week_targets_set %} — 목표 표에서 주차별 목표를 입력하세요{% endif %}">
<span class="pj-meet-kpi-label">누적 목표 <small>({{ week_n }}주차)</small></span>
<span class="pj-meet-kpi-val">{% if h.cum_target_won is not none %}{{ won(h.cum_target_won) }}<small>원</small>{% else %}<span class="pj-muted">—</span>{% endif %}</span>
<span class="pj-meet-kpi-val">{% if h.cum_target_won is not none %}{{ unitv(h.cum_target_won) }}{% else %}<span class="pj-muted">—</span>{% endif %}</span>
</span>
<span class="pj-meet-kpi" title="월 누적 실적(1일~{{ h.mtd_end[5:] | replace('-', '/') if h.mtd_end else '' }}){% if h.fresh_tip %} · {{ h.fresh_tip }}{% endif %}">
<span class="pj-meet-kpi" title="월 누적 실적{% if h.mtd is not none %} {{ won(h.mtd) }}원{% endif %}(1일~{{ h.mtd_end[5:] | replace('-', '/') if h.mtd_end else '' }}){% if h.fresh_tip %} · {{ h.fresh_tip }}{% endif %}">
<span class="pj-meet-kpi-label">누적 실적 {% if h.mtd_end %}<small>({{ h.mtd_end[5:] | replace('-', '/') }})</small>{% endif %}</span>
<span class="pj-meet-kpi-val">{% if h.mtd is not none %}{{ won(h.mtd) }}<small>원</small>{% elif 'mtd' in unk %}{{ unknown_val() }}{% else %}<span class="pj-muted">—</span>{% endif %}</span>
<span class="pj-meet-kpi-val">{% if h.mtd is not none %}{{ unitv(h.mtd) }}{% elif 'mtd' in unk %}{{ unknown_val() }}{% else %}<span class="pj-muted">—</span>{% endif %}</span>
</span>
<span class="pj-meet-kpi" title="누적 목표 대비 달성 — 월 누적 실적 − 월 누적 목표 매출 (월 누적 실적 ÷ 월 누적 목표 매출)">
<span class="pj-meet-kpi" title="누적 목표 대비 달성{% if h.gap is not none %} {{ '+' if h.gap > 0 else '' }}{{ won(h.gap) }}원{% endif %} — 월 누적 실적 − 월 누적 목표 매출 (월 누적 실적 ÷ 월 누적 목표 매출)">
<span class="pj-meet-kpi-label">목표 대비</span>
{% if h.gap is not none %}<span class="pj-meet-kpi-val {{ 'is-good' if h.gap >= 0 else 'is-low' }}">{{ '+' if h.gap > 0 else '' }}{{ won(h.gap) }}<small>원</small>{% if h.rate is not none %} <small class="pj-meet-kpi-rate">{{ h.rate }}%</small>{% endif %}</span>
{% if h.gap is not none %}<span class="pj-meet-kpi-val {{ 'is-good' if h.gap >= 0 else 'is-low' }}">{{ '+' if h.gap > 0 else '' }}{{ unitv(h.gap) }}{% if h.rate is not none %} <small class="pj-meet-kpi-rate">{{ h.rate }}%</small>{% endif %}</span>
{% elif 'mtd' in unk and h.cum_target_won is not none %}<span class="pj-meet-kpi-val">{{ unknown_val() }}</span>
{% else %}<span class="pj-meet-kpi-val"><span class="pj-muted">—</span></span>{% endif %}
</span>
@@ -102,7 +104,7 @@
</div>
</section>
<section class="pj-meet-area pj-meet-notes">
<h3>결정 사항 · 메모</h3>
<h3>결정사항 : 진행상황 수시 공유 및 완료 되어야 함</h3>
{% if meeting %}
{% if is_admin %}<textarea id="pj-meet-notes" rows="4" placeholder="이번 회의에서 정한 것, 다음 주까지 확인할 것">{{ meeting.notes }}</textarea>
{% else %}<div class="pj-meet-ro">{{ meeting.notes or '—' }}</div>{% endif %}
@@ -279,5 +281,5 @@
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261007a" defer></script>
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
@@ -175,7 +175,7 @@
<h3>멤버 배정 (관리자)</h3>
<p>프로젝트 화면 제목 오른쪽에 멤버 사진이 겹쳐서 보입니다.</p>
<ul>
<li><span class="pjh-ui">+</span> — 멤버를 추가합니다(프로젝트 관리 권한이 있는 직원 중에서 고릅니다).</li>
<li><span class="pjh-ui">+</span> — 멤버 배정·제외 창이 열립니다. 지금 멤버는 체크된 채로 나오며, <b>체크하면 배정, 체크를 풀면 제외</b>됩니다(제외는 확인 후). 후보는 프로젝트 관리 권한이 있는 직원이고, 소유자는 뺄 수 없습니다.</li>
<li>사진에 마우스 → 이름이 보입니다. <b>클릭</b> → 그 사람이 이 프로젝트에서 맡은 작업 목록이 뜹니다.</li>
<li>사진에서 <b>우클릭</b> → <span class="pjh-ui">제외</span>로 멤버에서 뺍니다.</li>
</ul>
@@ -598,7 +598,7 @@
<p>제목 아래 <span class="pjh-ui">해당 월 계획</span>은 연간 목표 표에 적은 월 계획을 업무 영역별로 보여 줍니다. 굵게·기울임·밑줄·글자 색상과 줄바꿈·들여쓰기를 유지하고, 글자 크기는 월 계획의 기본 크기로 표시합니다. 빈 계획은 생략하고, 병합 칸은 해당 월을 포함하는 계획을 한 번 표시합니다. 여기서는 읽기만 하므로 수정하려면 연간 목표 표로 돌아갑니다.</p>
<h3 id="meetings-kpis">위쪽 3칸 — 월 계획·숫자, 결정 사항, 작업 등록</h3>
<p>제목 아래 세 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽은 <b>월 계획</b>이고 그 머리 줄 오른쪽에 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비)가 작게 한 줄로 나옵니다(숫자에 마우스를 올리면 자세한 뜻). 가운데는 <b>결정 사항 · 메모</b>, 오른쪽은 <b>작업 등록</b> 표입니다.</p>
<p>제목 아래 세 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽은 <b>월 계획</b>이고 그 머리 줄 오른쪽에 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비)가 작게 한 줄로 나옵니다(목표 표 매출 단위, 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻). 가운데는 <b>결정사항</b>(진행상황 수시 공유 및 완료 되어야 할 것), 오른쪽은 <b>작업 등록</b> 표입니다.</p>
<ol class="pjh-steps">
<li><b>작업 등록</b> — 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다.</li>
<li>프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).</li>
@@ -619,7 +619,7 @@
<li>각 항목의 <b>주요 업무</b>에 실행할 일과 일정을 적습니다.</li>
<li><span class="pjh-ui">참석자</span>를 눌러 프로젝트 관리 권한이 있는 등록 직원 중 선택합니다. 찾기·전원 선택·모두 해제를 사용할 수 있으며, 칩의 <span class="pjh-ui">×</span>로 참석자를 뺍니다.</li>
<li>참석자 오른쪽 <span class="pjh-ui">회의록 보드</span>를 누르면 그 주차의 Google 슬라이드가 새 창으로 열립니다. 처음 누르면 회의록 보드 공유 드라이브에 빈 슬라이드(제목 틀 없음)를 <b>"10월 2주차 (10/5~10/11)"</b> 같은 이름으로 만들고, 다음부터는 같은 파일을 엽니다. 직원 누구나 열 수 있으며, 슬라이드 편집 권한은 공유 드라이브 권한을 따릅니다. 창이 안 뜨면 브라우저의 팝업 허용을 확인하세요.</li>
<li>위쪽 가운데 <b>결정 사항 · 메모</b>에 회의 결론과 다음주까지 확인할 일을 적습니다.</li>
<li>위쪽 가운데 <b>결정사항</b>에 회의 결론과 진행상황을 수시로 공유하고 완료되어야 할 일을 적습니다.</li>
</ol>
<p>금액은 <code>1,200,000</code>·<code>120만</code>·<code>1.5억</code>·<code>3천만</code>·<code>1억2천만</code>처럼 입력할 수 있습니다. <kbd>Enter</kbd> 또는 칸을 떠날 때 원 단위로 저장되고, 빈칸은 값을 지웁니다. 숫자로 읽히지 않는 값(예: <code>20개</code>)은 적은 글 그대로 저장됩니다. 글·메모는 입력을 약 0.8초 멈추거나 칸을 떠날 때, 참석자는 바꾸는 즉시 저장됩니다.</p>
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
@@ -67,7 +67,7 @@
{% endfor %}
</div>
{% if is_admin %}
<button type="button" class="pj-title-addmember" id="pj-add-member" title="멤버 배정">+</button>
<button type="button" class="pj-title-addmember" id="pj-add-member" title="멤버 배정·제외">+</button>
{% endif %}
</div>
<div class="pj-view-tabs pj-view-tabs-line" id="pj-view-tabs">
@@ -428,16 +428,16 @@
<!-- 멤버 배정 모달 — 등록된 사용자(프로젝트 권한 보유)를 자동 목록화 -->
<div class="pj-modal" id="pj-modal-member" hidden>
<div class="pj-modal-card">
<h3>멤버 배정</h3>
<p class="pj-modal-hint">관리자 페이지에서 <b>프로젝트 관리</b> 권한을 켠 직원이 후보로 나옵니다. 여러 명을 한 번에 선택할 수 있습니다.
배정된 멤버는 모두 이 프로젝트를 보고 수정할 수 있습니다.</p>
<h3>멤버 배정 · 제외</h3>
<p class="pj-modal-hint">체크하면 배정, 체크를 풀면 제외됩니다(지금 멤버는 체크된 채로 나옵니다). 후보는 관리자 페이지에서
<b>프로젝트 관리</b> 권한을 켠 직원입니다. 배정된 멤버는 모두 이 프로젝트를 보고 수정할 수 있고, 소유자는 뺄 수 없습니다.</p>
<div class="pj-field-label">직원
<div class="pj-member-picker" id="pj-m-users">불러오는 중…</div>
</div>
<div class="pj-modal-actions">
<span style="flex:1"></span>
<button type="button" class="pj-btn" data-close>취소</button>
<button type="button" class="pj-btn pj-btn-primary" id="pj-save-member">배정</button>
<button type="button" class="pj-btn pj-btn-primary" id="pj-save-member">저장</button>
</div>
</div>
</div>
@@ -487,5 +487,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007j" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
{% endblock %}
+10 -1
View File
@@ -2512,7 +2512,16 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.pj-meet-kpiline .pj-meet-kpi-rate { color: inherit; font-weight: 700; }
/* ③ 작업 등록 표 — 빈 칸을 누르면 목록(body 에 붙는 메뉴) */
.pj-meet-quick-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.pj-meet-quick-table th { position: sticky; top: 0; z-index: 1; background: #f7f8f9; padding: 4px 6px; font-size: 11.5px; font-weight: 600; color: var(--pj-ink-soft); text-align: left; border-bottom: 1px solid var(--pj-border); }
.pj-meet-quick-table th { position: sticky; top: 0; z-index: 1; background: #f7f8f9; padding: 4px 6px; font-size: 12px; font-weight: 700; color: var(--pj-ink); text-align: center; border-bottom: 1px solid var(--pj-border); }
.pj-meet-pick-cell.is-person { display: flex; align-items: center; gap: 6px; }
.pj-meet-pick-cell.is-person > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pj-meet-quick-face { width: 18px; height: 18px; flex: none; border-radius: 50%; object-fit: cover; }
.pj-meet-quick-face.is-ini {
display: inline-flex; align-items: center; justify-content: center; background: var(--pj-accent-tint); color: var(--pj-accent-dark);
font-size: 10.5px; font-weight: 700;
}
.pj-ctxmenu-ic .pj-meet-quick-face { width: 20px; height: 20px; }
.pj-member-pick.is-owner { opacity: .75; }
.pj-meet-quick-table th:nth-child(1) { width: 34%; }
.pj-meet-quick-table th:nth-child(2) { width: 17%; }
.pj-meet-quick-table th:nth-child(3) { width: 20%; }
+56 -13
View File
@@ -7178,6 +7178,9 @@
}).observe(taskModal, { attributes: true, attributeFilter: ["hidden"] });
}
// ── 멤버 배정·제외(2026-10-07) — 후보 전원을 보여 주고 지금 멤버는 체크된 채로. 체크 = 배정, 체크 해제 = 제외.
// 소유자는 늘 권한이 있어 뺄 수 없다(체크·잠금). 권한을 잃어 후보에 없는 지금 멤버도 보여서 뺄 수 있게.
const lowerEmail = function (e) { return String(e || "").toLowerCase(); };
const addMemberBtn = el("pj-add-member");
if (addMemberBtn) addMemberBtn.addEventListener("click", async function () {
const box = el("pj-m-users");
@@ -7185,11 +7188,26 @@
box.innerHTML = "불러오는 중…";
try {
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(memberPickHtml).join("")
: "<span class='pj-empty-sm'>배정 가능한 직원이 없습니다(권한 미부여 또는 전원 배정됨)</span>";
const owner = lowerEmail(currentProject && currentProject.owner_email);
const current = new Set(members.map(function (m) { return lowerEmail(m.user_email); }));
const seen = new Set();
const list = (res.users || []).map(function (u) { seen.add(lowerEmail(u.email)); return u; });
members.forEach(function (m) { // 후보 목록에 없는 지금 멤버(권한을 잃은 사람 등)
const e = lowerEmail(m.user_email);
if (!seen.has(e)) list.push({ email: e, id: idOf(e), name: m.user_name || idOf(e), avatar: "" });
});
if (!list.length) { box.innerHTML = "<span class='pj-empty-sm'>배정 가능한 직원이 없습니다(관리자 페이지에서 프로젝트 관리 권한 부여)</span>"; return; }
box.innerHTML = list.map(memberPickHtml).join("");
box.querySelectorAll("input[type=checkbox]").forEach(function (cb) {
const e = lowerEmail(cb.value);
cb.checked = current.has(e) || e === owner;
cb.dataset.was = cb.checked ? "1" : "";
if (e === owner) {
cb.disabled = true;
const lab = cb.closest("label");
if (lab) { lab.title = "소유자 — 뺄 수 없습니다"; lab.classList.add("is-owner"); }
}
});
} catch (e) {
box.innerHTML = "<span class='pj-empty-sm'>불러오기 실패: " + escapeHtml(e.message) + "</span>";
}
@@ -7197,10 +7215,15 @@
const saveMemberBtn = el("pj-save-member");
if (saveMemberBtn) saveMemberBtn.addEventListener("click", async function () {
const box = el("pj-m-users");
const checked = box ? Array.from(box.querySelectorAll("input[type=checkbox]:checked")) : [];
if (!checked.length) { alert("직원을 선택하세요."); return; }
const boxes = box ? Array.from(box.querySelectorAll("input[type=checkbox]:not(:disabled)")) : [];
const toAdd = boxes.filter(function (cb) { return cb.checked && !cb.dataset.was; });
const toRemove = boxes.filter(function (cb) { return !cb.checked && cb.dataset.was; });
if (!toAdd.length && !toRemove.length) { closeModal(memberModal); return; }
if (toRemove.length && !(await confirm(toRemove.length + "명을 이 프로젝트에서 제외할까요? 제외되면 이 프로젝트를 볼 수 없습니다.",
{ okText: "제외", cancelText: "취소" }))) return;
saveMemberBtn.disabled = true;
let failCount = 0;
for (const cb of checked) {
for (const cb of toAdd) {
try {
const res = await api("POST", "/project/api/projects/" + projectId + "/members", {
user_email: cb.value, user_name: cb.dataset.name || "",
@@ -7208,9 +7231,17 @@
members.push(res.member);
} catch (e) { failCount++; }
}
for (const cb of toRemove) {
try {
await api("DELETE", "/project/api/projects/" + projectId + "/members/" + encodeURIComponent(cb.value));
for (let i = members.length - 1; i >= 0; i--) if (lowerEmail(members[i].user_email) === lowerEmail(cb.value)) members.splice(i, 1);
} catch (e) { failCount++; }
}
saveMemberBtn.disabled = false;
renderMemberList();
closeModal(memberModal);
if (failCount) showToast(failCount + "명 배정 실패", "error");
if (failCount) showToast(failCount + "명 처리 실패", "error");
else showToast("멤버를 저장했습니다" + (toAdd.length ? " · 배정 " + toAdd.length + "명" : "") + (toRemove.length ? " · 제외 " + toRemove.length + "명" : ""));
});
// 최초 렌더 — 아사나처럼 프로젝트에 들어오면 보드(세션)가 기본 화면이다
@@ -10248,9 +10279,18 @@
const tbody = box.querySelector("tbody");
const wrap = document.querySelector(".pj-wrap");
const KEY = "pj_meet_quick:" + ((wrap && wrap.dataset.me) || "");
const people = {};
(window.PJ_MEET_MEMBERS || []).forEach(function (m) { people[String(m.email).toLowerCase()] = m.name; });
const people = {}, faces = {};
(window.PJ_MEET_MEMBERS || []).forEach(function (m) {
people[String(m.email).toLowerCase()] = m.name;
faces[String(m.email).toLowerCase()] = m.avatar || "";
});
const nameOf = function (email) { return people[String(email).toLowerCase()] || capName(idOf(email)); };
// 담당자 = 아이콘(사진, 없으면 첫 글자) + 이름
const faceHtml = function (email) {
const url = faces[String(email).toLowerCase()];
return url ? '<img class="pj-avatar pj-meet-quick-face" src="' + escapeHtml(url) + '" alt="" referrerpolicy="no-referrer">'
: '<span class="pj-meet-quick-face is-ini">' + escapeHtml(nameOf(email).slice(0, 1)) + "</span>";
};
const blank = function () { return { title: "", assignee: "", projectId: null, projectName: "", stageId: null, stageName: "" }; };
let rows = [];
try { rows = (JSON.parse(localStorage.getItem(KEY) || "[]") || []).filter(function (r) { return r && !r.done; }); } catch (_) { rows = []; }
@@ -10289,7 +10329,10 @@
tbody.innerHTML = rows.map(function (r, i) {
return '<tr data-i="' + i + '"' + (r.done ? ' class="is-done"' : "") + ">" +
'<td><input type="text" data-field="title" maxlength="200" placeholder="작업 제목" value="' + escapeHtml(r.title) + '"></td>' +
"<td>" + cell("assignee", r.assignee ? nameOf(r.assignee) : "", "담당자") + "</td>" +
"<td>" + (r.assignee
? '<button type="button" class="pj-meet-pick-cell is-person" data-pick="assignee">' + faceHtml(r.assignee) +
"<span>" + escapeHtml(nameOf(r.assignee)) + "</span></button>"
: cell("assignee", "", "담당자")) + "</td>" +
"<td>" + cell("project", r.projectName, "프로젝트") + "</td>" +
"<td>" + cell("stage", r.stageName, "섹션") + "</td>" +
"<td>" + (r.done
@@ -10326,7 +10369,7 @@
: (window.PJ_MEET_MEMBERS || []).map(function (m) { return String(m.email).toLowerCase(); });
menuAt(btn, [{ label: "담당자 없음", icon: menuIcon("person_off"), checked: !r.assignee, onClick: function () { r.assignee = ""; save(); render(); } }, null]
.concat(emails.map(function (e) {
return { label: nameOf(e), icon: menuIcon("person"), checked: r.assignee === e, onClick: function () { r.assignee = e; save(); render(); } };
return { label: nameOf(e), icon: faceHtml(e), checked: r.assignee === e, onClick: function () { r.assignee = e; save(); render(); } };
})));
}
async function pickStage(r, btn) {
+3 -1
View File
@@ -248,7 +248,9 @@
좌측 "내 작업"는 접이식 패널이 아니라 `/project/` 로 가는 링크다.
**이 프로젝트의 멤버는 화면 위 제목 오른쪽**에 겹친 아바타로 둔다(`.pj-title-members`) —
마우스를 올리면 이름(`data-tip`, `initHoverTips` 가 위임 방식이라 동적 요소에도 붙는다),
클릭하면 그 사람이 이 프로젝트에서 맡은 작업 팝업, 우클릭(관리자)하면 제외, 옆 `+` 는 멤버 배정.
클릭하면 그 사람이 이 프로젝트에서 맡은 작업 팝업, 우클릭(관리자)하면 제외, 옆 `+` 는 **멤버 배정·제외 창**(2026-10-07 —
후보 전원 + 지금 멤버는 체크된 채, 체크 = 배정 `POST …/members`, 해제 = 제외 `DELETE …/members/{email}`(확인 뒤), 소유자는 잠금.
두 API 모두 관리자 + 그 프로젝트 관리 권한(`_require_manage`)).
좌측 트리의 작업 클릭도 페이지 이동 없이 바로 팝업(이미 로드된 전체 작업 데이터 사용).
좌측 맨 위 **수신함**(미확인 @태그 배지)과 **내 작업**(접이식, 기본 접힘 — 작업을 고르면
팝업이 열리며 다시 접힌다)가 있다. 예전 화면 오른쪽에 항상 떠 있던 "내 작업" 패널은 없앴고
+26 -2
View File
@@ -15,6 +15,7 @@ const WATCHDOG = setTimeout(function () { console.log("TIMEOUT — 어딘가에
const ROOT = path.join(__dirname, "..", "..");
const html = fs.readFileSync(path.join(__dirname, ".out", "project_render.html"), "utf8");
const adminHtml = fs.readFileSync(path.join(__dirname, ".out", "project_admin_render.html"), "utf8");
const JS = fs.readFileSync(path.join(ROOT, "app", "static", "project.js"), "utf8");
const fails = [];
@@ -29,8 +30,8 @@ function deferred() {
return { promise: p, resolve: resolve, reject: reject };
}
function makeEnv() {
const dom = new JSDOM(html, { runScripts: "dangerously", pretendToBeVisual: true, url: "http://localhost/project/p/1" });
function makeEnv(page) {
const dom = new JSDOM(page || html, { runScripts: "dangerously", pretendToBeVisual: true, url: "http://localhost/project/p/1" });
const w = dom.window, d = w.document;
w.__PJ_TEST__ = true;
w.HTMLDialogElement.prototype.showModal = function () { this.open = true; };
@@ -726,6 +727,29 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
check("[대시보드 담당자별] 항목 → 작업 편집 창(하위 작업은 서버에서 받아)", !env.d.getElementById("pj-modal-task").hidden &&
env.d.getElementById("pj-t-title").value === "하위 2", env.d.getElementById("pj-t-title").value);
}
// ── 멤버 배정·제외 — 지금 멤버는 체크된 채로, 체크 = 배정 · 해제 = 제외(확인 뒤) ──
{
const env = makeEnv(adminHtml); baseRoutes(env);
env.route("GET", /\/project\/api\/assignable-users$/, function () { return { body: { users: [
{ email: "me@test.local", id: "me", name: "Me", avatar: "" },
{ email: "bob@test.local", id: "bob", name: "Bob", avatar: "" },
{ email: "carol@test.local", id: "carol", name: "Carol", avatar: "" }] } }; });
const added = [], removed = [];
env.route("POST", /\/project\/api\/projects\/1\/members$/, function (u, body) { added.push(body.user_email); return { body: { member: { user_email: body.user_email } } }; });
env.route("DELETE", /\/project\/api\/projects\/1\/members\/.+$/, function (u) { removed.push(decodeURIComponent(u.split("/").pop())); return { body: { ok: true } }; });
await boot(env);
const d = env.d;
d.getElementById("pj-add-member").click(); await settle();
const box = function (e) { return d.querySelector('#pj-m-users input[value="' + e + '"]'); };
check("[멤버 배정·제외] 지금 멤버 체크·나머지 해제", box("bob@test.local").checked && box("me@test.local").checked && !box("carol@test.local").checked);
box("bob@test.local").checked = false; box("carol@test.local").checked = true;
env.setConfirm(true);
d.getElementById("pj-save-member").click(); await settle(); await wait(10); await settle();
check("[멤버 배정·제외] 체크 = 배정, 해제 = 제외(확인 뒤)", JSON.stringify(added) === '["carol@test.local"]' &&
JSON.stringify(removed) === '["bob@test.local"]' && env.confirms === 1, [added, removed, env.confirms]);
const shown = Array.from(d.querySelectorAll(".pj-tmember")).map(function (n) { return n.dataset.email; });
check("[멤버 배정·제외] 머리 멤버 아이콘 갱신", shown.indexOf("bob@test.local") < 0 && shown.indexOf("carol@test.local") >= 0, shown);
}
clearTimeout(WATCHDOG);
console.log(fails.length ? "\nFAILED: " + fails.join(", ") : "\nALL PASS");
process.exit(fails.length ? 1 : 0);
+7 -2
View File
@@ -50,8 +50,13 @@ def main() -> None:
jinja2.FileSystemLoader(os.path.join(ROOT, "app", "modules", "project", "templates")),
]))
env.globals["pj_kr_holidays"] = {}
for name, admin in (("project_render.html", False), ("project_admin_render.html", True)):
render_one(env, name, admin)
def render_one(env, name: str, admin: bool) -> None:
html = env.get_template("project/project.html").render(
user={"email": ME, "is_super_admin": False}, is_admin=False, can_manage=True,
user={"email": ME, "is_super_admin": False}, is_admin=admin, can_manage=True,
project=PROJECTS[0], current_project_id=1, stages=STAGES[1], tasks=TASKS,
members=[{"user_email": ME, "role": "member"}, {"user_email": "bob@test.local", "role": "member"}],
projects_meta=PROJECTS, nav_projects=PROJECTS, stages_by_project=STAGES, board_stage_names=["할 일", "완료"],
@@ -62,7 +67,7 @@ def main() -> None:
my_open_total=0, mention_unread=0,
)
os.makedirs(OUT_DIR, exist_ok=True)
path = os.path.join(OUT_DIR, "project_render.html")
path = os.path.join(OUT_DIR, name)
io.open(path, "w", encoding="utf-8", newline="\n").write(html)
print("rendered:", path)