Merge branch 'feat/project-ui-batch-1008'

This commit is contained in:
2026-10-08 13:22:40 +09:00
19 changed files with 367 additions and 60 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+7
View File
@@ -675,6 +675,7 @@ def my_tasks_page(request: Request) -> HTMLResponse:
"priority_labels": store.PRIORITY_LABELS,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"today": today_iso,
},
)
@@ -894,6 +895,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
"priority_labels": store.PRIORITY_LABELS,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"stage_color_palette": list(store.STAGE_COLOR_PALETTE),
"today": today.isoformat(),
# 타임라인 날짜 색(일요일·국경일·대체공휴일 빨강) — 캘린더와 같은 공휴일 표
@@ -2477,6 +2479,7 @@ def notifier_page(request: Request) -> Any:
"force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"notifier_enabled": enabled,
"code": code,
"link": link,
@@ -2619,6 +2622,7 @@ def trash_page(request: Request) -> HTMLResponse:
"force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"trash_enabled": enabled,
# 휴지통도 내가 볼 수 있는 프로젝트(owner·멤버, 슈퍼관리자는 전체)의 것만
"items": _trash_view_items(_visible_trash(st, user)) if enabled else [],
@@ -2723,6 +2727,7 @@ def inbox_page(request: Request) -> HTMLResponse:
"force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"notifications": items,
"mentioned_tasks": mentioned,
"mention_unread": _safe_mention_unread(st, user),
@@ -2897,6 +2902,7 @@ def goals_page(request: Request, year: int) -> HTMLResponse:
"force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"goals_enabled": enabled,
"goal_year": year,
"board": board,
@@ -3429,6 +3435,7 @@ def goal_meeting_page(request: Request, year: int, month: int, week: str | None
"force_sidebar_collapsed": True,
"color_palette": list(store.COLOR_PALETTE),
"project_icons": list(store.PROJECT_ICONS),
"project_asana_icons": list(store.PROJECT_ASANA_ICONS),
"goal_year": year,
"goal_month": month,
"meeting_embedded": content,
+41 -2
View File
@@ -131,6 +131,22 @@ PROJECT_ICONS: tuple[str, ...] = (
"build", # 도구
)
# 아사나 아이콘(2026-10-08) — 아사나 프로젝트 아이콘과 같은 채워진 모양. 저장 값은 "asana:" + 이름,
# 글꼴은 이 33개만 담은 채워진 Material Symbols(static/vendor/material-symbols/material-symbols-asana.woff2).
# 이름을 늘리면 그 글꼴도 다시 받아야 한다(docs/PROJECT_MODULE.md 6-12).
ASANA_ICON_PREFIX = "asana:"
PROJECT_ASANA_ICONS: tuple[str, ...] = (
"format_list_bulleted", "view_kanban", "view_timeline", "calendar_month",
"rocket_launch", "group", "monitoring", "stars",
"bug_report", "lightbulb", "language", "settings",
"book_2", "desktop_windows", "check_circle", "adjust",
"code_blocks", "campaign", "forum", "work",
"article", "landscape", "extension", "id_card",
"conversion_path", "speed", "workspace_premium", "steps",
"shopping_basket", "map", "confirmation_number", "toll",
"web",
)
# 섹션(칸반 컬럼) 색상표 — 모든 편집창이 프로젝트 색상표(32색) 하나를 쓴다.
# 섹션에서는 첫 칸(연회색 #c7c4c4, 아사나의 "색 없음")을 고르면 색 없음(NULL, 기본 회색 머리).
STAGE_COLOR_PALETTE: tuple[str, ...] = COLOR_PALETTE
@@ -288,8 +304,10 @@ def validate_color(color: Any) -> str:
def validate_project_icon(icon: Any) -> str | None:
"""프로젝트 아이콘 — PROJECT_ICONS 안의 이름만, 빈값/목록 밖은 None(첫 글자 표시)."""
"""프로젝트 아이콘 — PROJECT_ICONS 안의 이름 또는 "asana:" + PROJECT_ASANA_ICONS 이름만, 빈값/목록 밖은 None(첫 글자 표시)."""
v = norm_str(icon)
if v.startswith(ASANA_ICON_PREFIX):
return v if v[len(ASANA_ICON_PREFIX):] in PROJECT_ASANA_ICONS else None
return v if v in PROJECT_ICONS else None
@@ -867,6 +885,23 @@ _DESC_ALLOWED_CLASS: dict[str, str] = {"span": _MENTION_CLASS, "ul": "pj-checkli
# 허용 태그 목록에 없어 태그는 이미 안 남지만, HTMLParser는 이 둘의 내용을
# 별도 데이터로 넘기므로 handle_data 에서 따로 걸러야 한다.
_DESC_RAW_TEXT_TAGS: frozenset[str] = frozenset({"script", "style"})
# 글자 색·크기(서식 도구, 2026-10-08) — 평범한 span 의 style 에서 이 둘만, 정해진 형식만 남긴다.
_DESC_STYLE_COLOR = re.compile(r"^(#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\))$", re.I)
DESC_FONT_SIZES: frozenset[str] = frozenset({"12px", "18px", "22px", "28px"})
def desc_inline_style(value: str) -> str:
"""span style → "color: …; font-size: …" 중 허용된 것만(나머지 선언·url()·expression 등은 버림)."""
kept: list[str] = []
for decl in (value or "").split(";"):
if ":" not in decl:
continue
prop, val = (x.strip().lower() for x in decl.split(":", 1))
if prop == "color" and _DESC_STYLE_COLOR.match(val) and not any(k.startswith("color:") for k in kept):
kept.append(f"color: {val}")
elif prop == "font-size" and val in DESC_FONT_SIZES and not any(k.startswith("font-size:") for k in kept):
kept.append(f"font-size: {val}")
return "; ".join(kept)
def _desc_escape_text(text: str) -> str:
@@ -923,7 +958,7 @@ class _DescriptionSanitizer(HTMLParser):
# span 은 멘션 칩일 때만 속성을 갖는다 — class 가 pj-mention 이 아니면
# data-email 까지 통째로 버린다(평범한 span 으로만 남는다).
if tag == "span" and (dict(attrs).get("class") or "").strip() != _MENTION_CLASS:
allowed = frozenset()
allowed = frozenset({"style"}) # 평범한 span — 글자 색·크기만(desc_inline_style)
kept: list[str] = []
for name, value in attrs:
if name not in allowed:
@@ -939,6 +974,10 @@ class _DescriptionSanitizer(HTMLParser):
continue
if name == "data-checked" and value.strip() != "true":
continue
if name == "style":
value = desc_inline_style(value)
if not value:
continue
kept.append(f'{name}="{_desc_escape_attr(value)}"')
attr_text = (" " + " ".join(kept)) if kept else ""
self.out.append(f"<{tag}{attr_text}>")
@@ -38,6 +38,17 @@
<span class="pj-side-navbadge" id="pj-mention-badge"
{% if not mention_unread %}hidden{% endif %}>{{ mention_unread }}</span>
</a>
{# 전체 보기(2026-10-08, 관리자만) — 예전 프로젝트 화면 오른쪽 위 "전체 프로젝트" 토글. 지금 프로젝트(없으면 목록 첫 프로젝트)
화면을 ?scope=all 로 연다 — 볼 수 있는 모든 프로젝트의 작업. 프로젝트 화면에서는 project.js 가 새로고침 없이 바꾼다. #}
{% if is_admin %}
{% set _all_pid = current_pid or ((nav_projects | rejectattr("status", "equalto", "completed") | list | first or {}).id or 0) %}
{% if _all_pid %}
<a class="pj-side-navlink" id="pj-side-allview" href="/project/p/{{ _all_pid }}?scope=all">
<span class="material-symbols-outlined pj-side-navic">apps</span>
<span class="pj-side-navtext">전체 보기</span>
</a>
{% endif %}
{% endif %}
<a class="pj-side-navlink {% if side_active == 'mytasks' %}is-active{% endif %}" href="/project/">
<span class="material-symbols-outlined pj-side-navic">checklist</span>
<span class="pj-side-navtext">내 작업</span>
@@ -102,7 +113,7 @@
<div class="pj-tree-row {% if p.id == current_pid %}is-active{% endif %}">
{% if is_admin %}<span class="pj-tree-handle" title="드래그로 순서 변경">⣿</span>{% endif %}
<a class="pj-tree-link" href="/project/p/{{ p.id }}"{% if is_admin %} draggable="false"{% endif %}>
<span class="pj-tree-avatar{% if p.icon %} has-icon{% endif %}" style="background: {{ p.color }}">{% if p.icon %}<span class="material-symbols-outlined pj-proj-ic">{{ p.icon }}</span>{% else %}{{ p.name[0] | upper }}{% endif %}</span>
<span class="pj-tree-avatar{% if p.icon %} has-icon{% endif %}" style="background: {{ p.color }}">{% if p.icon %}{% set _a = p.icon.startswith("asana:") %}<span class="material-symbols-outlined pj-proj-ic{% if _a %} pj-ic-asana{% endif %}">{{ p.icon[6:] if _a else p.icon }}</span>{% else %}{{ p.name[0] | upper }}{% endif %}</span>
<span class="pj-tree-name">{{ p.name }}</span>
</a>
{% if is_admin %}
@@ -6,6 +6,7 @@
<script>
window.PJ_COLORS = {{ color_palette | tojson }};
window.PJ_ICONS = {{ (project_icons or []) | tojson }};
window.PJ_ASANA_ICONS = {{ (project_asana_icons or []) | tojson }}; {# 아사나 아이콘 탭 — 값은 "asana:" + 이름 #}
</script>
{% if is_admin %}
<!-- 새 프로젝트 모달 — 좌측 프로젝트 목록의 + 버튼 -->
@@ -21,7 +22,7 @@
<div class="pj-field-label">색상
<span class="pj-color-palette" id="pj-f-colors"></span>
</div>
<div class="pj-field-label">아이콘
<div class="pj-field-label">아이콘<span class="pj-icon-tabs"></span>
<div class="pj-icon-palette" id="pj-f-icons"></div>
</div>
<div class="pj-field-label">멤버
@@ -49,7 +50,7 @@
<div class="pj-field-label">색상
<span class="pj-color-palette" id="pj-e-colors"></span>
</div>
<div class="pj-field-label">아이콘
<div class="pj-field-label">아이콘<span class="pj-icon-tabs"></span>
<div class="pj-icon-palette" id="pj-e-icons"></div>
</div>
<label class="pj-time-toggle">
@@ -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=20261007h" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -288,5 +288,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=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261007b" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% 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=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -96,8 +96,8 @@
<h2><span class="pjh-num">2</span>화면 구성</h2>
<div class="pjh-map" aria-hidden="true">
<div class="pjh-map-top"><span><b>위쪽 바</b>화면 이름</span><span>🔔 알림 · 내 이름 · 로그아웃 · <b style="display:inline">?</b> 도움말 · 옵션</span></div>
<div class="pjh-map-side"><b>왼쪽 사이드바</b>전체 검색<br>수신함 · 내 작업 · 휴지통 · 목표<br>프로젝트 목록<br>완료 프로젝트<br>전체 멤버</div>
<div class="pjh-map-main"><b>가운데 작업 영역</b>왼쪽 위: 프로젝트 제목 · 멤버<br>그 아래: 보기 탭(보드 · 목록 · 캘린더 · 타임라인 · 대시보드)<br>오른쪽 위: 범위(이 프로젝트 / 전체 프로젝트)<br>필터 바<br>작업들</div>
<div class="pjh-map-side"><b>왼쪽 사이드바</b>전체 검색<br>수신함 · 전체 보기(관리자) · 내 작업 · 휴지통 · 목표<br>프로젝트 목록<br>완료 프로젝트<br>전체 멤버</div>
<div class="pjh-map-main"><b>가운데 작업 영역</b>왼쪽 위: 프로젝트 제목 · 멤버<br>그 아래: 보기 탭(보드 · 목록 · 캘린더 · 타임라인 · 대시보드)<br>필터 바<br>작업들</div>
</div>
<h3>왼쪽 사이드바</h3>
<ul>
@@ -195,7 +195,8 @@
<tr><td>대시보드</td><td>완료·미완료·지연 숫자와 차트로 진행 상황을 볼 때. (<a href="#dashboard">14장</a>)</td></tr>
</table>
<h3>범위: 이 프로젝트 / 전체 프로젝트</h3>
<p>화면 오른쪽 위 토글입니다. <b>이 프로젝트</b>는 지금 프로젝트만, <b>전체 프로젝트</b>는 내가 볼 수 있는 모든 프로젝트의 작업을 함께 보여줍니다.
<p>프로젝트 화면은 지금 프로젝트만 보여줍니다. 관리자는 왼쪽 메뉴 수신함 아래 <b>전체 보기</b>를 누르면 내가 볼 수 있는 모든 프로젝트의 작업을 함께 봅니다
(왼쪽 프로젝트 목록에서 프로젝트를 누르면 다시 그 프로젝트만).
전체 프로젝트일 때는 위 제목이 <b>전체 프로젝트</b>로 바뀌고, 카드 위에는 어느 프로젝트 작업인지 이름이 붙습니다.</p>
<h3>필터 바</h3>
<p>탭 아래 한 줄로 작업을 거르고 정렬합니다. 다섯 가지 보기 모두에 똑같이 적용되고, 프로젝트마다 이 브라우저에 기억됩니다.</p>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -107,5 +107,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261008a" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261007d" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -49,7 +49,7 @@
(.pj-title-wrap.is-all-scope). -->
<div class="pj-title-wrap" id="pj-title-wrap">
<h1 class="pj-project-title">
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}"><span class="material-symbols-outlined pj-pill-ic">{{ project.icon or 'folder' }}</span><span class="pj-pill-name">{{ project.name }}</span></span>
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}">{% set _pic = project.icon or 'folder' %}{% set _a = _pic.startswith('asana:') %}<span class="material-symbols-outlined pj-pill-ic{% if _a %} pj-ic-asana{% endif %}">{{ _pic[6:] if _a else _pic }}</span><span class="pj-pill-name">{{ project.name }}</span></span>
</h1>
<h1 class="pj-project-title pj-all-title">
<span class="pj-project-title-all"><span class="material-symbols-outlined pj-pill-ic">apps</span><span class="pj-pill-name">전체 프로젝트</span></span>
@@ -80,7 +80,8 @@
</div>
<!-- 아사나처럼 기본은 "이 프로젝트"만 보여준다. 전체 프로젝트 보기는
예전처럼 접근 가능한 모든 프로젝트를 합쳐서 보여주는 모드. -->
<div class="pj-view-tabs" id="pj-scope-toggle">
{# 2026-10-08 — 토글은 숨기고 왼쪽 메뉴 "전체 보기"(관리자만, ?scope=all)로 바꿈. 상태 보관용으로만 남김 #}
<div class="pj-view-tabs" id="pj-scope-toggle" style="display:none">
<button type="button" class="pj-tab is-active" data-scope="project">이 프로젝트</button>
<button type="button" class="pj-tab" data-scope="all">전체 프로젝트</button>
</div>
@@ -355,6 +356,9 @@
<button type="button" class="pj-desc-fmtbtn" data-cmd="italic" title="기울임 (Ctrl+I)"><span class="material-symbols-outlined">format_italic</span></button>
<button type="button" class="pj-desc-fmtbtn" data-cmd="underline" title="밑줄 (Ctrl+U)"><span class="material-symbols-outlined">format_underlined</span></button>
<button type="button" class="pj-desc-fmtbtn" data-cmd="strikeThrough" title="취소선 (Ctrl+Shift+X)"><span class="material-symbols-outlined">format_strikethrough</span></button>
{# 글자 색·크기(2026-10-08) — 누르면 고르는 창(body 에 붙음). 저장 때 서버가 span 의 color·font-size 만 남긴다 #}
<button type="button" class="pj-desc-fmtbtn" data-cmd="textColor" title="글자 색"><span class="material-symbols-outlined">format_color_text</span></button>
<button type="button" class="pj-desc-fmtbtn" data-cmd="textSize" title="글자 크기"><span class="material-symbols-outlined">format_size</span></button>
<span class="pj-desc-fmtsep"></span>
<button type="button" class="pj-desc-fmtbtn" data-cmd="insertUnorderedList" title="글머리 기호 목록"><span class="material-symbols-outlined">format_list_bulleted</span></button>
<button type="button" class="pj-desc-fmtbtn" data-cmd="insertOrderedList" title="번호 매기기 목록"><span class="material-symbols-outlined">format_list_numbered</span></button>
@@ -484,5 +488,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261003f" />
<link rel="stylesheet" href="/static/project.css?v=20261008c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007m" defer></script>
<script src="/static/project.js?v=20261008c" defer></script>
{% endblock %}
+34 -6
View File
@@ -315,7 +315,8 @@ html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important;
border-bottom: 1px solid #e2e4ea;
}
/* 세션 제목 — 아사나 보드의 16px/20px, 굵기 500 */
.pj-col-name { font-size: var(--pj-section-size); font-weight: 500; line-height: var(--pj-section-leading); }
/* 섹션 이름은 굵게(2026-10-08) */
.pj-col-name { font-size: var(--pj-section-size); font-weight: 700; line-height: var(--pj-section-leading); }
/* 세션 기본 담당자 아이콘 — 이름 옆에 작게 */
.pj-col-assignee { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pj-col-assignee .pj-avatar { width: 20px; height: 20px; box-shadow: 0 0 0 1.5px #fff; }
@@ -331,7 +332,7 @@ html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important;
.pj-col-name.pj-col-name-editable:hover { background: rgba(0,0,0,.06); }
.pj-col-head-colored .pj-col-name.pj-col-name-editable:hover { background: rgba(255,255,255,.22); }
.pj-col-name-input {
font: inherit; font-size: var(--pj-section-size); font-weight: 500; color: var(--pj-ink);
font: inherit; font-size: var(--pj-section-size); font-weight: 700; color: var(--pj-ink);
min-width: 0; flex: 1 1 auto; max-width: 70%; padding: 2px 6px;
border: 1px solid var(--pj-accent); border-radius: 6px; background: #fff; outline: none; line-height: var(--pj-section-leading);
}
@@ -499,6 +500,7 @@ html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important;
border-bottom: 1px solid var(--pj-border) !important; white-space: nowrap; line-height: var(--pj-section-leading);
}
.pj-list-group-caret { font-size: 18px; color: var(--pj-ink-soft); }
.pj-list-group-name { font-weight: 700; }
.pj-list-group-count {
color: var(--pj-ink-soft); font-weight: 700; font-size: 11px; background: #eef0f2;
border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px;
@@ -899,7 +901,8 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-btn-complete.is-done { background: #f2f2f4; color: #6b6f76; border-color: var(--pj-border); }
/* 색상표(아사나) — 8칸씩 둥근 네모, 고른 색엔 체크 */
.pj-color-palette, #pj-f-colors { display: grid; grid-template-columns: repeat(8, 26px); gap: 8px; margin-top: 6px; }
/* 12칸씩(2026-10-08) — 32색이 3줄 */
.pj-color-palette, #pj-f-colors { display: grid; grid-template-columns: repeat(12, 26px); gap: 8px; margin-top: 6px; }
.pj-color-swatch {
position: relative; width: 26px; height: 26px; padding: 0; border: none; border-radius: 6px; cursor: pointer;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
@@ -912,10 +915,22 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
}
.pj-color-swatch.is-dark.is-active::after { color: #fff; }
/* 프로젝트 아이콘 고르기(아사나) — 회색 아이콘 격자, 고른 것은 보라 강조. 길면 칸 안에서 스크롤 */
.pj-icon-palette {
.pj-icon-palette { margin-top: 6px; }
.pj-icon-grid {
/* 높이 제한 없음 — 아이콘 전부가 스크롤 없이 보이고 팝업이 그만큼 길어진다 */
display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 6px; margin-top: 6px; padding: 2px;
display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 6px; padding: 2px;
}
/* [기본 아이콘] [아사나 아이콘] 탭 — "아이콘" 글자 오른쪽 */
.pj-icon-tabs { display: inline-flex; gap: 2px; margin-left: 10px; padding: 2px; border-radius: 8px; background: #f1f2f4; vertical-align: middle; }
.pj-icon-tab { border: none; background: transparent; padding: 3px 10px; border-radius: 6px; font: inherit; font-size: 12.5px; color: var(--pj-ink-soft); cursor: pointer; }
.pj-icon-tab:hover { color: var(--pj-ink); }
.pj-icon-tab.is-active { background: #fff; color: var(--pj-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
/* 아사나 아이콘 — 채워진 모양(Material Symbols FILL 1, 쓰는 33개만 담은 글꼴). 값은 "asana:이름" */
@font-face {
font-family: "Material Symbols Asana"; font-style: normal; font-weight: 400; font-display: block;
src: url(/static/vendor/material-symbols/material-symbols-asana.woff2) format("woff2");
}
.material-symbols-outlined.pj-ic-asana { font-family: "Material Symbols Asana"; }
.pj-icon-pick {
width: 38px; height: 38px; padding: 0; border: none; border-radius: 8px; background: transparent;
color: #6d6e6f; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
@@ -1145,7 +1160,7 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
/* ── 보드 단계 컨트롤 ── */
.pj-col-head { position: relative; }
.pj-col-name { font-weight: 500; font-size: var(--pj-section-size); line-height: var(--pj-section-leading); }
.pj-col-name { font-weight: 700; font-size: var(--pj-section-size); line-height: var(--pj-section-leading); }
.pj-icon-btn[disabled] { opacity: .3; cursor: default; }
.pj-add-stage { width: 100%; padding: 10px; border: 1px dashed #c9cdd3; border-radius: 12px; background: #fff; color: #6b7280; font-size: 13px; font-weight: 600; cursor: pointer; }
.pj-add-stage:hover { border-color: #1e1f21; color: #1e1f21; }
@@ -3009,3 +3024,16 @@ html[data-pj-font="nanum-square-round"] { --pj-font: "NanumSquareRound", var(--p
.pj-notifier-back:hover { color: var(--pj-accent-dark); text-decoration: underline; }
.pj-inbox-notifier { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.pj-inbox-notifier .material-symbols-outlined { font-size: 18px; }
/* 설명란 글자 색·크기 고르기(2026-10-08) — body 에 붙는 작은 창 */
.pj-desc-stylepop {
position: fixed; z-index: 1200; display: flex; gap: 4px; padding: 6px; background: #fff;
border: 1px solid var(--pj-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .16);
}
.pj-desc-stylepop.is-size { flex-direction: column; min-width: 120px; }
.pj-desc-stylepop button {
border: none; background: transparent; border-radius: 6px; cursor: pointer; font: inherit; color: var(--pj-ink);
padding: 4px 8px; text-align: left; line-height: 1.3;
}
.pj-desc-stylepop button:hover { background: #f1f2f4; }
.pj-desc-colorchip { display: inline-block; width: 22px; text-align: center; font-weight: 700; font-size: 15px; }
+166 -20
View File
@@ -1202,29 +1202,57 @@
return function () { return selected; };
}
// ── 프로젝트 아이콘(아사나식) — window.PJ_ICONS(Material Symbols 이름) 격자.
// 첫 칸 "Aa" = 아이콘 없음(프로젝트 색 + 이름 첫 글자). 반환 = 지금 고른 이름("" = 없음).
// ── 프로젝트 아이콘(아사나식) — [기본 아이콘] window.PJ_ICONS(Material Symbols 외곽선) /
// [아사나 아이콘] window.PJ_ASANA_ICONS(채워진 모양, 값은 "asana:" + 이름) 두 탭. 탭은 "아이콘" 글자 오른쪽(.pj-icon-tabs).
// 첫 칸 "Aa" = 아이콘 없음(프로젝트 색 + 이름 첫 글자). 반환 = 지금 고른 값("" = 없음).
const ASANA_IC = "asana:";
function projIconSpan(icon, cls) {
const v = String(icon || ""), a = v.indexOf(ASANA_IC) === 0;
return '<span class="material-symbols-outlined' + (cls ? " " + cls : "") + (a ? " pj-ic-asana" : "") + '">' +
escapeHtml(a ? v.slice(ASANA_IC.length) : v) + "</span>";
}
function renderIconPalette(container, initial) {
if (!container) return function () { return ""; };
const icons = window.PJ_ICONS || [];
let selected = initial && icons.indexOf(initial) >= 0 ? initial : "";
container.innerHTML = [""].concat(icons).map(function (ic) {
return '<button type="button" class="pj-icon-pick' + (ic === selected ? " is-active" : "") +
'" data-icon="' + ic + '" title="' + (ic ? "아이콘" : "아이콘 없음(첫 글자)") + '">' +
(ic ? '<span class="material-symbols-outlined">' + ic + "</span>" : '<span class="pj-icon-pick-aa">Aa</span>') +
"</button>";
}).join("");
container.querySelectorAll(".pj-icon-pick").forEach(function (b) {
b.addEventListener("click", function () {
selected = b.dataset.icon;
container.querySelectorAll(".pj-icon-pick").forEach(function (x) { x.classList.toggle("is-active", x === b); });
});
});
const basic = window.PJ_ICONS || [];
const asana = (window.PJ_ASANA_ICONS || []).map(function (n) { return ASANA_IC + n; });
const known = basic.concat(asana);
let selected = initial && known.indexOf(initial) >= 0 ? initial : "";
let tab = selected.indexOf(ASANA_IC) === 0 ? "asana" : "basic";
const tabsHost = container.parentElement && container.parentElement.querySelector(".pj-icon-tabs");
function paint() {
if (tabsHost) {
tabsHost.innerHTML = asana.length
? '<button type="button" class="pj-icon-tab' + (tab === "basic" ? " is-active" : "") + '" data-tab="basic">기본 아이콘</button>' +
'<button type="button" class="pj-icon-tab' + (tab === "asana" ? " is-active" : "") + '" data-tab="asana">아사나 아이콘</button>'
: "";
}
const list = tab === "asana" ? asana : basic;
container.innerHTML = '<div class="pj-icon-grid">' + [""].concat(list).map(function (ic) {
return '<button type="button" class="pj-icon-pick' + (ic === selected ? " is-active" : "") +
'" data-icon="' + escapeHtml(ic) + '" title="' + (ic ? "아이콘" : "아이콘 없음(첫 글자)") + '">' +
(ic ? projIconSpan(ic) : '<span class="pj-icon-pick-aa">Aa</span>') + "</button>";
}).join("") + "</div>";
}
container.onclick = function (e) {
const b = e.target.closest(".pj-icon-pick");
if (!b) return;
selected = b.dataset.icon;
container.querySelectorAll(".pj-icon-pick").forEach(function (x) { x.classList.toggle("is-active", x === b); });
};
if (tabsHost) {
tabsHost.onclick = function (e) {
const t = e.target.closest(".pj-icon-tab");
if (!t || t.dataset.tab === tab) return;
tab = t.dataset.tab;
paint();
};
}
paint();
return function () { return selected; };
}
// 프로젝트 배지 안쪽 — 아이콘이 있으면 흰 아이콘, 없으면 이름 첫 글자(사이드바 목록·제목 공용).
function projBadgeInner(p) {
if (p && p.icon) return '<span class="material-symbols-outlined pj-proj-ic">' + escapeHtml(p.icon) + "</span>";
if (p && p.icon) return projIconSpan(p.icon, "pj-proj-ic");
return escapeHtml(((p && p.name) || "?").trim().charAt(0).toUpperCase() || "?");
}
@@ -3112,7 +3140,7 @@
const pillEl = document.querySelector(".pj-project-title-pill");
if (pillEl) {
pillEl.innerHTML =
'<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon || "folder") + "</span>" +
projIconSpan(currentProject.icon || "folder", "pj-pill-ic") +
'<span class="pj-pill-name">' + escapeHtml(currentProject.name || "") + "</span>";
pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2");
pillEl.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2"));
@@ -3365,6 +3393,32 @@
});
}
if (moveScopeHighlight) moveScopeHighlight(false);
// 전체 보기(2026-10-08) — 오른쪽 위 토글 대신 왼쪽 메뉴 "전체 보기"(관리자만, ?scope=all). 토글은 숨겨 두고 상태만 쓴다.
const allViewLink = el("pj-side-allview");
function applyAllScope(on) {
viewScope = on ? "all" : "project";
if (scopeToggle) scopeToggle.querySelectorAll("[data-scope]").forEach(function (b) {
b.classList.toggle("is-active", b.dataset.scope === viewScope);
});
const titleWrap = el("pj-title-wrap");
if (titleWrap) titleWrap.classList.toggle("is-all-scope", on);
if (allViewLink) allViewLink.classList.toggle("is-active", on);
document.querySelectorAll(".pj-tree-li[data-id='" + projectId + "'] > .pj-tree-row").forEach(function (r) {
r.classList.toggle("is-active", !on);
});
}
if (isAdmin && new URLSearchParams(location.search).get("scope") === "all") applyAllScope(true); // 첫 그리기 전에
if (allViewLink && isAdmin) {
allViewLink.addEventListener("click", function (e) {
if (e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1) return;
e.preventDefault(); // 같은 화면 안에서 바로 전환
applyAllScope(true);
try { const u = new URL(location.href); u.searchParams.set("scope", "all"); history.replaceState(null, "", u); } catch (_) {}
fillAssigneeFilter();
renderView(currentView);
updateFilterSummary();
});
}
let calResizeTimer = null;
window.addEventListener("resize", function () {
@@ -7479,6 +7533,11 @@
});
return;
}
// 글자 색·크기 — 고르는 창을 띄우고, 고르면 선택한 글자에 적용
if (cmd === "textColor" || cmd === "textSize") {
openStylePop(btn, cmd);
return;
}
// 체크리스트 — 글머리 목록처럼 켜고 끈다(줄마다 체크박스).
if (cmd === "insertCheckbox") {
toggleChecklist();
@@ -7500,10 +7559,92 @@
if (cmd === "createLink") normalizeEditorLinks(box);
updateFmtState();
});
// ── 글자 색·크기(2026-10-08) — execCommand 가 만든 <font> 를 곧바로 <span style> 로 바꾼다
// (서버 sanitize 는 span 의 color·font-size 만 받는다, store.desc_inline_style). "기본"은 표시용 색(#010203)·
// 크기 7 로 한 번 감싼 뒤 그 범위 안의 색/크기를 모두 지운다.
const TEXT_COLORS = [
["", "기본"], ["#e03e3e", "빨강"], ["#d9730d", "주황"], ["#dfab01", "노랑"], ["#0f7b6c", "초록"],
["#0b6e99", "파랑"], ["#4573d2", "하늘"], ["#6940a5", "보라"], ["#ad1a72", "분홍"], ["#787774", "회색"],
];
const TEXT_SIZES = [["12px", "작게"], ["", "보통"], ["18px", "크게"], ["22px", "더 크게"], ["28px", "제목"]];
const RESET_COLOR = "#010203";
let stylePop = null;
function closeStylePop() {
if (!stylePop) return;
stylePop.remove();
stylePop = null;
document.removeEventListener("mousedown", onStyleDoc, true);
}
function onStyleDoc(e) { if (stylePop && !stylePop.contains(e.target) && !e.target.closest(".pj-desc-fmtbtn")) closeStylePop(); }
function stripInside(node, prop) {
node.querySelectorAll("span[style]").forEach(function (sp) {
sp.style.removeProperty(prop);
if (!sp.getAttribute("style")) sp.removeAttribute("style");
});
}
function fontsToSpans(kind, value) {
box.querySelectorAll("font").forEach(function (f) {
const span = document.createElement("span");
const c = (f.getAttribute("color") || "").toLowerCase(), sz = f.getAttribute("size");
while (f.firstChild) span.appendChild(f.firstChild);
if (c) {
if (kind === "color") stripInside(span, "color");
if (c !== RESET_COLOR) span.style.color = c;
}
if (sz === "7" && kind === "size") {
stripInside(span, "font-size");
if (value) span.style.fontSize = value;
}
if (span.getAttribute("style")) f.replaceWith(span);
else f.replaceWith.apply(f, Array.prototype.slice.call(span.childNodes));
});
}
function applyTextStyle(kind, value, range) {
box.focus();
const sel = window.getSelection();
if (range) { sel.removeAllRanges(); sel.addRange(range); }
if (!sel.rangeCount || sel.isCollapsed) { showToast("바꿀 글자를 먼저 선택하세요.", "info"); return; }
try { document.execCommand("styleWithCSS", false, false); } catch (_) {}
try {
if (kind === "color") document.execCommand("foreColor", false, value || RESET_COLOR);
else document.execCommand("fontSize", false, "7");
} catch (_) {}
fontsToSpans(kind, value);
box.dispatchEvent(new Event("input", { bubbles: true }));
}
function openStylePop(btn, cmd) {
if (stylePop) { const same = stylePop.dataset.cmd === cmd; closeStylePop(); if (same) return; }
const sel = window.getSelection();
const range = sel && sel.rangeCount && box.contains(sel.anchorNode) ? sel.getRangeAt(0).cloneRange() : null;
stylePop = document.createElement("div");
stylePop.className = "pj-desc-stylepop" + (cmd === "textColor" ? " is-color" : " is-size");
stylePop.dataset.cmd = cmd;
stylePop.innerHTML = cmd === "textColor"
? TEXT_COLORS.map(function (c) {
return '<button type="button" data-v="' + c[0] + '" title="' + c[1] + '">' +
'<span class="pj-desc-colorchip" style="color:' + (c[0] || "var(--pj-ink)") + '">가</span></button>';
}).join("")
: TEXT_SIZES.map(function (z) {
return '<button type="button" data-v="' + z[0] + '"><span style="font-size:' + (z[0] || "var(--pj-text-size)") + '">' + z[1] + "</span></button>";
}).join("");
document.body.appendChild(stylePop); // 화면 배율(.pj-ui-scale) 밖 — body 에
const r = btn.getBoundingClientRect();
stylePop.style.left = Math.max(8, Math.min(r.left, document.documentElement.clientWidth - stylePop.offsetWidth - 8)) + "px";
stylePop.style.top = (r.bottom + 4) + "px";
stylePop.addEventListener("mousedown", function (e) { e.preventDefault(); }); // 편집칸 선택 유지
stylePop.addEventListener("click", function (e) {
const b = e.target.closest("button[data-v]");
if (!b) return;
applyTextStyle(cmd === "textColor" ? "color" : "size", b.dataset.v, range);
closeStylePop();
updateFmtState();
});
setTimeout(function () { document.addEventListener("mousedown", onStyleDoc, true); }, 0);
}
function updateFmtState() {
fmtbar.querySelectorAll(".pj-desc-fmtbtn[data-cmd]").forEach(function (btn) {
const cmd = btn.dataset.cmd;
if (cmd === "createLink" || cmd === "removeFormat") return;
if (cmd === "createLink" || cmd === "removeFormat" || cmd === "textColor" || cmd === "textSize") return;
const inChecklist = !!closestIn(selNode(), "ul.pj-checklist");
let active = false;
if (cmd === "insertCheckbox") active = inChecklist;
@@ -8490,7 +8631,12 @@
// 캡처 단계 — 각 목록의 읽음 처리(버블 단계)는 그대로 돈다.
document.addEventListener("click", function (e) {
const a = e.target.closest && e.target.closest(".pj-inbox-go[data-task-id]");
if (!a) return;
if (!a) {
// 작업 창이 열린 채 왼쪽 수신함 영역을 누르면 작업 창을 닫는다(2026-10-08). 메뉴·모달·알림 팝업 안은 제외.
if (panel && panel.classList.contains("is-open") && e.target.closest &&
e.target.closest(".pj-inbox-view") && !e.target.closest(".pj-inbox-panel, .pj-modal, .pj-ctxmenu, .pj-alert-pop")) close();
return;
}
if (e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1) return; // 새 탭 열기는 그대로
e.preventDefault();
open(a.getAttribute("href"), a.closest(".pj-inbox-item"));
Binary file not shown.
+17
View File
@@ -1067,6 +1067,23 @@ Windows 트레이 프로그램 **DBX 알림**(`desktop/notifier/`, C# .NET Frame
3분쯤 뒤 그 뒤에 온 알림부터 웹 팝업이 다시 뜬다. 사용자 단위(어느 PC 에서 켰든 모든 브라우저 팝업이 쉼). 확인 실패면 웹 팝업 그대로.
- 023 미적용이면 화면은 안내만, notifier API 는 503.
## 6-12. 아사나 아이콘 · 색 12열 · 섹션 굵게 · 전체 보기 메뉴 · 설명란 글자 색/크기 (2026-10-08, 마이그레이션 없음)
- **프로젝트 색상표** 12칸씩(32색 = 3줄). **아이콘** 머리 "아이콘" 오른쪽 탭 [기본 아이콘](`PROJECT_ICONS`, 외곽선) /
[아사나 아이콘](`PROJECT_ASANA_ICONS` 33개, 채워진 모양). 아사나 아이콘 값은 `"asana:" + 이름`(`projects.icon` TEXT 그대로),
`validate_project_icon` 이 두 목록만 허용. 채워진 모양은 그 33개만 담은 글꼴
`static/vendor/material-symbols/material-symbols-asana.woff2`(Google Fonts `FILL 1` + `icon_names=` 부분 글꼴, 약 6KB) —
`.material-symbols-outlined.pj-ic-asana`. 목록을 늘리면 글꼴도 그 이름들로 다시 받는다. 그리는 곳: `projIconSpan`(JS)·
`_side.html`·`project.html` 제목 알약.
- **섹션 이름 굵게**(보드 `.pj-col-name`, 목록 묶음 `.pj-list-group-name`, 이름 바꾸기 칸).
- **전체 보기**: 프로젝트 화면 오른쪽 위 범위 토글(`#pj-scope-toggle`)은 숨기고, 왼쪽 메뉴 수신함 아래 **전체 보기**(관리자만,
`#pj-side-allview`) — 지금 프로젝트(없으면 목록 첫 활성 프로젝트) `/project/p/{id}?scope=all`. 프로젝트 화면에서는 새로고침 없이
`applyAllScope(true)`. `?scope=all` 은 `data-is-admin` 일 때만 따른다. 이 프로젝트로 돌아가기 = 왼쪽 목록에서 프로젝트.
- **수신함 작업 창**: [확인]으로 연 오른쪽 작업 창은 왼쪽 수신함 영역(`.pj-inbox-view`)을 누르면 닫힌다(메뉴·모달·알림 팝업 제외).
- **설명란 글자 색·크기**: 서식 도구 [글자 색](10색, 기본)·[글자 크기](작게 12px·보통·크게 18px·더 크게 22px·제목 28px).
`execCommand` 가 만든 `<font>` 를 바로 `<span style>` 로 바꾸고, 서버 `sanitize_description_html` 은 평범한 span 의 style 에서
`color`(#hex·rgb()) 와 `font-size`(`DESC_FONT_SIZES`)만 다시 조립해 남긴다(`desc_inline_style`). 멘션 칩·다른 태그의 style 은 버림.
## 7. 추후 단계
작업 라벨(태그 분류) · 반복 작업 · 템플릿 · 작업 의존성 · 하위 작업의 하위 작업(다단계 중첩,
+17 -8
View File
@@ -431,7 +431,7 @@ function meetServer(env, st) {
env.d.querySelectorAll(".pj-meet-plan-head .pj-meet-kpiline .pj-meet-kpi").length === 4 && !env.d.querySelector(".pj-meet-top"));
});
// ════════════════════ [2e] 주차별 매출 목표(020) — 매출 목표 칸 → 주차 입력 창(body), 저장하면 합계가 월 목표 ════════════════════
// ════════════════════ [2e] 주차별 매출 목표(020) — 매출 목표 칸 → 입력 창(body): 월 전체 목표 직접 입력 + 주차별 + 차이 ════════════════════
await section(async function () {
const env = makeEnv(PAGE.goals_weekly_admin, GOALS_URL);
const st = goalsServer(env);
@@ -440,23 +440,32 @@ function meetServer(env, st) {
sent = body;
const weeks = {};
Object.keys(body.weeks).forEach(function (k) { weeks[k] = body.weeks[k]; });
return { body: { ok: true, value: 600, label: "600", weeks: weeks } };
return { body: { ok: true, value: Number(body.month), label: body.month, week_total: 600, weeks: weeks } };
});
await boot(env);
const inp = env.d.querySelector('input.pj-goal-num[data-metric="sales"][data-kind="target"][data-month="1"]');
check("[2e] 매출 목표 칸은 직접 입력 아님(readonly)", inp.readOnly && inp.dataset.weekly === "1");
const before = inp.value;
inp.click();
const pop = env.d.body.querySelector(".pj-goal-wkpop");
const ins = pop ? Array.from(pop.querySelectorAll("input")) : [];
check("[2e] 창은 body 에, 1월 주차 수만큼 입력칸", !!pop && pop.parentElement === env.d.body && ins.length === 5, ins.length);
const month = pop && pop.querySelector("input[data-month-total]");
const ins = pop ? Array.from(pop.querySelectorAll("input[data-start]")) : [];
check("[2e] 창은 body 에, 월 전체 목표 칸 + 1월 주차 수만큼 입력칸", !!pop && pop.parentElement === env.d.body && !!month && ins.length === 5, ins.length);
check("[2e] 월 전체 목표 칸 = 지금 월 목표", month && month.value === before, { month: month && month.value, before: before });
check("[2e] 주차 날 수 표시(1월 1주차 1/1~1/4 = 4일)", pop.querySelector(".pj-goal-wkpop-days").textContent === "4일", pop.querySelector(".pj-goal-wkpop-days").textContent);
check("[2e] 저장된 주차 값·합계", ins[0].value === "100" && ins[1].value === "200" && pop.querySelector(".pj-goal-wkpop-sum b").textContent === "300");
const sumEl = pop.querySelector('[data-sum="weeks"]'), diffEl = pop.querySelector('[data-sum="diff"]');
check("[2e] 저장된 주차 값·주차 합계", ins[0].value === "100" && ins[1].value === "200" && sumEl.textContent === "300", sumEl.textContent);
type(env, ins[2], "300");
check("[2e] 입력하면 합계 다시 계산", pop.querySelector(".pj-goal-wkpop-sum b").textContent === "600");
check("[2e] 입력하면 주차 합계 다시 계산", sumEl.textContent === "600", sumEl.textContent);
type(env, month, "700");
check("[2e] 차이 = 월 목표 − 주차 합계(+ 남음)", diffEl.textContent === "+100" && diffEl.classList.contains("is-left"), diffEl.textContent);
type(env, month, "500");
check("[2e] 주차 합계가 넘으면 −", diffEl.textContent === "-100" && diffEl.classList.contains("is-over"), diffEl.textContent);
type(env, month, "700");
pop.querySelector('[data-act="save"]').click();
await settle(); await wait(10); await settle();
check("[2e] 주차별 값 전송(주차 시작일 키)", sent && sent.weeks["2026-01-12"] === "300" && Object.keys(sent.weeks).length === 5, sent);
check("[2e] 월 목표 칸 = 합계, 창 닫힘", inp.value === "600" && !env.d.body.querySelector(".pj-goal-wkpop"));
check("[2e] 월 목표·주차별 값 전송(주차 시작일 키)", sent && sent.month === "700" && sent.weeks["2026-01-12"] === "300" && Object.keys(sent.weeks).length === 5, sent);
check("[2e] 월 목표 칸 = 입력한 월 목표(주차 합계 아님), 창 닫힘", inp.value === "700" && !env.d.body.querySelector(".pj-goal-wkpop"), inp.value);
check("[2e] 월 목표 직접 저장 요청 없음", !st.metric);
});
+44
View File
@@ -0,0 +1,44 @@
"""아사나 아이콘 값 검증 · 설명란 글자 색/크기 sanitize (2026-10-08)."""
import importlib
import unittest
store = importlib.import_module("app.modules.project.store")
class ProjectIconTests(unittest.TestCase):
def test_basic_and_asana_icons_accepted(self):
self.assertEqual(store.validate_project_icon("rocket_launch"), "rocket_launch")
self.assertEqual(store.validate_project_icon("asana:rocket_launch"), "asana:rocket_launch")
def test_unknown_or_malformed_rejected(self):
for v in ("asana:", "asana:nope", "asana:asana:rocket_launch", "nope", "Asana:rocket_launch", ""):
self.assertIsNone(store.validate_project_icon(v), v)
class DescStyleTests(unittest.TestCase):
def clean(self, html):
return store.sanitize_description_html(html)
def test_color_and_allowed_size_kept(self):
out = self.clean('<span style="color: rgb(224, 62, 62); font-size: 22px">a</span><span style="color:#ABC">b</span>')
self.assertEqual(out, '<span style="color: rgb(224, 62, 62); font-size: 22px">a</span><span style="color: #abc">b</span>')
def test_other_declarations_and_sizes_dropped(self):
out = self.clean('<span style="background:url(javascript:x); font-size: 99px; color: red; position:fixed">a</span>')
self.assertEqual(out, "<span>a</span>")
def test_style_injection_attempts_dropped(self):
out = self.clean('<span style="color: #fff;}body{display:none">a</span>'
'<span style="color: expression(alert(1))">b</span>')
# 선언을 다시 조립하므로 "}body{…" 같은 나머지는 사라지고 검증된 색만 남는다
self.assertEqual(out, '<span style="color: #fff">a</span><span>b</span>')
def test_style_only_on_plain_span(self):
self.assertEqual(self.clean('<p style="color:#fff">a</p>'), "<p>a</p>")
self.assertEqual(self.clean('<span class="pj-mention" data-email="a@b.c" style="color:#fff">@a</span>'),
'<span class="pj-mention" data-email="a@b.c">@a</span>')
self.assertEqual(self.clean('<font color="#ff0000">a</font>'), "a")
if __name__ == "__main__":
unittest.main()