import html
from ..config import PORTAL_PREFIX
def page(title: str, body: str) -> str:
return f"""
{html.escape(title)}
{body}
"""
def render_result(title, back_url, sections, extra_link=None, extra_label=None):
rendered_sections = ""
for section_title, content in sections:
rendered_sections += f"""
{html.escape(section_title)}
{html.escape(content)}
"""
extra = ""
if extra_link and extra_label:
extra = f'{html.escape(extra_label)}
'
return page(
title,
f"""
{html.escape(title)}
{extra}
← Zpět
{rendered_sections}
""",
)