diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html index c4c0813..0e9a041 100644 --- a/app/modules/cupang/templates/cupang/index.html +++ b/app/modules/cupang/templates/cupang/index.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + @@ -249,7 +249,7 @@ {% endblock %} {% block scripts %} - + {% endblock %} @@ -64,7 +64,7 @@ - + {% endif %} {% endblock %} diff --git a/app/modules/performance/CLAUDE.md b/app/modules/performance/CLAUDE.md index a2c2f7c..8713c5e 100644 --- a/app/modules/performance/CLAUDE.md +++ b/app/modules/performance/CLAUDE.md @@ -44,6 +44,11 @@ 서버가 계산(원 반올림)해 금액으로, 식은 `formula` 열에 저장 → 칸 `is-formula` 파랑 굵은 숫자, 다시 누르면 식. 숫자 입력·업로드·광고 API 로 덮으면 식 지움(`db._set_formulas`, 008 미적용이면 조용히 건너뜀). 광고비 탭 직접 입력값은 파랑 **보통 굵기**(굵게는 계산식만), 매출 탭 수동 입력값은 예전처럼 파랑 굵게. - 일자별 표 **기간 합계 행은 맨 위**(제목 행 바로 아래, 2026-10-21 `calc.main_table`) — 매출·광고비 공통, 연간 보기 "연간 합계"는 그대로 맨 아래. +- **기간 빠른 선택 = 이번달·올해·직접선택**(2026-10-26 — 오늘·이번주 버튼 삭제, `dashboard.build_dashboard`·`ad_spend.build_ad_dashboard` 의 `nav.quick`), + 매출 실적 기본 기간도 **이번달**(`router.dashboard_page` `period="month"`, 광고비는 원래 이번달). day·week 주소(`?period=week`)는 그대로 열린다. +- **일자별 표 스크롤 고정**(2026-10-26, `.perf-main-wrap`) — 표 상자를 화면 높이(`100vh − 상단 바 − 24px`)로 묶어 상자 안에서 세로 스크롤, + 제목 행 + 맨 위 기간 합계 행(`tbody tr.perf-row-total:first-child`)이 sticky. 합계 행 top = 제목 행 높이(`--perf-head-h`, `performance.js stickyHead` + 가 ResizeObserver 로 잼). 상자가 가로 스크롤이라 페이지 스크롤 기준 sticky 는 안 먹어서 상자 안 스크롤로 했다. 테스트 `tests/js/perf_sticky.browser.test.js`. - 열 순서 카페24·네이버·쿠팡(윙)·쿠팡(로켓)·오늘의집·G마켓·카카오·GS샵·11번가·롯데ON·토스·애터미아자몰(마이그레이션 003). - 쿠팡(로켓)·애터미아자몰은 **수동 입력 전용**(`adapters/manual.py`, `manual_only` — 매출 업데이트에서 빠지고 인증 설정·연결 테스트 없음, 수동 입력 늘 켜짐). - **직접 추가 쇼핑몰·그룹·순서 드래그**(2026-10-22, 마이그레이션 009 `is_custom`·`is_group`·`parent_code`) — 설정 [+ 쇼핑몰 추가(수동 입력)] diff --git a/app/modules/performance/ad_spend.py b/app/modules/performance/ad_spend.py index a57785f..22b984d 100644 --- a/app/modules/performance/ad_spend.py +++ b/app/modules/performance/ad_spend.py @@ -553,9 +553,8 @@ def build_ad_dashboard(store: Any, *, kind: str, anchor: date, today: date, next_url = url("custom", start=period.end + timedelta(days=1), end=period.end + length) else: prev_url, next_url = url(period.kind, period.prev_anchor), url(period.kind, period.next_anchor) + # 빠른 선택은 이번달·올해만(2026-10-26 — 오늘·이번주 버튼 삭제, 매출 실적과 같게) nav = {"prev": prev_url, "next": next_url, "quick": [ - {"label": "오늘", "url": url("day", today), "active": period.kind == "day" and period.start == today}, - {"label": "이번주", "url": url("week", today), "active": period.kind == "week" and period.start <= today <= period.end}, {"label": "이번달", "url": url("month", today), "active": period.kind == "month" and period.start <= today <= period.end}, {"label": "올해", "url": url("year", today), "active": period.kind == "year" and period.start <= today <= period.end}, ]} diff --git a/app/modules/performance/dashboard.py b/app/modules/performance/dashboard.py index 418cb38..ed06300 100644 --- a/app/modules/performance/dashboard.py +++ b/app/modules/performance/dashboard.py @@ -249,11 +249,8 @@ def build_dashboard(store: Any, *, kind: str, anchor: date, today: date, next_url = url(period.kind, period.next_anchor) nav = { "prev": prev_url, "next": next_url, + # 빠른 선택은 이번달·올해만(2026-10-26 — 오늘·이번주 버튼 삭제, 기본 = 이번달) "quick": [ - {"key": "day", "label": "오늘", "url": url("day", today), - "active": period.kind == "day" and period.start == today}, - {"key": "week", "label": "이번주", "url": url("week", today), - "active": period.kind == "week" and period.start <= today <= period.end}, {"key": "month", "label": "이번달", "url": url("month", today), "active": period.kind == "month" and period.start <= today <= period.end}, {"key": "year", "label": "올해", "url": url("year", today), diff --git a/app/modules/performance/router.py b/app/modules/performance/router.py index 60aa8d9..dab4a4c 100644 --- a/app/modules/performance/router.py +++ b/app/modules/performance/router.py @@ -121,7 +121,7 @@ def health(request: Request) -> JSONResponse: @router.get("/", response_class=HTMLResponse) def dashboard_page( request: Request, - period: str = "week", + period: str = "month", d: str | None = None, from_: str | None = Query(None, alias="from"), to: str | None = None, diff --git a/app/modules/performance/templates/performance/ads.html b/app/modules/performance/templates/performance/ads.html index 4a06b66..0d5a683 100644 --- a/app/modules/performance/templates/performance/ads.html +++ b/app/modules/performance/templates/performance/ads.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {#- ROAS 덧붙임 — "광고비(ROAS%)". 광고비가 없으면 아무것도 안 붙는다. -#} {%- macro roas(p) -%}{%- if p is not none -%}({{ "{:,}".format(p) }}%){%- endif -%}{%- endmacro -%} @@ -96,7 +96,8 @@ {% endif %} -
+
+ {#- perf-main-wrap(2026-10-26) = 표 안에서 세로 스크롤 — 제목 행·기간 합계 행 고정 -#} {#- perf-autofit(2026-10-22) = 열 너비는 내용 길이만큼, 날짜 열은 가로 스크롤해도 고정(매출 실적 표와 같음) -#} @@ -240,4 +241,4 @@ } | tojson }} {% endblock %} -{% block scripts %}{% endblock %} +{% block scripts %}{% endblock %} diff --git a/app/modules/performance/templates/performance/index.html b/app/modules/performance/templates/performance/index.html index c243a41..ff75f70 100644 --- a/app/modules/performance/templates/performance/index.html +++ b/app/modules/performance/templates/performance/index.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {%- macro won(v) -%} {%- if v is none -%} @@ -134,7 +134,8 @@ -
+
+ {#- perf-main-wrap(2026-10-26) = 표 안에서 세로 스크롤 — 제목 행·기간 합계 행 고정 -#} {#- perf-autofit(2026-10-22) = 열 너비는 내용 길이만큼, 날짜 열은 가로 스크롤해도 고정 -#}
@@ -291,4 +292,4 @@ } | tojson }} {% endblock %} -{% block scripts %}{% endblock %} +{% block scripts %}{% endblock %} diff --git a/app/modules/performance/templates/performance/settings.html b/app/modules/performance/templates/performance/settings.html index 3dc75c4..a426db6 100644 --- a/app/modules/performance/templates/performance/settings.html +++ b/app/modules/performance/templates/performance/settings.html @@ -1,6 +1,6 @@ {% extends "erp_base.html" %} -{% block head_extra %}{% endblock %} +{% block head_extra %}{% endblock %} {%- macro when(v) -%}{{ (v or '')[:16] | replace('T', ' ') or '—' }}{%- endmacro -%} @@ -259,4 +259,4 @@ {% endblock %} -{% block scripts %}{% endblock %} +{% block scripts %}{% endblock %} diff --git a/app/modules/performance/tests/test_ad_spend.py b/app/modules/performance/tests/test_ad_spend.py index 6416f01..2c2c38f 100644 --- a/app/modules/performance/tests/test_ad_spend.py +++ b/app/modules/performance/tests/test_ad_spend.py @@ -146,7 +146,7 @@ def test_ad_dashboard_month(): assert ctx["roas_basis"]["google"] == "" and ctx["roas_basis"]["coupang_wing"] == "쿠팡(윙)" assert {r["code"]: r for r in ctx["month"]["rows"]}["google"]["roas"] is None assert ads.roas(1, 3) == 33 and ads.roas(1, 200) == 1 and ads.roas(5, 0) is None # 0.5% 반올림 → 1 - assert ctx["nav"]["quick"][2]["active"] # 이번달 + assert ctx["nav"]["quick"][0]["active"] # 이번달 def test_ad_dashboard_year_and_missing_table(): diff --git a/app/modules/project/CLAUDE.md b/app/modules/project/CLAUDE.md index 1c86560..15e8f5b 100644 --- a/app/modules/project/CLAUDE.md +++ b/app/modules/project/CLAUDE.md @@ -54,6 +54,9 @@ - 담당자별 패널 날짜 mm/dd(요일)·지난 마감 빨강(6-20). - 패널(`/project/p/{pid}?task=&embed=1`, `html.pj-embed`). - **업무를 다른 프로젝트로 이동** — 보드 카드를 왼쪽 프로젝트 목록에 끌어 놓으면 섹션 선택 창 → `POST /project/api/tasks/{id}/move-project`(세부 업무 함께, 원 소속 권한 + 대상 프로젝트 멤버)(6-18). +- **섹션째 다른 프로젝트로**(2026-10-26, 6-26) — 보드 섹션 머리(`STAGE_DRAG_TYPE` = `application/x-pj-stage`)를 왼쪽 프로젝트 줄에 놓으면 확인 창 → + `POST /project/api/stages/{id}/move-project {project_id}`(`db.move_stage_to_project` 한 트랜잭션 — 섹션 + 업무 + 세부 업무, 섹션은 대상 맨 끝, 담당자·완료 그대로, + 원·대상 두 프로젝트 멤버). 다른 프로젝트 업무가 이 섹션에 연결된 것은 원 프로젝트에 "섹션 없음"으로 남긴다(연결을 옮기면 새 멤버에게 보이게 되므로). ## 업무 창 / 댓글 / 협업자 @@ -131,9 +134,13 @@ 3. "N주차 작업 등록" 표(제목·담당자·프로젝트·섹션 → [적용] = 서버가 그 프로젝트에 작업 생성, `initMeetQuickTasks`). 주차별 서버 표 `goal_meeting_tasks`(마이그레이션 025)라 모두가 같이 보고, 남의 프로젝트 이름은 가림, 완료 프로젝트·섹션은 목록에서 뺌. 작업 칸(마이그레이션 026 `parent_task_id`) = 이미 있는 작업을 고르면 그 작업의 세부 작업으로 등록. - 등록된 줄 제목 = 오른쪽 작업 창(편집, 저장 대기), [크게 열기] = 같은 표를 넓은 창으로. + 등록된 줄 = 줄 어디든 누르면 오른쪽 작업 창(편집, 저장 대기 — 2026-10-26 예전엔 제목만), 세부 업무 줄의 "↳ 상위" = 상위 업무 창, [크게 열기] = 같은 표를 넓은 창으로. + **하위 업무 등록**(2026-10-26, 6-26) — 등록된 줄 [+](`data-quick="add-sub"`) = 바로 아래 세부 업무 초안(프로젝트·`parent_task_id` = 그 업무, 제목을 치면 POST), + 세부 업무 줄은 상위 줄 아래 들여쓰기(`displayOrder`, 서버 순서·DB 변경 없음). 예전 [2g4] "↳(줄 세부 작업)" 버튼은 표 줄끼리 묶던 다른 기능(025 parent_id). - 실적 모듈 `performance_store` 매출은 머리 카드에만 읽기 전용 — 줄(쇼핑몰)별 자동 결과·이번주 실적·연결 배지·쇼핑몰 연결 메뉴는 폐지, 지난주 결과는 늘 직접 입력. - "주요 업무" 칸 우클릭 위/아래 줄 추가 = 항목 칸은 그대로 그 항목 안에(마이그레이션 027 `label_cont`, 항목 칸 나누기). +- **글 칸 하이퍼링크**(2026-10-26, 6-26) — 목표·회의록 서식 도구(`_cell_format.html`) 🔗 = 선택 글자에 주소(pj-rich 조각 `link`, http(s)만 — 서버 `store.goal_link`, + 화면 `project-goal-text.js safeLink`), 주소만 붙여 넣기 = 링크, 편집 칸 링크는 Ctrl+클릭으로 새 탭, 읽기 전용 칸은 `goal_text_html` 의 `a.pj-goal-link`(새 탭). - 회의록 줄 작업은 새로고침 없이 제자리 다시 그리기(`refreshMeeting`) + 애니메이션. - 구분(구역) 칸 우클릭·⋯ = 구역 통째로 위/아래(`move-section`). - 항목 칸 끌어 옮기기(2026-10-19) — 마우스로 항목 칸을 5px 이상 끌면 묶음(label_cont 줄 + 걸친 세로 병합)이 같은 구역 안에서 실시간 이동(칸 단위 FLIP, 구분 칸은 늘 첫 줄), 놓으면 `POST meeting-items/{id}/move-to {before_item_id|null}`(`db.move_meeting_group`, 묶음 사이·다른 구역은 거절) → `refreshMeeting`. Esc 취소, 짧게 누르기는 이름 수정. diff --git a/app/modules/project/db.py b/app/modules/project/db.py index a785f1f..c00603f 100644 --- a/app/modules/project/db.py +++ b/app/modules/project/db.py @@ -1067,6 +1067,78 @@ class ProjectStore: out["_newly_completed"] = newly_completed return out + def move_stage_to_project(self, *, stage_id: int, project_id: int, actor: str = "") -> dict[str, Any]: + """섹션을 통째로 다른 프로젝트로 옮긴다(2026-10-26) — 섹션 + 그 섹션 업무 + 세부 업무(모든 단계). 한 트랜잭션. + + · 섹션은 대상 프로젝트 섹션 목록 맨 끝. 이름·색·완료 섹션·기본 담당자는 그대로(업무 담당자·완료 상태도 그대로). + · 옮긴 업무의 대상 프로젝트 연결(멀티호밍)은 이제 원 소속이라 지운다(다른 연결은 그대로). + · 다른 프로젝트 업무가 이 섹션에 연결돼 있던 것(원 프로젝트 쪽 연결)은 원 프로젝트에 "섹션 없음"으로 남긴다 + — 연결을 대상 프로젝트로 옮기면 그 업무가 새 프로젝트 멤버에게 보이게 되므로. + · 활동 이력·알림·회의록 업무 등록 줄의 프로젝트도 따라 바꾼다. + 반환: 옮긴 섹션(get_stage) + `_moved_task_ids`(메인 업무)·`_moved_ids`(세부 포함). + """ + with self._pool.connection() as conn: + with conn.transaction(): + stage = conn.execute( + "SELECT * FROM project_stages WHERE id = %s FOR UPDATE", (stage_id,)).fetchone() + if stage is None: + raise KeyError(f"섹션을 찾을 수 없습니다: {stage_id}") + source = int(stage["project_id"]) + target = int(project_id) + if source == target: + raise ValueError("이미 이 프로젝트의 섹션입니다.") + if not conn.execute("SELECT 1 FROM projects WHERE id = %s", (target,)).fetchone(): + raise KeyError(f"프로젝트를 찾을 수 없습니다: {target}") + tops = [int(r["id"]) for r in conn.execute( + "SELECT id FROM tasks WHERE stage_id = %s AND project_id = %s AND parent_task_id IS NULL " + "ORDER BY sort_order, id FOR UPDATE", + (stage_id, source), + ).fetchall()] + ids = [int(r["id"]) for r in conn.execute( + "WITH RECURSIVE tree AS (SELECT id FROM tasks WHERE id = ANY(%s) " + "UNION ALL SELECT t.id FROM tasks t JOIN tree ON t.parent_task_id = tree.id) " + "SELECT id FROM tree", + (tops,), + ).fetchall()] if tops else [] + nxt = conn.execute( + "SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM project_stages WHERE project_id = %s", + (target,), + ).fetchone() + conn.execute("UPDATE project_stages SET project_id = %s, sort_order = %s WHERE id = %s", + (target, int(nxt["n"]), stage_id)) + if ids: + conn.execute("UPDATE tasks SET project_id = %s WHERE id = ANY(%s)", (target, ids)) + conn.execute( + "DELETE FROM task_project_links WHERE task_id = ANY(%s) AND project_id = %s", (ids, target)) + conn.execute("UPDATE project_activity SET project_id = %s WHERE task_id = ANY(%s)", (target, ids)) + conn.execute( + "UPDATE project_notifications SET project_id = %s WHERE task_id = ANY(%s)", (target, ids)) + conn.execute( + "UPDATE task_project_links SET stage_id = NULL WHERE stage_id = %s AND project_id <> %s", + (stage_id, target)) + if self._table_exists(conn, "goal_meeting_tasks"): + conn.execute( + "UPDATE goal_meeting_tasks SET project_id = %s WHERE stage_id = %s OR task_id = ANY(%s)", + (target, stage_id, ids)) + old_name = conn.execute("SELECT name FROM projects WHERE id = %s", (source,)).fetchone() + new_name = conn.execute("SELECT name FROM projects WHERE id = %s", (target,)).fetchone() + route = f"{(old_name or {}).get('name', '')} → {(new_name or {}).get('name', '')}" + titles = {int(r["id"]): r["title"] for r in conn.execute( + "SELECT id, title FROM tasks WHERE id = ANY(%s)", (tops,)).fetchall()} if tops else {} + for tid in tops: + self._log(conn, project_id=target, task_id=tid, actor=actor, + action=store.ACTION_PROJECT_MOVED, + detail=f"{titles.get(tid, '')}: {route} (섹션 {stage['name']} 이동)") + if not tops: + self._log(conn, project_id=target, actor=actor, action=store.ACTION_PROJECT_MOVED, + detail=f"섹션 {stage['name']}: {route}") + out = self.get_stage(stage_id=stage_id) + if out is None: + raise KeyError(stage_id) + out["_moved_task_ids"] = tops + out["_moved_ids"] = ids + return out + # ════════════════════════════════════════════════════════════ # 휴지통 (마이그레이션 010) — 지우기 직전 스냅샷, 관리자 복구, 3개월 보관 # ════════════════════════════════════════════════════════════ diff --git a/app/modules/project/router.py b/app/modules/project/router.py index 2b64666..2be1a15 100644 --- a/app/modules/project/router.py +++ b/app/modules/project/router.py @@ -1890,6 +1890,48 @@ def api_move_task_project( return JSONResponse({"task": task, "unseen": unseen}) +@router.post("/api/stages/{stage_id}/move-project") +def api_move_stage_project( + request: Request, + stage_id: int, + bg: BackgroundTasks, + payload: dict[str, Any] = Body(...), +) -> JSONResponse: + """섹션을 통째로 다른 프로젝트로 옮긴다(2026-10-26) — 보드 섹션 머리를 왼쪽 프로젝트 목록으로 드래그 → 확인 창. + + body: {"project_id": 대상}. 원 프로젝트 멤버 + 대상 프로젝트 멤버여야 한다. 섹션의 업무·세부 업무가 함께 옮겨지고 + 섹션은 대상 프로젝트 섹션 맨 끝. 응답의 `unseen` = 대상 프로젝트를 볼 수 없는 담당자(화면이 안내 — 담당자는 그대로). + """ + user = _require_user(request) + st = _db_or_503(request) + stage = st.get_stage(stage_id=stage_id) + if stage is None: + raise HTTPException(status_code=404, detail="섹션을 찾을 수 없습니다.") + _require_manage(request, st, user, int(stage["project_id"])) + try: + target = int(payload.get("project_id")) + except (TypeError, ValueError): + raise HTTPException(status_code=400, detail="옮길 프로젝트(project_id)가 필요합니다.") + _require_manage(request, st, user, target) + try: + moved = st.move_stage_to_project(stage_id=stage_id, project_id=target, actor=user["email"]) + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) + except KeyError as exc: + raise HTTPException(status_code=404, detail=str(exc)) + tops = moved.pop("_moved_task_ids", []) + moved.pop("_moved_ids", None) + for tid in tops: # 세부 업무까지 드라이브 파일도 새 프로젝트 폴더로(백그라운드) + bg.add_task(_relocate_drive_files, st, tid) + unseen: set[str] = set() + for tid in tops: + task = st.get_task(task_id=tid) + email = (task or {}).get("assignee_email") or "" + if email and not access.filter_recipients(st, task, [email]): + unseen.add(store.norm_str(email, lower=True)) + return JSONResponse({"stage": moved, "task_count": len(tops), "unseen": sorted(unseen)}) + + # ──────────────────────────────────────────────────────────── # JSON API — 팔로워 (아사나의 협업자) # ──────────────────────────────────────────────────────────── diff --git a/app/modules/project/store.py b/app/modules/project/store.py index 3b977bd..a8727c1 100644 --- a/app/modules/project/store.py +++ b/app/modules/project/store.py @@ -585,6 +585,13 @@ def validate_goal_text(body: Any) -> str: # 기존 TEXT 칸에 버전이 있는 텍스트 조각을 저장한다. 예전 평문은 그대로 유지한다. GOAL_RICH_PREFIX = "pj-rich:v1:" +# 조각 하이퍼링크(2026-10-26, `link`) — http(s) 주소만, 공백·따옴표·꺾쇠 없는 2,000자까지(그 밖은 조용히 버림). +GOAL_LINK_RE = re.compile(r"https?://[^\s\"'<>]{1,2000}", re.IGNORECASE) + + +def goal_link(value: Any) -> str: + v = str(value or "").strip() + return v if len(v) <= 2000 and GOAL_LINK_RE.fullmatch(v) else "" def goal_text_runs(body: Any, *, strict: bool = False) -> list[dict[str, Any]]: @@ -608,6 +615,9 @@ def goal_text_runs(body: Any, *, strict: bool = False) -> list[dict[str, Any]]: size = item.get("size") if isinstance(size, int) and not isinstance(size, bool) and 10 <= size <= 32: run["size"] = size + link = goal_link(item.get("link")) + if link: + run["link"] = link if run["text"]: runs.append(run) if sum(len(r["text"]) for r in runs) > GOAL_TEXT_MAX: @@ -640,7 +650,11 @@ def goal_text_html(body: Any, *, include_size: bool = True) -> str: if include_size and "size" in run: style.append(f'font-size:{run["size"]}px') text = escape(run["text"]) - out.append(f'{text}' if style else text) + piece = f'{text}' if style else text + if run.get("link"): + piece = (f'{piece}') + out.append(piece) return "".join(out) @@ -662,7 +676,7 @@ def validate_meeting_content(body: Any) -> str: if not value.startswith(GOAL_RICH_PREFIX): return value runs: list[dict[str, Any]] = [] - keys = ("bold", "italic", "underline", "color", "size") + keys = ("bold", "italic", "underline", "color", "size", "link") 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"] diff --git a/app/modules/project/templates/project/_cell_format.html b/app/modules/project/templates/project/_cell_format.html index e7baeab..ee753a9 100644 --- a/app/modules/project/templates/project/_cell_format.html +++ b/app/modules/project/templates/project/_cell_format.html @@ -17,6 +17,15 @@ {% endfor %} + {#- 하이퍼링크(2026-10-26) — 선택한 글자에 주소 걸기·빼기(project-goal-text.js), 칸 안 링크는 Ctrl+클릭으로 열기 -#} +
diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index dfd4d43..afa5d6d 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -287,7 +287,7 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index e5ca09d..5364f22 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -206,6 +206,6 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - - + + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 26afd04..7f80f95 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -259,6 +259,7 @@
  • 섹션 추가 — 마지막 섹션 바로 오른쪽의 + 섹션 추가.
  • 이름 바꾸기 — 섹션 이름을 누르면 그 자리에서 고칩니다. Enter 저장, Esc 취소.
  • 순서 바꾸기 — 섹션 머리(이름 줄)를 잡고 좌우로 끌어 놓습니다.
  • +
  • 섹션째 다른 프로젝트로 — 섹션 머리를 잡고 왼쪽 프로젝트 목록의 프로젝트 줄에 놓으면(줄이 보라색으로 강조) 확인 창이 뜨고, 이동을 누르면 그 섹션과 섹션 안 업무·세부 업무가 모두 그 프로젝트로 옮겨집니다(섹션은 그 프로젝트 맨 끝, 담당자·완료 상태는 그대로). 두 프로젝트 모두 내가 멤버여야 합니다. 다른 프로젝트에서 이 섹션에 연결해 온 업무는 원래 프로젝트에 “섹션 없음”으로 남습니다.
  • … 메뉴(머리 오른쪽 … 또는 머리 우클릭):
    • 메인 업무 추가 · 이름 변경
    • @@ -595,6 +596,7 @@

      글자 서식 바꾸기

      글 칸에서 글자를 드래그해 선택하면 해당 셀 상단에 서식 도구가 나타납니다. 선택한 글자에만 12색 견본·크기·굵게·기울임·밑줄을 적용합니다. 크기 버튼은 2px씩 조절하며 범위는 10~32px입니다.

      +

      링크 — 글자를 선택하고 서식 도구의 link를 누르면 주소 칸이 열립니다. 주소를 넣고 Enter(또는 적용)하면 선택한 글자가 파란 밑줄 링크가 됩니다(http://·https:// 가 없으면 https://를 붙임). 주소만 복사해 칸에 붙여 넣어도 링크가 됩니다. 칸 안 링크는 Ctrl+클릭으로 새 탭에서 열리고(그냥 누르면 글자 고치기), 읽기 전용 칸(회의 완료·지난주 칸)에서는 그냥 누르면 열립니다. 링크를 빼려면 링크 글자를 선택하고 link → 링크 삭제(서식 초기화도 링크를 뺍니다).

      굵게·기울임·밑줄은 다시 누르면 해제됩니다. 서식 초기화는 선택한 글자의 서식만 되돌리고 내용은 유지합니다. 글과 서식은 입력을 약 0.8초 멈추거나 칸을 떠날 때 자동 저장됩니다.

      분기 접기·열 너비·행 높이

      @@ -657,7 +659,8 @@

      제목 아래 두 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽 칸 머리 한 줄에 N월 계획과 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비, 목표 표 매출 단위 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻)와 결정사항 제목이 나오고, 그 아래 칸 전체가 결정사항(진행상황 수시 공유 및 완료 되어야 할 것) 입력란입니다. 오른쪽은 업무 등록 표입니다.

      1. 업무 등록(제목에 N주차 업무 등록) — 주차마다 한 표를 모두가 같이 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다. - 업무 칸 — 비워 두면 고른 섹션에 새 업무로, 업무를 고르면 그 업무의 세부 업무로 등록합니다(목록 = 그 섹션의 진행 중인 메인 업무, 고르면 섹션 칸은 —). 등록된 줄의 제목을 누르면 오른쪽에 업무 창이 열려 바로 편집할 수 있습니다(업무 창에서 저장이 끝나야 닫히거나 다른 업무로 바뀝니다). + 업무 칸 — 비워 두면 고른 섹션에 새 업무로, 업무를 고르면 그 업무의 세부 업무로 등록합니다(목록 = 그 섹션의 진행 중인 메인 업무, 고르면 섹션 칸은 —). 등록된 줄(업무·세부 업무)을 누르면 줄 어디든 오른쪽에 업무 창이 열려 바로 편집할 수 있습니다(연 줄은 옅은 보라색, 다른 줄을 누르면 창이 그 업무로 바뀜, 업무 창에서 저장이 끝나야 닫히거나 다른 업무로 바뀝니다). 세부 업무 줄의 ↳ 상위 업무를 누르면 상위 업무 창이 열립니다. + 하위 업무 등록 — 등록된 줄 오른쪽 add(하위 업무 추가)을 누르면 바로 아래에 그 업무의 세부 업무 줄이 생깁니다(프로젝트·↳ 상위 업무가 채워져 있음). 제목·담당자를 적고 적용하면 세부 업무로 등록되고, 세부 업무 줄에서 다시 add를 누르면 그 아래 단계도 만들 수 있습니다. 세부 업무 줄은 상위 업무 줄 아래에 들여 써서 보입니다. 크게 열기 — 같은 표를 넓은 창으로 열어 씁니다(줄·저장은 그대로, Esc·×로 닫기). 제목 칸에 업무 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 새 프로젝트(Pro user 이상)·새 섹션(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 새 섹션을 만들어 고르세요.
      2. 프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).
      3. 맨 오른쪽 적용을 누르면 그 프로젝트에 업무가 만들어지고, 줄 오른쪽에 체크 표시(누르면 새 탭에서 업무 열기)가 생기고, 제목을 누르면 오른쪽에 업무 창이 열립니다. 줄은 서버에 저장돼 같은 주차를 보는 모두에게 보입니다. + 줄 추가로 줄을 늘립니다.
      4. @@ -686,6 +689,7 @@

        주요 업무 셀에서는 목표 표의 셀 편집 도구를 함께 사용할 수 있습니다.

        • 글자 서식 — 글자 일부를 선택하고 위쪽 도구에서 색·크기·굵게·기울임·밑줄을 바꿉니다. 초기화 버튼은 선택한 글자의 서식을 지웁니다.
        • +
        • 링크 — 주요 업무 칸에서 글자를 선택하고 link → 주소 Enter로 하이퍼링크를 겁니다. 주소만 붙여 넣어도 링크가 되고, 칸 안 링크는 Ctrl+클릭으로 엽니다(글자 서식 바꾸기).
        • 열 너비 — 회의록을 열 때마다 전체 열 너비 자동 맞춤으로 시작합니다. 오른쪽 경계를 끌어 조절하고, 경계를 더블클릭하거나 우클릭 메뉴에서 현재 열·전체 열 너비를 내용에 맞춥니다. 직접 바꾼 너비는 그 화면에서만 유지되고 다시 열면 자동 맞춤으로 돌아갑니다.
        • 세로 정렬 — 1열(구역)·2열(항목)은 긴 행이나 병합된 구역도 항상 세로 가운데 정렬합니다. 할 일·리뷰 내용은 상단 정렬입니다.
        • 범위 선택·지우기 — 같은 구역의 이번주 글 셀을 드래그하거나 첫 셀을 누른 뒤 Shift+클릭으로 선택합니다. 우클릭의 내용 지우기 또는 Delete로 지우고, Ctrl+Z로 되돌립니다.
        • diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 4ee27c2..c63450a 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 %} @@ -106,5 +106,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 580d953..a9bcc10 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 %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/notifier.html b/app/modules/project/templates/project/notifier.html index a32fc32..292ddde 100644 --- a/app/modules/project/templates/project/notifier.html +++ b/app/modules/project/templates/project/notifier.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -108,5 +108,5 @@ }); })(); - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 063e4d5..5a23a93 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 %} - + @@ -476,5 +476,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 61cb3ba..a99eb3b 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 %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/performance.css b/app/static/performance.css index 74fcd95..82afe40 100644 --- a/app/static/performance.css +++ b/app/static/performance.css @@ -457,3 +457,12 @@ body.perf-dragging, body.perf-dragging * { cursor: grabbing !important; user-sel .perf-memo-input { width: 100%; box-sizing: border-box; min-height: 110px; padding: 10px; border: 1px solid #d8dce2; border-radius: 8px; font: inherit; font-size: 13.5px; line-height: 1.5; resize: vertical; } .perf-memo-input:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26, 86, 219, .12); } + +/* ── 일자별 표 스크롤 고정(2026-10-26): 표 상자 안에서 세로 스크롤 → 제목 행 + 맨 위 기간 합계 행 고정 ── + (상자가 가로 스크롤(overflow-x)이라 페이지 스크롤 기준 sticky 는 안 먹는다 — 상자 높이를 화면 높이로 묶고 상자 안에서 스크롤) + --perf-head-h = 제목 행 높이(performance.js stickyHead 가 잼, 기본 31px). 연간 보기 "연간 합계"는 맨 아래 그대로. */ +.perf-main-wrap { overflow: auto; max-height: calc(100vh - var(--erp-topbar-h, 56px) - 24px); overscroll-behavior: contain; } +.perf-main-wrap .perf-main thead th { z-index: 3; } +.perf-main-wrap .perf-main thead th.perf-th-label { z-index: 5; } +.perf-main-wrap .perf-main tbody tr.perf-row-total:first-child > * { position: sticky; top: var(--perf-head-h, 31px); z-index: 1; } +.perf-main-wrap .perf-main tbody tr.perf-row-total:first-child > .perf-td-label { left: 0; z-index: 4; } diff --git a/app/static/performance.js b/app/static/performance.js index 3dc3ba5..affc537 100644 --- a/app/static/performance.js +++ b/app/static/performance.js @@ -1434,9 +1434,22 @@ }); } + // 일자별 표 스크롤 고정(2026-10-26) — 기간 합계 행이 제목 행 바로 밑에 붙도록 제목 행 높이를 CSS 변수로. + // 그룹 접기·화면 크기·글꼴에 따라 높이가 바뀌므로 ResizeObserver 로 다시 잰다. + function stickyHead(root) { + root.querySelectorAll(".perf-main-wrap").forEach(function (wrap) { + const head = wrap.querySelector("thead"); + if (!head) return; + const measure = function () { wrap.style.setProperty("--perf-head-h", head.getBoundingClientRect().height + "px"); }; + measure(); + if (window.ResizeObserver) new ResizeObserver(measure).observe(head); + else window.addEventListener("resize", measure); + }); + } + document.addEventListener("DOMContentLoaded", function () { const dash = document.getElementById("perf-dash"); - if (dash) initDashboard(dash); + if (dash) { initDashboard(dash); stickyHead(dash); } const set = document.getElementById("perf-settings"); if (set) initSettings(set); }); diff --git a/app/static/project-goal-text.js b/app/static/project-goal-text.js index 5083196..f30c86f 100644 --- a/app/static/project-goal-text.js +++ b/app/static/project-goal-text.js @@ -2,7 +2,10 @@ (function () { "use strict"; const PREFIX = "pj-rich:v1:"; - const STYLE_KEYS = ["bold", "italic", "underline", "color", "size"]; + const STYLE_KEYS = ["bold", "italic", "underline", "color", "size", "link"]; + // 하이퍼링크(2026-10-26) — http(s) 주소만(서버 store.goal_link 와 같은 규칙). 칸 안 링크는 Ctrl+클릭으로 새 탭. + const LINK_RE = /^https?:\/\/[^\s"'<>]{1,2000}$/i; + function safeLink(v) { v = String(v || "").trim(); return LINK_RE.test(v) ? v : ""; } const TOGGLES = ["bold", "italic", "underline"]; function styles(node, inherited) { const s = Object.assign({}, inherited); @@ -13,6 +16,7 @@ if (node.tagName === "I" || node.tagName === "EM") s.italic = true; if (css.fontStyle) s.italic = css.fontStyle === "italic" || css.fontStyle === "oblique"; if (node.tagName === "U") s.underline = true; + if (node.tagName === "A" && safeLink(node.getAttribute("href"))) s.link = safeLink(node.getAttribute("href")); const decoration = css.textDecorationLine || css.textDecoration; if (decoration) s.underline = decoration.includes("underline"); const size = parseInt(css.fontSize, 10); @@ -81,7 +85,13 @@ if (/^#[\da-f]{6}$/i.test(r.color || "")) span.style.color = r.color; if (Number.isInteger(r.size) && r.size >= 10 && r.size <= 32) span.style.fontSize = r.size + "px"; if (!span.style.cssText && r.text.includes("\n")) span.style.lineHeight = "inherit"; - return span.style.cssText || r.text.includes("\n") ? span : document.createTextNode(r.text); + const inner = span.style.cssText || r.text.includes("\n") ? span : document.createTextNode(r.text); + if (!safeLink(r.link)) return inner; + const a = document.createElement("a"); + a.className = "pj-goal-link"; a.href = safeLink(r.link); a.target = "_blank"; a.rel = "noopener noreferrer"; + a.title = r.link + " — Ctrl+클릭으로 열기"; + a.appendChild(inner); + return a; } function caretLine(editor) { // 마지막 개행 뒤의 빈 줄도 화면에 만들되 저장할 글에는 넣지 않는다. @@ -138,11 +148,20 @@ editor.addEventListener("input", function (e) { if (!e.isComposing) caretLine(editor); }); editor.addEventListener("compositionend", function () { caretLine(editor); }); editor.addEventListener("paste", function (e) { - e.preventDefault(); insert(editor, e.clipboardData.getData("text/plain")); + e.preventDefault(); + const text = e.clipboardData.getData("text/plain"), url = safeLink(text); + insert(editor, url || text, url ? { link: url } : null); // 주소 하나만 붙여 넣으면 링크 + }); + // 편집 칸 안 링크 — 그냥 누르면 글자 고치기, Ctrl(⌘)+클릭이면 새 탭으로 연다. + editor.addEventListener("click", function (e) { + const a = e.target.closest && e.target.closest("a.pj-goal-link"); + if (!a || !editor.contains(a)) return; + e.preventDefault(); + if (e.ctrlKey || e.metaKey) window.open(a.href, "_blank", "noopener"); }); paint(editor, readRuns(editor)); } - function insert(editor, text) { + function insert(editor, text, extra) { if (!text) return; const sel = window.getSelection(); if (!sel.rangeCount || !editor.contains(sel.getRangeAt(0).commonAncestorContainer)) return; @@ -153,9 +172,12 @@ pos += run.text.length; if (pos >= offset) { STYLE_KEYS.forEach(k => { if (run[k] !== undefined) style[k] = run[k]; }); break; } } + if (extra) Object.assign(style, extra); + else if (style.link && pos === offset) delete style.link; // 링크 끝에서 Enter·붙여넣기 = 링크 밖 글자 range.deleteContents(); const node = nodeForRun(Object.assign({ text: text }, style)); range.insertNode(node); - const caret = node.nodeType === 3 ? node : node.lastChild; + let caret = node.nodeType === 3 ? node : node.lastChild; + if (caret && caret.nodeType === 1 && caret.tagName === "SPAN") caret = caret.lastChild || caret; // 링크 … if (caret.nodeType === 3) range.setStart(caret, caret.length); else range.setStartAfter(caret); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); editor.dispatchEvent(new Event("input", { bubbles: true })); @@ -166,6 +188,10 @@ // body 에 두어 표 스크롤과 화면 zoom 에 잘리지 않는 선택 셀 위 팝업으로 표시한다. document.body.appendChild(toolbar); const colorButton = toolbar.querySelector("[data-goal-format='color']"); + const linkButton = toolbar.querySelector("[data-goal-format='link']"); + const linkPop = toolbar.querySelector(".pj-goal-link-pop"); + const linkInput = linkPop && linkPop.querySelector("input"); + function closeLink() { if (linkPop) { linkPop.hidden = true; linkButton.setAttribute("aria-expanded", "false"); } } const colorGrid = toolbar.querySelector(".pj-goal-color-grid"); function closeColors() { colorGrid.hidden = true; colorButton.setAttribute("aria-expanded", "false"); } function showColor(value) { @@ -191,10 +217,11 @@ toolbar.style.left = Math.max(8, Math.min(rect.left + rect.width / 2 - w / 2, window.innerWidth - w - 8)) + "px"; toolbar.style.top = Math.max(8, rect.top - h - 8) + "px"; colorGrid.classList.toggle("is-below", rect.top - h - 88 < 8); + if (linkPop) linkPop.classList.toggle("is-below", rect.top - h - 48 < 8); } function clear() { saved = null; - toolbar.hidden = true; closeColors(); + toolbar.hidden = true; closeColors(); closeLink(); toolbar.querySelectorAll("button, input, select").forEach(function (el) { el.disabled = true; }); } function capture() { @@ -225,6 +252,13 @@ toolbar.querySelector("[data-goal-format='" + key + "']").setAttribute("aria-pressed", all ? "true" : some ? "mixed" : "false"); }); showColor(uniform("color", "#000000")); + if (linkButton) { + const linked = chosen.length && chosen.every(function (r) { return !!r.link; }); + linkButton.setAttribute("aria-pressed", linked ? "true" : chosen.some(function (r) { return !!r.link; }) ? "mixed" : "false"); + if (linkPop && linkPop.hidden) linkInput.value = uniform("link", ""); + const unlink = linkPop && linkPop.querySelector("[data-goal-link='remove']"); + if (unlink) unlink.disabled = !chosen.some(function (r) { return !!r.link; }); + } const sizes = chosen.map(function (r) { return r.size || 14; }); toolbar.querySelector("[data-goal-format='size']").textContent = sizes.every(function (n) { return n === sizes[0]; }) ? sizes[0] + "px" : "혼합"; toolbar.querySelector("[data-goal-format='size-up']").disabled = sizes.every(function (n) { return n >= 32; }); @@ -247,6 +281,7 @@ if (a > pos) out.push(Object.assign({}, run, { text: run.text.slice(0, a - pos) })); const middle = Object.assign({}, run, { text: run.text.slice(a - pos, b - pos) }); if (key === "reset") STYLE_KEYS.forEach(function (style) { delete middle[style]; }); + else if (key === "link" && !value) delete middle.link; else if (key === "size-delta") middle.size = Math.max(10, Math.min(32, (middle.size || 14) + value)); else middle[key] = value; out.push(middle); @@ -267,6 +302,34 @@ if (!btn) return; apply("color", btn.dataset.goalColor.toLowerCase()); closeColors(); }); + // 링크 — 🔗 누르면 주소 칸(Enter = 적용), 빈 주소로 적용하거나 [링크 삭제] = 링크만 뺌. 주소에 http(s):// 가 없으면 https:// 를 붙인다. + if (linkButton && linkPop) { + linkButton.addEventListener("click", function () { + const open = linkPop.hidden; + closeColors(); linkPop.hidden = !open; + linkButton.setAttribute("aria-expanded", String(open)); + if (open) { linkInput.focus(); linkInput.select(); } + }); + const applyLink = function () { + const raw = linkInput.value.trim(); + if (!raw) { closeLink(); apply("link", ""); return; } + const url = safeLink(raw) || (/^[a-z][\w+.-]*:(?!\d)/i.test(raw) ? "" : safeLink("https://" + raw.replace(/^\/+/, ""))); + if (!url) { linkInput.setCustomValidity("http:// 또는 https:// 주소를 넣어 주세요."); linkInput.reportValidity(); return; } + linkInput.setCustomValidity(""); + closeLink(); apply("link", url); + }; + linkInput.addEventListener("input", function () { linkInput.setCustomValidity(""); }); + linkInput.addEventListener("keydown", function (e) { + if (e.isComposing || e.keyCode === 229) return; + if (e.key === "Enter") { e.preventDefault(); applyLink(); } + }); + linkPop.addEventListener("click", function (e) { + const btn = e.target.closest("[data-goal-link]"); + if (!btn) return; + if (btn.dataset.goalLink === "apply") applyLink(); + else { closeLink(); apply("link", ""); } + }); + } TOGGLES.forEach(function (key) { const btn = toolbar.querySelector("[data-goal-format='" + key + "']"); btn.addEventListener("click", function () { apply(key, btn.getAttribute("aria-pressed") !== "true"); }); @@ -281,7 +344,8 @@ toolbar.addEventListener("keydown", function (e) { if (e.key !== "Escape") return; e.preventDefault(); e.stopPropagation(); - if (!colorGrid.hidden) { closeColors(); colorButton.focus(); } + if (linkPop && !linkPop.hidden) { closeLink(); linkButton.focus(); } + else if (!colorGrid.hidden) { closeColors(); colorButton.focus(); } else { if (saved) saved.editor.focus(); clear(); } }); window.addEventListener("resize", place); diff --git a/app/static/project.css b/app/static/project.css index c0a7400..b7a5b49 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -2797,6 +2797,17 @@ a.pj-meet-quick-done:hover { background: #e8f5ee; } .pj-meet-quick-done.is-gone { color: #9aa1ab; } .pj-meet-quick-table tr.is-done input, .pj-meet-quick-table tr.is-done .pj-meet-pick-cell { color: var(--pj-ink-soft); pointer-events: none; } .pj-meet-quick-table tr.is-done .pj-meet-pick-cell.is-person { color: var(--pj-ink-soft); } +/* 등록된 줄 = 줄 어디든 누르면 오른쪽 업무 창(2026-10-26), 연 줄은 옅은 보라 · 세부 업무 줄은 상위 줄 아래 들여쓰기 · [+] 하위 업무 추가 */ +.pj-meet-quick-table tr.is-openable { cursor: pointer; } +.pj-meet-quick-table tr.is-openable:hover > td { background: #f6f7f9; } +.pj-meet-quick-table tr.is-panel-selected > td { background: var(--pj-accent-tint, #f0ebff); } +.pj-meet-quick-table tr.is-sub .pj-meet-quick-title { padding-left: calc(3px + var(--pj-quick-depth, 1) * 16px); } +.pj-meet-quick-table tr.is-sub .pj-meet-quick-title::before { content: "└"; float: left; margin: 4px 2px 0 -12px; color: #b6bcc4; font-size: 11px; } +.pj-meet-quick-table tr.is-done .pj-meet-pick-cell.is-parent { pointer-events: auto; cursor: pointer; } +.pj-meet-quick-table tr.is-done .pj-meet-pick-cell.is-parent:hover { color: var(--pj-accent-dark, #2f5bb7); text-decoration: underline; } +.pj-meet-quick-sub { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; padding: 0; border: none; border-radius: 6px; background: none; color: #8a9099; cursor: pointer; } +.pj-meet-quick-sub .material-symbols-outlined { font-size: 18px; } +.pj-meet-quick-sub:hover { background: #eef0ff; color: var(--pj-accent-dark, #2f5bb7); } .pj-meet-quick-add { margin-top: 4px; padding: 2px 6px; border: none; background: none; color: var(--pj-accent-dark); font: inherit; font-size: 12px; cursor: pointer; } @media print { .pj-meet-quick { display: none !important; } .pj-meet-area { height: auto; } } .pj-meet-title { flex-wrap: wrap; } @@ -3316,6 +3327,21 @@ label.pj-options-row[for] { cursor: pointer; } .pj-goal-text-swatch[aria-pressed="true"] { outline: 2px solid var(--pj-accent); outline-offset: 2px; } .pj-goal-text-swatch:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; } .pj-goal-format :disabled { opacity: .45; cursor: default; } +/* 하이퍼링크(2026-10-26) — 서식 도구 🔗 + 주소 칸, 칸 안 링크 = 파랑 밑줄(편집 칸은 Ctrl+클릭, 읽기 전용 칸은 그냥 클릭으로 새 탭) */ +.pj-goal-link-picker { position: relative; } +.pj-goal-link-icon { width: 14.4px; height: 14.4px; } +.pj-goal-link-pop { position: absolute; bottom: calc(100% + 8px); left: 0; display: flex; align-items: center; gap: 6px; padding: 6px; background: #fff; border: 1px solid var(--pj-border); border-radius: 6px; box-shadow: 0 4px 12px #0002; white-space: nowrap; } +.pj-goal-link-pop[hidden] { display: none; } +.pj-goal-link-pop.is-below { bottom: auto; top: calc(100% + 8px); } +.pj-goal-link-input { width: 260px; height: 26px; box-sizing: border-box; border: 1px solid var(--pj-border); border-radius: 4px; padding: 0 8px; font: inherit; color: var(--pj-ink); } +.pj-goal-link-input:focus { outline: 2px solid var(--pj-accent); outline-offset: -1px; } +.pj-goal-link-btn { height: 26px; border: 1px solid var(--pj-border); border-radius: 4px; padding: 0 10px; background: #fff; color: var(--pj-ink); font: inherit; cursor: pointer; } +.pj-goal-link-btn:hover { background: #f3f4f6; } +.pj-goal-link-btn.is-primary { border-color: var(--pj-accent); background: var(--pj-accent); color: #fff; } +.pj-goal-link-btn.is-primary:hover { filter: brightness(1.05); background: var(--pj-accent); } +a.pj-goal-link, a.pj-goal-link span { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; } +a.pj-goal-link { cursor: pointer; } +.pj-goal-text[contenteditable="true"] a.pj-goal-link { cursor: text; } /* PC 알림 프로그램 화면(/project/notifier, 023) */ .pj-notifier-pane { display: flex; flex-direction: column; gap: 14px; max-width: 760px; padding: 16px; } diff --git a/app/static/project.js b/app/static/project.js index 6f75d0d..4e21fba 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -875,6 +875,8 @@ // 보드 카드를 왼쪽 프로젝트 목록으로 끌어 다른 프로젝트로 옮길 때 쓰는 드래그 종류(값 = 업무 id). // 카드 안 섹션 이동은 예전처럼 text/plain — 사이드바는 이 종류만 받는다. const TASK_DRAG_TYPE = "application/x-pj-task"; + // 보드 섹션 머리 끌기(값 = 섹션 id) — 보드 안에서는 섹션 순서 바꾸기, 왼쪽 프로젝트 목록에 놓으면 섹션째 다른 프로젝트로(2026-10-26). + const STAGE_DRAG_TYPE = "application/x-pj-stage"; // 협업자 미지정 아이콘(점선 원 안의 두 사람) — 업무 창 세부 업무 줄. const FOLLOWER_EMPTY_ICON_SVG = '"; + m.querySelector(".pj-move-task").textContent = "섹션 ‘" + (s.name || "") + "’"; + m.querySelector(".pj-move-proj").textContent = target.name || "프로젝트"; + m.querySelector(".pj-move-dot").style.background = target.color || "var(--pj-accent)"; + document.body.appendChild(m); + moveModalEl = m; + document.addEventListener("keydown", onMoveKey, true); + m.addEventListener("click", function (e) { + if (e.target === m || e.target.closest("[data-move-cancel]")) closeMoveModal(); + }); + const ok = m.querySelector("[data-move-ok]"); + ok.addEventListener("click", async function () { + const err = m.querySelector(".pj-move-err"); + ok.disabled = true; err.hidden = true; + try { + const res = await api("POST", "/project/api/stages/" + s.id + "/move-project", { project_id: target.projectId }); + closeMoveModal(); + showToast("섹션 ‘" + (s.name || "") + "’ 을(를) " + target.name + "(으)로 옮겼습니다."); + if (res.unseen && res.unseen.length) { + showToast(res.unseen.map(idOf).join(", ") + " 님은 '" + target.name + "' 멤버가 아니라 옮긴 업무를 볼 수 없습니다.", "error"); + } + await softSyncProjectRef(); + } catch (e2) { + err.textContent = e2.status === 403 + ? "'" + target.name + "' 프로젝트 멤버만 섹션을 옮겨 넣을 수 있습니다." + : "옮기지 못했습니다: " + e2.message; + err.hidden = false; + ok.disabled = false; + } + }); + setTimeout(function () { if (ok.isConnected) ok.focus(); }, 0); + } + document.addEventListener("pj:stage-to-project", function (e) { + const d = e.detail || {}; + let s = null; + Object.keys(stagesByProject).some(function (k) { + s = (stagesByProject[k] || []).find(function (x) { return x.id === d.stageId; }) || null; + return !!s; + }); + if (!s) return; + if (s.project_id === d.projectId) { showToast("이미 이 프로젝트의 섹션입니다."); return; } + openMoveStageToProject(s, d); + }); document.addEventListener("pj:task-to-project", function (e) { const d = e.detail || {}; const t = tasks.find(function (x) { return x.id === d.taskId && x.context_project_id === x.project_id; }) || @@ -12029,7 +12110,10 @@ // · 30초마다·창을 다시 볼 때 다시 읽는다(입력 중·저장 중엔 건너뜀). 회의 완료면 읽기 전용. // · 이 브라우저에 남은 예전 표(pj_meet_quick:…)는 처음 열 때 서버로 한 번 옮기고 지운다. // · 작업 칸(026 parent_task_id) — 비우면 그 섹션에 새 작업, 이미 있는 작업을 고르면 [적용] 때 그 작업의 세부 작업으로(섹션 없음). - // · 등록된 줄의 제목을 누르면 오른쪽에 작업 창(편집, 수신함과 같은 iframe·저장 대기). + // · 등록된 줄(업무·세부 업무)을 누르면 오른쪽에 작업 창(편집, 수신함과 같은 iframe·저장 대기) — 줄 어디든(2026-10-26, 예전엔 제목만), + // 업무 칸의 "↳ 상위 업무"를 누르면 그 상위 업무 창. + // · 등록된 줄의 [+](하위 업무 추가, 2026-10-26) — 바로 아래에 그 업무의 세부 업무 줄(프로젝트·상위 업무가 채워진 초안, 제목을 치는 순간 + // 서버에 줄이 생긴다) → [적용] = 세부 업무. 세부 업무 줄은 상위 업무 줄 아래에 들여 써서 보인다(세부의 세부도). // · [크게 열기] — 같은 표를 넓은 창으로 옮겨 쓴다(줄·저장 그대로), 닫으면 제자리. function initMeetQuickTasks() { const box = el("pj-meet-quick"); @@ -12068,9 +12152,14 @@ } let rows = []; let ready = false, unavailable = ""; + // 이 줄이 표 안의 등록된 줄(r.taskId)의 세부 업무 줄인가 — 그 줄 아래 들여 써서 보인다 + function parentRowOf(r) { + if (!r.parentTaskId) return null; + return rows.find(function (p) { return p !== r && p.registered && p.taskId === r.parentTaskId; }) || null; + } function padBlank() { if (locked) return; - const open = rows.filter(function (r) { return !r.registered; }).length; + const open = rows.filter(function (r) { return !r.registered && !parentRowOf(r); }).length; for (let i = open; i < 3; i++) rows.push(blank()); } @@ -12162,19 +12251,36 @@ return '"; } + // 보이는 순서 — 서버 순서 그대로, 다만 세부 업무 줄은 상위 업무 줄 바로 아래(깊이만큼 들여쓰기) + function displayOrder() { + const out = [], placed = new Set(); + function put(r, depth) { + if (placed.has(r)) return; + placed.add(r); out.push({ r: r, depth: depth }); + if (r.registered && r.taskId) rows.forEach(function (c) { if (c !== r && c.parentTaskId === r.taskId) put(c, depth + 1); }); + } + rows.forEach(function (r) { if (!parentRowOf(r)) put(r, 0); }); + rows.forEach(function (r) { put(r, 0); }); // 남은 것(서로를 가리키는 이상한 줄)도 빠지지 않게 + return out; + } function render() { if (unavailable) { tbody.innerHTML = '
  • "; return; } - tbody.innerHTML = rows.map(function (r, i) { + tbody.innerHTML = displayOrder().map(function (o) { + const r = o.r, i = rows.indexOf(r), depth = Math.min(o.depth, 3); const ro = locked || r.registered; + const openable = r.registered && r.visible && r.taskId && r.taskExists; let acts; if (r.registered) { // 체크 아이콘만(말풍선에 등록됨/작업 삭제됨) — 볼 수 있으면 새 탭 링크 const label = !r.taskExists ? "업무 삭제됨" : "등록됨"; const ic = 'check_circle'; - acts = (r.visible && r.taskId && r.taskExists + acts = (!locked && openable + ? '' : "") + + (openable ? '' + ic + "" : '' + ic + "") + (!locked && r.visible @@ -12193,16 +12299,22 @@ } // 제목 — 등록된 줄은 누르면 오른쪽에 작업 창(편집), 아니면 입력칸 const titleCell = r.registered - ? (r.visible && r.taskId && r.taskExists + ? (openable ? '" : '' + escapeHtml(r.title || "(제목 없음)") + "") : '"; // 작업 칸 — 비우면 그 섹션에 새 작업, 고르면 그 작업의 세부 작업(↳ 표시) const taskCell = r.parentTaskId - ? cell("task", "↳ " + (r.parentTaskTitle || "업무"), "", ro, "이 업무의 세부 업무로 등록") + ? (r.registered && r.visible + ? '" + : cell("task", "↳ " + (r.parentTaskTitle || "업무"), "", ro, "이 업무의 세부 업무로 등록")) : cell("task", "", r.registered ? "—" : "새 업무", ro || !r.projectId, r.projectId ? "고르면 그 업무의 세부 업무로 등록(비우면 섹션에 새 업무)" : "프로젝트를 먼저 고르세요"); - return '" + + const cls = [r.registered ? "is-done" : (r.err && r.unsaved.size ? "is-unsaved" : ""), + openable ? "is-openable" : "", depth ? "is-sub" : "", openable && panelOpen() && panelTask === r.taskId ? "is-panel-selected" : ""] + .filter(Boolean).join(" "); + return '" + '" + "
    ' + escapeHtml(unavailable) + "
    ' + titleCell + "" + (r.assignee ? '