This commit is contained in:
@@ -157,6 +157,8 @@ def check_render() -> None:
|
|||||||
for marker in ("resource-qr-repository", "resource-qr-page"):
|
for marker in ("resource-qr-repository", "resource-qr-page"):
|
||||||
if marker not in html:
|
if marker not in html:
|
||||||
raise AssertionError(f"HTML nie zawiera komórki {marker!r}")
|
raise AssertionError(f"HTML nie zawiera komórki {marker!r}")
|
||||||
|
if html.count('target="_blank" rel="noopener noreferrer"') < 2:
|
||||||
|
raise AssertionError("oba kody QR HTML muszą otwierać bezpieczną nową kartę")
|
||||||
if "PROJECT" not in html:
|
if "PROJECT" not in html:
|
||||||
raise AssertionError("HTML nie zawiera nowej tabliczki projektu")
|
raise AssertionError("HTML nie zawiera nowej tabliczki projektu")
|
||||||
if "resource-qr-label" in html:
|
if "resource-qr-label" in html:
|
||||||
|
|||||||
@@ -3928,6 +3928,7 @@ def render_page_header_html(data: dict, page: int, total: int) -> str:
|
|||||||
if qr:
|
if qr:
|
||||||
return (
|
return (
|
||||||
f'<a class="{classes}" href="{html_escape(target)}" '
|
f'<a class="{classes}" href="{html_escape(target)}" '
|
||||||
|
'target="_blank" rel="noopener noreferrer" '
|
||||||
f'aria-label="{html_escape(label)}: otwórz {html_escape(target)}">'
|
f'aria-label="{html_escape(label)}: otwórz {html_escape(target)}">'
|
||||||
f'{qr}</a>'
|
f'{qr}</a>'
|
||||||
)
|
)
|
||||||
@@ -4458,6 +4459,7 @@ def render_title_block_html(data: dict) -> str:
|
|||||||
qr = qr_svg(str(fields["url"])) if fields["show_qr"] else ""
|
qr = qr_svg(str(fields["url"])) if fields["show_qr"] else ""
|
||||||
qr_cell = (
|
qr_cell = (
|
||||||
f'<a class="title-qr-cell" href="{html_escape(str(fields["url"]))}" '
|
f'<a class="title-qr-cell" href="{html_escape(str(fields["url"]))}" '
|
||||||
|
'target="_blank" rel="noopener noreferrer" '
|
||||||
f'aria-label="Otwórz adres z kodu QR">{qr}</a>'
|
f'aria-label="Otwórz adres z kodu QR">{qr}</a>'
|
||||||
if qr
|
if qr
|
||||||
else '<div class="title-qr-cell title-qr-empty"><span>QR</span><strong>'
|
else '<div class="title-qr-cell title-qr-empty"><span>QR</span><strong>'
|
||||||
|
|||||||
Reference in New Issue
Block a user