fix(project): retain monthly plan text styles
This commit is contained in:
@@ -3092,11 +3092,12 @@ def _month_plan(st: Any, year: int, month: int) -> list[dict[str, Any]] | None:
|
||||
if not row.get("label_cont"):
|
||||
label = row.get("label") or ""
|
||||
cell = next((c for c in row["layout"] if c["kind"] == "month" and c["m"] <= month <= c["m"] + c["span"] - 1), None)
|
||||
text = store.goal_text_plain(row["cells"].get(cell["m"], "") if cell else "").strip()
|
||||
body = row["cells"].get(cell["m"], "") if cell else ""
|
||||
text = store.goal_text_plain(body).strip()
|
||||
if not text:
|
||||
continue
|
||||
rng = f"{cell['m']}~{cell['m'] + cell['span'] - 1}월" if cell["span"] > 1 else ""
|
||||
items.append({"label": label, "text": text, "range": rng})
|
||||
items.append({"label": label, "text": text, "text_html": store.goal_text_html(body, include_size=False), "range": rng})
|
||||
if items:
|
||||
out.append({"name": area["name"], "color": area["color"], "lines": items}) # 키 lines — 템플릿의 a.items 는 dict.items 메서드
|
||||
return out
|
||||
|
||||
@@ -535,8 +535,9 @@ def goal_text_plain(body: Any) -> str:
|
||||
return "".join(r["text"] for r in goal_text_runs(body))
|
||||
|
||||
|
||||
def goal_text_html(body: Any) -> str:
|
||||
"""허용한 글자 서식만 HTML로 만든다. 사용자 텍스트는 항상 escape한다."""
|
||||
def goal_text_html(body: Any, *, include_size: bool = True) -> str:
|
||||
"""허용한 글자 서식만 HTML로 만든다. 사용자 텍스트는 항상 escape한다.
|
||||
월간 계획 요약에서는 include_size=False로 글자 크기만 화면 기본값을 사용한다."""
|
||||
out = []
|
||||
for run in goal_text_runs(body):
|
||||
style = []
|
||||
@@ -548,7 +549,7 @@ def goal_text_html(body: Any) -> str:
|
||||
style.append("text-decoration:" + ("underline" if run["underline"] else "none"))
|
||||
if "color" in run:
|
||||
style.append("color:" + run["color"])
|
||||
if "size" in run:
|
||||
if include_size and "size" in run:
|
||||
style.append(f'font-size:{run["size"]}px')
|
||||
text = escape(run["text"])
|
||||
out.append(f'<span style="{";".join(style)}">{text}</span>' if style else text)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261003o" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261004b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="pj-meet-plan-area" style="--goal-bg: {{ a.color or '#f4f5f7' }}">
|
||||
<b class="pj-meet-plan-name">{{ a.name }}</b>
|
||||
{% for it in a.lines %}
|
||||
<div class="pj-meet-plan-item">{% if it.label %}<span class="pj-meet-plan-label">{{ it.label }}</span>{% endif %}<span class="pj-meet-plan-text">{{ it.text }}</span>{% if it.range %}<em>{{ it.range }}</em>{% endif %}</div>
|
||||
<div class="pj-meet-plan-item">{% if it.label %}<span class="pj-meet-plan-label">{{ it.label }}</span>{% endif %}<span class="pj-meet-plan-text">{{ it.text_html | safe }}</span>{% if it.range %}<em>{{ it.range }}</em>{% endif %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
@@ -587,7 +587,7 @@
|
||||
</ul>
|
||||
|
||||
<h3 id="meetings-month-plan">이 달 계획 확인</h3>
|
||||
<p>제목 아래 <span class="pjh-ui">해당 월 계획</span>은 연간 목표 표에 적은 월 계획을 업무 영역별로 보여 줍니다. 빈 계획은 생략하고, 병합 칸은 해당 월을 포함하는 계획을 한 번 표시합니다. 여기서는 읽기만 하므로 수정하려면 연간 목표 표로 돌아갑니다.</p>
|
||||
<p>제목 아래 <span class="pjh-ui">해당 월 계획</span>은 연간 목표 표에 적은 월 계획을 업무 영역별로 보여 줍니다. 굵게·기울임·밑줄·글자 색상과 줄바꿈·들여쓰기를 유지하고, 글자 크기는 월 계획의 기본 크기로 표시합니다. 빈 계획은 생략하고, 병합 칸은 해당 월을 포함하는 계획을 한 번 표시합니다. 여기서는 읽기만 하므로 수정하려면 연간 목표 표로 돌아갑니다.</p>
|
||||
|
||||
<h3 id="meetings-kpis">월 목표·누적·주당 필요 매출 읽기</h3>
|
||||
<table class="pjh-table">
|
||||
|
||||
Reference in New Issue
Block a user