Add HTML5 authoring apply summaries
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 02:22:10 +03:00
parent dde672202c
commit 8f2a17b24a
2 changed files with 45 additions and 1 deletions
@@ -837,6 +837,7 @@ def render_html5_authoring_apply_result(project_id: str, result: object | None =
<span>{escape(change_id)}</span>
<small>{escape(version_id)}</small>
</article>
{_authoring_apply_summary("change-set", status, change_id, version_id)}
<p class="muted padded">Change-set применен в workspace для проекта {escape(project_id)}.</p>
</div>
"""
@@ -944,6 +945,7 @@ def render_html5_metadata_apply_result(project_id: str, result: object | None =
<span>{escape(change_id)}</span>
<small>{escape(version_id)}</small>
</article>
{_authoring_apply_summary("metadata", status, change_id, version_id)}
<p class="muted padded">Metadata draft применен в workspace для проекта {escape(project_id)}.</p>
</div>
"""
@@ -1754,6 +1756,18 @@ def _authoring_detail_summary(diff: Iterable[object], checks: Iterable[object],
"""
def _authoring_apply_summary(kind: str, status: str, change_id: str, version_id: str) -> str:
return f"""
<p
class="authoring-summary"
data-html5-authoring-apply-summary
data-html5-authoring-apply-kind="{escape(kind)}"
>
{escape(kind)} · {escape(status or "UNKNOWN")} · {escape(change_id or "change unavailable")} · {escape(version_id or "version unavailable")}
</p>
"""
def _named_node_item(label: str, node: object) -> str:
name = getattr(node, "qualified_name", None) or getattr(node, "name", "")
kind = getattr(node, "kind", label)