Add HTML5 authoring apply summaries
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user