Add HTML5 focused object review
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 00:54:46 +03:00
parent 6e89cdcd84
commit f830c4290f
3 changed files with 78 additions and 4 deletions
+12 -3
View File
@@ -385,7 +385,14 @@ def render_html5_object_report(
"""
def render_html5_review(project_id: str, findings: list[dict] | None) -> str:
def render_html5_review(
project_id: str,
findings: list[dict] | None,
*,
title: str = "Review",
oob: bool = False,
) -> str:
oob_attr = ' hx-swap-oob="outerHTML"' if oob else ""
if findings is None:
return f"""
<div
@@ -394,8 +401,9 @@ def render_html5_review(project_id: str, findings: list[dict] | None) -> str:
hx-get="/html5/projects/{quote(project_id)}/review"
hx-trigger="load"
hx-swap="outerHTML"
{oob_attr}
>
<div class="panel-title">Review</div>
<div class="panel-title">{escape(title)}</div>
<p class="muted padded">Сервер готовит findings.</p>
</div>
"""
@@ -410,8 +418,9 @@ def render_html5_review(project_id: str, findings: list[dict] | None) -> str:
hx-get="/html5/projects/{quote(project_id)}/review"
hx-trigger="every 20s"
hx-swap="outerHTML"
{oob_attr}
>
<div class="panel-title">Review · {len(findings)}</div>
<div class="panel-title">{escape(title)} · {len(findings)}</div>
<div class="review-list">{body}</div>
</div>
"""