From dc2008c5b31c65b2cfc21d04c781ee8b6c62c022 Mon Sep 17 00:00:00 2001 From: king Date: Sat, 3 Oct 2026 05:47:57 +0900 Subject: [PATCH] feat(project): add Excel font controls and reflow --- app/modules/project/store.py | 9 +++- .../templates/project/goal_meeting.html | 2 +- .../project/templates/project/goals.html | 22 ++++++---- .../project/templates/project/help.html | 7 ++-- .../project/templates/project/inbox.html | 2 +- .../project/templates/project/mytasks.html | 2 +- .../project/templates/project/project.html | 2 +- .../project/templates/project/trash.html | 2 +- app/static/project-goal-text.js | 33 ++++++++++++--- app/static/project.css | 38 ++++++++++++----- docs/PROJECT_MODULE.md | 10 +++-- tests/js/goals_meeting_ui.test.js | 42 ++++++++++++++++--- tests/test_project_goal_rich_text.py | 17 ++++++++ 13 files changed, 146 insertions(+), 42 deletions(-) diff --git a/app/modules/project/store.py b/app/modules/project/store.py index fd7263f..138903d 100644 --- a/app/modules/project/store.py +++ b/app/modules/project/store.py @@ -504,8 +504,9 @@ def goal_text_runs(body: Any, *, strict: bool = False) -> list[dict[str, Any]]: if not isinstance(item, dict) or not isinstance(item.get("text"), str): raise ValueError("서식 데이터가 올바르지 않습니다.") run: dict[str, Any] = {"text": item["text"]} - if isinstance(item.get("bold"), bool): - run["bold"] = item["bold"] + for key in ("bold", "italic", "underline"): + if isinstance(item.get(key), bool): + run[key] = item[key] if re.fullmatch(r"#[0-9a-fA-F]{6}", str(item.get("color", ""))): run["color"] = item["color"].lower() size = item.get("size") @@ -533,6 +534,10 @@ def goal_text_html(body: Any) -> str: style = [] if "bold" in run: style.append("font-weight:" + ("700" if run["bold"] else "400")) + if "italic" in run: + style.append("font-style:" + ("italic" if run["italic"] else "normal")) + if "underline" in run: + style.append("text-decoration:" + ("underline" if run["underline"] else "none")) if "color" in run: style.append("color:" + run["color"]) if "size" in run: diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index 7ad31bb..c230e17 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 8dd15da..e45ed6c 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 %} @@ -39,16 +39,24 @@ {% if is_admin and goals_enabled and board %}