Add HTML5 focused object review
This commit is contained in:
@@ -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>
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user