feat(project): add meeting cell editing
Apply project_db migration 019 to enable vertical cell merges. Other cell editing remains available before migration.
This commit is contained in:
+148
-26
@@ -2534,7 +2534,50 @@ class ProjectStore:
|
||||
return ok
|
||||
|
||||
def _meeting_cols(self, conn: Any) -> str:
|
||||
return self._MEETING_ITEM_COLS + (", line_key" if self._meeting_keys(conn) else "")
|
||||
return (self._MEETING_ITEM_COLS + (", line_key" if self._meeting_keys(conn) else "")
|
||||
+ (", content_row_span" if self._meeting_cells(conn) else ""))
|
||||
|
||||
def _meeting_cells(self, conn: Any) -> bool:
|
||||
if getattr(self, "_meeting_cells_ok", False):
|
||||
return True
|
||||
ok = self._column_exists(conn, "goal_meeting_items", "content_row_span")
|
||||
if ok:
|
||||
self._meeting_cells_ok = True
|
||||
return ok
|
||||
|
||||
def _locked_meeting_items(self, conn: Any, item_id: int) -> list[dict[str, Any]]:
|
||||
"""글 저장·이동·병합·줄 변경이 같은 주 잠금을 공유한다."""
|
||||
me = conn.execute("SELECT week_start FROM goal_meeting_items WHERE id = %s", (item_id,)).fetchone()
|
||||
if me is None:
|
||||
raise KeyError(item_id)
|
||||
if not conn.execute("SELECT week_start FROM goal_meetings WHERE week_start = %s FOR UPDATE",
|
||||
(me["week_start"],)).fetchone():
|
||||
raise KeyError(item_id)
|
||||
rows = conn.execute(f"SELECT {self._meeting_cols(conn)} FROM goal_meeting_items "
|
||||
"WHERE week_start = %s ORDER BY sort_order, id FOR UPDATE", (me["week_start"],)).fetchall()
|
||||
if not any(int(r["id"]) == item_id for r in rows):
|
||||
raise KeyError(item_id)
|
||||
return rows
|
||||
|
||||
@staticmethod
|
||||
def _meeting_merge_ranges(rows: list[dict[str, Any]]) -> list[tuple[int, int]]:
|
||||
ranges = []
|
||||
for i, row in enumerate(rows):
|
||||
span = int(row.get("content_row_span") or 1)
|
||||
if span > 1:
|
||||
end = i + span - 1
|
||||
if end >= len(rows) or any(r["section"] != row["section"] for r in rows[i:end + 1]):
|
||||
raise store.GoalCellConflict("병합 범위가 바뀌었습니다. 새로고침해 주세요.")
|
||||
ranges.append((i, end))
|
||||
return ranges
|
||||
|
||||
def _require_meeting_cell_visible(self, rows: list[dict[str, Any]], item_id: int) -> int:
|
||||
i = next((n for n, r in enumerate(rows) if int(r["id"]) == item_id), -1)
|
||||
if i < 0:
|
||||
raise KeyError(item_id)
|
||||
if any(a < i <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise store.GoalCellConflict("병합에 가려진 셀입니다. 새로고침해 주세요.")
|
||||
return i
|
||||
|
||||
@staticmethod
|
||||
def _meeting_item(r: dict[str, Any]) -> dict[str, Any]:
|
||||
@@ -2570,6 +2613,7 @@ class ProjectStore:
|
||||
self._require_meetings(conn)
|
||||
cols = self._meeting_cols(conn)
|
||||
keyed = self._meeting_keys(conn)
|
||||
cell_merges = self._meeting_cells(conn)
|
||||
head = conn.execute(
|
||||
"SELECT week_start, week_target, attendees, notes, updated_by, updated_at "
|
||||
"FROM goal_meetings WHERE week_start = %s", (week_start,),
|
||||
@@ -2608,6 +2652,7 @@ class ProjectStore:
|
||||
"week_target": int(prev_head["week_target"]) if prev_head["week_target"] is not None
|
||||
else None} if prev_head else None,
|
||||
"line_keys": keyed,
|
||||
"cell_merges": cell_merges,
|
||||
}
|
||||
|
||||
def create_meeting(self, *, week_start: date, sections: list[tuple[str, str]], created_by: str = "") -> bool:
|
||||
@@ -2742,7 +2787,7 @@ class ProjectStore:
|
||||
).fetchone():
|
||||
raise KeyError(str(week_start))
|
||||
rows = conn.execute(
|
||||
"SELECT id, section, section_color FROM goal_meeting_items WHERE week_start = %s "
|
||||
f"SELECT {self._meeting_cols(conn)} FROM goal_meeting_items WHERE week_start = %s "
|
||||
"ORDER BY sort_order, id", (week_start,),
|
||||
).fetchall()
|
||||
ids = [int(r["id"]) for r in rows]
|
||||
@@ -2755,6 +2800,8 @@ class ProjectStore:
|
||||
else:
|
||||
same = [n for n, r in enumerate(rows) if r["section"] == sec]
|
||||
i = same[-1] + 1 if same else len(ids)
|
||||
if any(a < i <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀 안에 줄을 추가하려면 먼저 병합을 해제해 주세요.")
|
||||
# 새 줄 = 새 연결키(018) — 이름이 같은 다른 줄과 섞이지 않는다
|
||||
keyed = self._meeting_keys(conn)
|
||||
new_id = int(conn.execute(
|
||||
@@ -2779,7 +2826,7 @@ class ProjectStore:
|
||||
params.append(store.validate_meeting_text(fields["label"], limit=store.MEETING_LABEL_MAX, what="줄 이름"))
|
||||
if "content" in fields:
|
||||
sets.append("content = %s")
|
||||
params.append(store.validate_meeting_text(fields["content"]))
|
||||
params.append(store.validate_meeting_content(fields["content"]))
|
||||
for k in ("target_amount", "result_amount"):
|
||||
if k in fields:
|
||||
v = store.validate_meeting_amount(fields[k])
|
||||
@@ -2797,25 +2844,106 @@ class ProjectStore:
|
||||
sets.append("marketplace_code = %s")
|
||||
params.append(code)
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
if sets:
|
||||
row = conn.execute(
|
||||
f"UPDATE goal_meeting_items SET {', '.join(sets)}, updated_by = %s, updated_at = now() "
|
||||
f"WHERE id = %s RETURNING {self._MEETING_ITEM_COLS}",
|
||||
(*params, store.norm_str(updated_by, lower=True), item_id),
|
||||
).fetchone()
|
||||
else:
|
||||
row = conn.execute(
|
||||
f"SELECT {self._MEETING_ITEM_COLS} FROM goal_meeting_items WHERE id = %s", (item_id,),
|
||||
).fetchone()
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
if "content" in fields:
|
||||
self._require_meeting_cell_visible(rows, item_id)
|
||||
if sets:
|
||||
row = conn.execute(
|
||||
f"UPDATE goal_meeting_items SET {', '.join(sets)}, updated_by = %s, updated_at = now() "
|
||||
f"WHERE id = %s RETURNING {self._meeting_cols(conn)}",
|
||||
(*params, store.norm_str(updated_by, lower=True), item_id),
|
||||
).fetchone()
|
||||
else:
|
||||
row = next((r for r in rows if int(r["id"]) == item_id), None)
|
||||
if row is None:
|
||||
raise KeyError(item_id)
|
||||
return self._meeting_item(row)
|
||||
|
||||
def move_meeting_cell(self, *, source_item: Any, target_item: Any, source_body: Any,
|
||||
target_body: Any, updated_by: str = "") -> str:
|
||||
if not isinstance(source_body, str) or not isinstance(target_body, str):
|
||||
raise ValueError("원본·대상 셀의 예상 내용을 문자열로 보내 주세요.")
|
||||
try:
|
||||
source, target = int(source_item), int(target_item)
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("옮길 셀이 올바르지 않습니다.")
|
||||
if source <= 0 or target <= 0:
|
||||
raise ValueError("옮길 셀이 올바르지 않습니다.")
|
||||
expected_source = store.validate_meeting_content(source_body)
|
||||
expected_target = store.validate_meeting_content(target_body)
|
||||
if not expected_source:
|
||||
raise ValueError("비어 있는 셀은 옮길 수 없습니다.")
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
rows = self._locked_meeting_items(conn, source)
|
||||
a = self._require_meeting_cell_visible(rows, source)
|
||||
b = self._require_meeting_cell_visible(rows, target)
|
||||
body = store.validate_meeting_content(rows[a]["content"])
|
||||
old_target = store.validate_meeting_content(rows[b]["content"])
|
||||
if source == target:
|
||||
return body
|
||||
# 응답 유실 후 같은 요청 재전송은 이미 저장된 이동으로 처리한다.
|
||||
if body == "" and old_target == expected_source:
|
||||
return old_target
|
||||
if body != expected_source or old_target != expected_target:
|
||||
raise store.GoalCellConflict("다른 곳에서 셀 내용이 바뀌었습니다. 새로고침 후 다시 옮겨 주세요.")
|
||||
for item, text in ((target, body), (source, "")):
|
||||
conn.execute("UPDATE goal_meeting_items SET content = %s, updated_by = %s, updated_at = now() "
|
||||
"WHERE id = %s", (text, store.norm_str(updated_by, lower=True), item))
|
||||
return body
|
||||
|
||||
def merge_meeting_cells(self, *, item_from: Any, item_to: Any, updated_by: str = "") -> dict[str, Any]:
|
||||
try:
|
||||
first, last = int(item_from), int(item_to)
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("병합할 셀이 올바르지 않습니다.")
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
if not self._meeting_cells(conn):
|
||||
raise store.MeetingCellMigrationNeeded()
|
||||
rows = self._locked_meeting_items(conn, first)
|
||||
indices = {int(r["id"]): n for n, r in enumerate(rows)}
|
||||
if last not in indices:
|
||||
raise KeyError(last)
|
||||
a, b = sorted((indices[first], indices[last]))
|
||||
# 마지막 셀이 이미 병합된 경우 그 아래까지 선택 범위를 넓힌다.
|
||||
b += int(rows[b].get("content_row_span") or 1) - 1
|
||||
if a == b or b - a + 1 > 500 or any(r["section"] != rows[a]["section"] for r in rows[a:b + 1]):
|
||||
raise ValueError("같은 구역의 이번주 할 일 셀을 2줄 이상 선택해 주세요.")
|
||||
if any(x < a <= y or x <= b < y for x, y in self._meeting_merge_ranges(rows)):
|
||||
raise store.GoalCellConflict("병합된 셀 전체를 선택해 주세요.")
|
||||
body = store.validate_meeting_content(store.merge_goal_texts([r["content"] for r in rows[a:b + 1]]))
|
||||
who = store.norm_str(updated_by, lower=True)
|
||||
for n in range(a, b + 1):
|
||||
conn.execute("UPDATE goal_meeting_items SET content = %s, content_row_span = %s, "
|
||||
"updated_by = %s, updated_at = now() WHERE id = %s",
|
||||
(body if n == a else "", b - a + 1 if n == a else 1, who, rows[n]["id"]))
|
||||
return {"item_id": int(rows[a]["id"]), "row_span": b - a + 1, "body": body}
|
||||
|
||||
def unmerge_meeting_cell(self, *, item_id: int, updated_by: str = "") -> None:
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
if not self._meeting_cells(conn):
|
||||
raise store.MeetingCellMigrationNeeded()
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
self._require_meeting_cell_visible(rows, item_id)
|
||||
conn.execute("UPDATE goal_meeting_items SET content_row_span = 1, updated_by = %s, "
|
||||
"updated_at = now() WHERE id = %s", (store.norm_str(updated_by, lower=True), item_id))
|
||||
|
||||
def delete_meeting_item(self, *, item_id: int) -> None:
|
||||
with self._pool.connection() as conn:
|
||||
self._require_meetings(conn)
|
||||
row = conn.execute("DELETE FROM goal_meeting_items WHERE id = %s RETURNING id", (item_id,)).fetchone()
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
i = next(n for n, r in enumerate(rows) if int(r["id"]) == item_id)
|
||||
if any(a <= i <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀의 줄을 삭제하려면 먼저 병합을 해제해 주세요.")
|
||||
row = conn.execute("DELETE FROM goal_meeting_items WHERE id = %s RETURNING id", (item_id,)).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(item_id)
|
||||
|
||||
@@ -2824,20 +2952,14 @@ class ProjectStore:
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
me = conn.execute(
|
||||
"SELECT week_start, section FROM goal_meeting_items WHERE id = %s", (item_id,)
|
||||
).fetchone()
|
||||
if me is None:
|
||||
raise KeyError(item_id)
|
||||
rows = conn.execute(
|
||||
"SELECT id, section FROM goal_meeting_items WHERE week_start = %s ORDER BY sort_order, id "
|
||||
"FOR UPDATE", (me["week_start"],),
|
||||
).fetchall()
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
ids = [int(r["id"]) for r in rows]
|
||||
i = ids.index(item_id)
|
||||
j = i + (1 if direction > 0 else -1)
|
||||
if not 0 <= j < len(ids) or rows[j]["section"] != me["section"]:
|
||||
if not 0 <= j < len(ids) or rows[j]["section"] != rows[i]["section"]:
|
||||
return
|
||||
if any(a <= i <= b or a <= j <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀의 줄을 이동하려면 먼저 병합을 해제해 주세요.")
|
||||
ids[i], ids[j] = ids[j], ids[i]
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
|
||||
@@ -2598,6 +2598,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
|
||||
raise HTTPException(status_code=503, detail=_GOALS_016_MSG)
|
||||
except store.GoalMigration017Needed:
|
||||
raise HTTPException(status_code=503, detail=_GOALS_017_MSG)
|
||||
except store.MeetingCellMigrationNeeded:
|
||||
raise HTTPException(status_code=503, detail="회의록 셀 병합은 project_db 마이그레이션 019 적용 후 사용할 수 있습니다.")
|
||||
except store.GoalCellConflict as exc:
|
||||
raise HTTPException(status_code=409, detail=str(exc))
|
||||
except UndefinedTable:
|
||||
@@ -3055,6 +3057,15 @@ def _meeting_view(request: Request, st: Any, *, year: int, month: int, week: dat
|
||||
sections.append({"name": it["section"], "color": it["section_color"], "rows": []})
|
||||
sections[-1]["rows"].append(it) # 키 이름 rows — 템플릿의 sec.items 는 dict.items 메서드가 된다
|
||||
meeting["sections"] = sections
|
||||
for sec in sections:
|
||||
covered = 0
|
||||
for i, it in enumerate(sec["rows"]):
|
||||
it["content_html"] = store.goal_text_html(it["content"])
|
||||
it["content_hidden"] = covered > 0
|
||||
it["content_span"] = min(int(it.get("content_row_span") or 1), len(sec["rows"]) - i)
|
||||
covered = covered - 1 if covered else it["content_span"] - 1
|
||||
if it.get("prev"):
|
||||
it["prev"]["content_html"] = store.goal_text_html(it["prev"]["content"])
|
||||
prev_items = [it["prev"] for it in meeting["items"] if it.get("prev")]
|
||||
head["prev_items_target"] = sum(p["target_amount"] or 0 for p in prev_items) if prev_items else None
|
||||
return {"meeting": meeting, "head": head,
|
||||
@@ -3296,6 +3307,32 @@ def api_delete_meeting_item(request: Request, item_id: int) -> JSONResponse:
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-cells/move")
|
||||
def api_move_meeting_cell(request: Request, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
user = _require_admin(request)
|
||||
st = _db_or_503(request)
|
||||
if not all(k in payload for k in ("source_item", "target_item", "source_body", "target_body")):
|
||||
raise HTTPException(status_code=400, detail="원본·대상 셀과 예상 내용을 함께 보내 주세요.")
|
||||
body = _goal_call(st.move_meeting_cell, source_item=payload["source_item"], target_item=payload["target_item"],
|
||||
source_body=payload["source_body"], target_body=payload["target_body"], updated_by=user["email"])
|
||||
return JSONResponse({"ok": True, "body": body})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-cells/merge")
|
||||
def api_merge_meeting_cells(request: Request, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
user = _require_admin(request)
|
||||
result = _goal_call(_db_or_503(request).merge_meeting_cells, item_from=payload.get("item_from"),
|
||||
item_to=payload.get("item_to"), updated_by=user["email"])
|
||||
return JSONResponse({"ok": True, **result})
|
||||
|
||||
|
||||
@router.delete("/api/goals/meeting-items/{item_id}/cell-merge")
|
||||
def api_unmerge_meeting_cell(request: Request, item_id: int) -> JSONResponse:
|
||||
user = _require_admin(request)
|
||||
_goal_call(_db_or_503(request).unmerge_meeting_cell, item_id=item_id, updated_by=user["email"])
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-items/{item_id}/move")
|
||||
def api_move_meeting_item(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
_require_admin(request)
|
||||
|
||||
@@ -401,6 +401,10 @@ class GoalCellConflict(RuntimeError):
|
||||
"""셀 이동 전에 다른 창에서 원본 또는 대상 내용이 바뀜."""
|
||||
|
||||
|
||||
class MeetingCellMigrationNeeded(RuntimeError):
|
||||
"""회의록 셀 병합 메타데이터(019)가 아직 없다."""
|
||||
|
||||
|
||||
GOAL_YEAR = 0 # 업무 영역 글 칸 — 연간
|
||||
# 분기 글 칸(2026-10-01 상·하반기 → 1~4분기). 칸 번호는 예전 반기 칸을 그대로 이어 쓴다 — 데이터 옮기기 없이
|
||||
# 예전 상반기 글(13)은 1분기, 하반기 글(14)은 3분기에 보인다. 2분기(15)·4분기(16)는 마이그레이션 017 뒤에 저장.
|
||||
@@ -563,6 +567,23 @@ def merge_goal_texts(bodies: list[str]) -> str:
|
||||
return validate_goal_text(GOAL_RICH_PREFIX + json.dumps(runs, ensure_ascii=False))
|
||||
|
||||
|
||||
def validate_meeting_content(body: Any) -> str:
|
||||
"""회의록 편집기와 같은 서식 조각 합치기로 이동 예상값을 비교한다."""
|
||||
value = validate_goal_text(body)
|
||||
if not value.startswith(GOAL_RICH_PREFIX):
|
||||
return value
|
||||
runs: list[dict[str, Any]] = []
|
||||
keys = ("bold", "italic", "underline", "color", "size")
|
||||
for run in goal_text_runs(value):
|
||||
if runs and all(runs[-1].get(k) == run.get(k) for k in keys):
|
||||
runs[-1]["text"] += run["text"]
|
||||
else:
|
||||
runs.append(dict(run))
|
||||
if not any(len(run) > 1 for run in runs):
|
||||
return validate_goal_text("".join(run["text"] for run in runs))
|
||||
return GOAL_RICH_PREFIX + json.dumps(runs, ensure_ascii=False, separators=(",", ":"))
|
||||
|
||||
|
||||
# ── 엑셀식 사각형 병합(마이그레이션 015) ──────────────────────────────
|
||||
class GoalMigration015Needed(RuntimeError):
|
||||
"""세로 병합·주간 회의록은 마이그레이션 015 뒤에만 된다."""
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<div class="pj-goal-format" id="pj-goal-format" role="toolbar" aria-label="선택한 글자 서식" hidden>
|
||||
<div class="pj-goal-format-group pj-goal-color-picker">
|
||||
<button type="button" class="pj-goal-format-btn pj-goal-color-toggle" data-goal-format="color" aria-label="글자 색상" title="글자 색상" aria-expanded="false" aria-controls="pj-goal-color-grid" disabled><span class="pj-goal-color-letter" aria-hidden="true">가<span class="pj-goal-color-preview"></span></span><svg class="pj-goal-format-chevron" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.3" aria-hidden="true"><path d="m2 4 3 3 3-3"/></svg></button>
|
||||
<div class="pj-goal-color-grid" id="pj-goal-color-grid" role="group" aria-label="글자 색상 선택" hidden>
|
||||
{% for color in ('#000000', '#4B5563', '#9CA3AF', '#DC2626', '#EA580C', '#CA8A04', '#16A34A', '#0891B2', '#2563EB', '#7C3AED', '#DB2777', '#FFFFFF') %}
|
||||
<button type="button" class="pj-goal-text-swatch" data-goal-color="{{ color }}" style="--swatch: {{ color }}" title="{{ color }}" aria-label="{{ color }}" aria-pressed="false" disabled></button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="글자 크기">
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="size-up" aria-label="글자 크기 2px 키우기" title="글자 크기 2px 키우기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 9V2M2 5l3-3 3 3"/></svg></button>
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="size-down" aria-label="글자 크기 2px 줄이기" title="글자 크기 2px 줄이기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 2v7M2 6l3 3 3-3"/></svg></button>
|
||||
<output class="pj-goal-size-value" data-goal-format="size" aria-label="선택한 글자 크기">14px</output>
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="글자 모양">
|
||||
{% for key, label in (('bold', '굵게'), ('italic', '기울임'), ('underline', '밑줄')) %}
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="{{ key }}" aria-label="{{ label }}" title="{{ label }}" aria-pressed="false" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span></button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="서식 초기화">
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="reset" aria-label="서식 초기화" title="서식 초기화" disabled><svg class="pj-goal-reset-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m16 3 5 5a2 2 0 0 1 0 3L11 21H7l-4-4a2 2 0 0 1 0-3L13 3a2 2 0 0 1 3 0Z"/><path d="m8 9 7 7M11 21h10"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261003i" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261003j" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if is_admin and meeting %}{% include "project/_cell_format.html" %}{% endif %}
|
||||
<div class="pj-view pj-meet-pane" id="pj-meet-pane" data-week="{{ week }}" data-year="{{ goal_year }}"
|
||||
data-month="{{ goal_month }}" data-admin="{{ 'true' if is_admin else 'false' }}">
|
||||
|
||||
@@ -188,12 +189,12 @@
|
||||
</div>
|
||||
|
||||
{# ── 구역별 줄 — 왼쪽: 이번주 / 오른쪽: 전주 리뷰(지난 회의록 같은 줄) ── #}
|
||||
<table class="pj-meet-table" id="pj-meet-table">
|
||||
<table class="pj-meet-table" id="pj-meet-table" data-cell-merges="{{ 'true' if meeting.cell_merges else 'false' }}">
|
||||
{# table-layout: fixed 는 첫 줄(묶음 머리, colspan)로 너비를 정하므로 열 너비는 colgroup 으로 #}
|
||||
<colgroup>
|
||||
{# is-this / is-prev — 순서 바꾸기(project.js initMeetOrder)가 이 묶음으로 열을 옮긴다 #}
|
||||
<col class="pj-meet-w-sec" /><col class="pj-meet-w-label" /><col class="is-this" /><col class="pj-meet-w-amt is-this" />
|
||||
<col class="is-prev" /><col class="pj-meet-w-amt is-prev" /><col class="pj-meet-w-amt is-prev" /><col class="pj-meet-w-rate is-prev" /><col class="pj-meet-w-eval is-prev" />
|
||||
<col class="pj-meet-w-sec" data-meet-col="section" /><col class="pj-meet-w-label" data-meet-col="label" /><col class="is-this" data-meet-col="content" /><col class="pj-meet-w-amt is-this" data-meet-col="target" />
|
||||
<col class="is-prev" data-meet-col="prev_content" /><col class="pj-meet-w-amt is-prev" data-meet-col="prev_target" /><col class="pj-meet-w-amt is-prev" data-meet-col="result" /><col class="pj-meet-w-rate is-prev" data-meet-col="rate" /><col class="pj-meet-w-eval is-prev" data-meet-col="evaluation" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="pj-meet-group">
|
||||
@@ -235,10 +236,12 @@
|
||||
</span>
|
||||
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more" data-meet-act="menu" title="줄 메뉴"><span class="material-symbols-outlined">more_horiz</span></button>{% endif %}
|
||||
</th>
|
||||
<td class="pj-meet-c-text">
|
||||
{% if edit %}<textarea class="pj-meet-text" rows="1" data-field="content" placeholder="이번주 할 일·행사">{{ it.content }}</textarea>
|
||||
{% else %}<div class="pj-meet-ro">{{ it.content }}</div>{% endif %}
|
||||
{% if not it.content_hidden %}
|
||||
<td class="pj-meet-c-text" rowspan="{{ it.content_span or 1 }}" data-meet-item="{{ it.id }}">
|
||||
{% if edit %}<div class="pj-meet-text pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="{{ it.label }} 이번주 할 일·행사" data-field="content" data-placeholder="이번주 할 일·행사">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>
|
||||
{% else %}<div class="pj-meet-ro">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="pj-meet-c-amt">
|
||||
{% if edit %}<input type="text" class="pj-meet-amount" data-field="target_amount" inputmode="decimal" autocomplete="off" value="{{ won(it.target_amount) }}" />
|
||||
{% else %}{{ won(it.target_amount) }}{% endif %}
|
||||
@@ -246,7 +249,7 @@
|
||||
<span class="pj-meet-week-slot" data-auto="{{ it.week_auto if it.week_auto is not none else '' }}"{% if it.week_error %} data-err="1"{% endif %} data-name="{{ it.market_name }}">{% if it.week_auto is not none %}<span class="pj-meet-week-auto" title="실적 모듈 {{ it.market_name }} 이번 주({{ week[5:] | replace('-', '/') }}~ 오늘까지) 매출">이번주 실적 {{ won(it.week_auto) }}{% if it.target_amount %} · {{ "%.0f" | format(it.week_auto / it.target_amount * 100) }}%{% endif %}</span>{% elif it.week_error %}<span class="pj-meet-week-auto is-unknown" title="실적 조회 실패">이번주 실적 미확인</span>{% endif %}</span>
|
||||
</td>
|
||||
{% if p %}
|
||||
<td class="pj-meet-c-text is-prev"><div class="pj-meet-ro">{{ p.content }}</div></td>
|
||||
<td class="pj-meet-c-text is-prev"><div class="pj-meet-ro">{% if p.content_html is defined %}{{ p.content_html | safe }}{% else %}{{ p.content }}{% endif %}</div></td>
|
||||
<td class="pj-meet-c-amt is-prev">{{ won(p.target_amount) }}</td>
|
||||
<td class="pj-meet-c-amt is-prev pj-meet-c-result">
|
||||
{% if p.not_started %}
|
||||
@@ -274,6 +277,11 @@
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% if edit %}<p class="pj-goal-note">글자를 선택하면 색상·크기·굵게·기울임·밑줄·서식 초기화를 사용할 수 있습니다.
|
||||
셀 오른쪽 경계는 너비 조절·더블클릭 자동 맞춤, 우클릭은 현재/전체 열 자동 맞춤입니다.
|
||||
이번주 할 일 셀의 위·아래·왼쪽 테두리를 끌면 내용과 서식을 옮깁니다.
|
||||
같은 구역에서 끌기·Shift+클릭으로 범위를 선택한 뒤 Del로 지우고 Ctrl+Z로 되돌립니다.
|
||||
{% if meeting.cell_merges %}우클릭으로 세로 셀 병합·병합 해제를 사용할 수 있습니다.{% endif %}</p>{% endif %}
|
||||
{% if edit %}
|
||||
<div class="pj-goal-foot">
|
||||
<button type="button" class="pj-btn" id="pj-meet-sec-new">+ 구역 추가</button>
|
||||
@@ -298,5 +306,7 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261003h" defer></script>
|
||||
<script src="/static/project-goal-text.js?v=20261003c" defer></script>
|
||||
<script src="/static/project-meeting-cells.js?v=20261003a" defer></script>
|
||||
<script src="/static/project.js?v=20261003j" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -38,29 +38,7 @@
|
||||
</div>
|
||||
|
||||
{% if is_admin and goals_enabled and board %}
|
||||
<div class="pj-goal-format" id="pj-goal-format" role="toolbar" aria-label="선택한 글자 서식" hidden>
|
||||
<div class="pj-goal-format-group pj-goal-color-picker">
|
||||
<button type="button" class="pj-goal-format-btn pj-goal-color-toggle" data-goal-format="color" aria-label="글자 색상" title="글자 색상" aria-expanded="false" aria-controls="pj-goal-color-grid" disabled><span class="pj-goal-color-letter" aria-hidden="true">가<span class="pj-goal-color-preview"></span></span><svg class="pj-goal-format-chevron" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.3" aria-hidden="true"><path d="m2 4 3 3 3-3"/></svg></button>
|
||||
<div class="pj-goal-color-grid" id="pj-goal-color-grid" role="group" aria-label="글자 색상 선택" hidden>
|
||||
{% for color in ('#000000', '#4B5563', '#9CA3AF', '#DC2626', '#EA580C', '#CA8A04', '#16A34A', '#0891B2', '#2563EB', '#7C3AED', '#DB2777', '#FFFFFF') %}
|
||||
<button type="button" class="pj-goal-text-swatch" data-goal-color="{{ color }}" style="--swatch: {{ color }}" title="{{ color }}" aria-label="{{ color }}" aria-pressed="false" disabled></button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="글자 크기">
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="size-up" aria-label="글자 크기 2px 키우기" title="글자 크기 2px 키우기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 9V2M2 5l3-3 3 3"/></svg></button>
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="size-down" aria-label="글자 크기 2px 줄이기" title="글자 크기 2px 줄이기" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span><svg class="pj-goal-font-arrow" viewBox="0 0 10 14" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M5 2v7M2 6l3 3 3-3"/></svg></button>
|
||||
<output class="pj-goal-size-value" data-goal-format="size" aria-label="선택한 글자 크기">14px</output>
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="글자 모양">
|
||||
{% for key, label in (('bold', '굵게'), ('italic', '기울임'), ('underline', '밑줄')) %}
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="{{ key }}" aria-label="{{ label }}" title="{{ label }}" aria-pressed="false" disabled><span class="pj-goal-font-letter" aria-hidden="true">가</span></button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="pj-goal-format-group" role="group" aria-label="서식 초기화">
|
||||
<button type="button" class="pj-goal-format-btn" data-goal-format="reset" aria-label="서식 초기화" title="서식 초기화" disabled><svg class="pj-goal-reset-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m16 3 5 5a2 2 0 0 1 0 3L11 21H7l-4-4a2 2 0 0 1 0-3L13 3a2 2 0 0 1 3 0Z"/><path d="m8 9 7 7M11 21h10"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
{% include "project/_cell_format.html" %}
|
||||
{% endif %}
|
||||
<div class="pj-view pj-goal-pane" id="pj-goal-pane">
|
||||
{% if not goals_enabled %}
|
||||
|
||||
@@ -611,6 +611,15 @@
|
||||
</ol>
|
||||
<p>금액은 <code>1,200,000</code>·<code>120만</code>·<code>1.5억</code>·<code>3천만</code>·<code>1억2천만</code>처럼 입력할 수 있습니다. <kbd>Enter</kbd> 또는 칸을 떠날 때 원 단위로 저장되고, 빈칸은 값을 지웁니다. 글·메모는 입력을 약 0.8초 멈추거나 칸을 떠날 때, 참석자·평가는 바꾸는 즉시 저장됩니다.</p>
|
||||
|
||||
<p>이번주 할 일 셀에서는 목표 표의 셀 편집 도구를 함께 사용할 수 있습니다.</p>
|
||||
<ul>
|
||||
<li><b>글자 서식</b> — 글자 일부를 선택하고 위쪽 도구에서 색·크기·굵게·기울임·밑줄을 바꿉니다. 초기화 버튼은 선택한 글자의 서식을 지웁니다.</li>
|
||||
<li><b>열 너비</b> — 오른쪽 경계를 끌어 조절합니다. 경계를 더블클릭하거나 우클릭 메뉴에서 현재 열·전체 열 너비를 내용에 맞춥니다. 너비는 이 브라우저에 기억됩니다.</li>
|
||||
<li><b>범위 선택·지우기</b> — 같은 구역의 이번주 글 셀을 드래그하거나 첫 셀을 누른 뒤 <kbd>Shift</kbd>+클릭으로 선택합니다. 우클릭의 내용 지우기 또는 <kbd>Delete</kbd>로 지우고, <kbd>Ctrl</kbd>+<kbd>Z</kbd>로 되돌립니다.</li>
|
||||
<li><b>내용 이동</b> — 셀 테두리를 다른 이번주 글 셀로 끌면 내용과 서식이 함께 이동합니다. 대상에 글이 있으면 덮어쓰기를 확인합니다. 이동 중에는 두 셀의 저장을 기다립니다.</li>
|
||||
<li><b>병합·해제</b> — 같은 구역의 글 셀을 여러 줄 선택하고 우클릭의 셀 병합을 누릅니다. 해제해도 합친 글은 첫 셀에 남습니다. 병합된 줄을 이동·삭제하거나 그 사이에 줄을 추가하려면 먼저 병합을 해제하세요.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="meetings-review">지난주 리뷰·결과·평가</h3>
|
||||
<p>지난주 할 일과 목표는 <b>정확히 7일 전 주의 같은 항목</b>에서 가져옵니다. 이름 변경·순서 이동·회의록 생성 순서와 관계없이 이어진 같은 줄을 찾습니다. 그 주 회의록이 없으면 “회의록 없음”, 회의록은 있지만 항목이 없으면 “지난주 회의록에 없는 줄”로 표시합니다. 몇 주 전 기록을 지난주로 대신 보여 주지 않습니다.</p>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user