Spaces:
Runtime error
Runtime error
| class HtmlRender: | |
| def __init__( | |
| self | |
| ) -> None: | |
| pass | |
| def output( | |
| self, | |
| html: str | |
| ) -> str: | |
| template = "<center>{}</center>" | |
| return template.format(html) | |
| def error( | |
| self, | |
| html: str | |
| ) -> str: | |
| template = """ | |
| <center> | |
| <div class="alert alert-warning" role="alert"> | |
| <h6><b>{}</b></h6> | |
| </div> | |
| </center> | |
| """ | |
| return template.format(html) | |
| def budget( | |
| self, | |
| text: str, | |
| category: str, | |
| color: str | |
| ) -> str: | |
| html = f""" | |
| <span type="button" title="{category}" class="btn btn-{color} btn-sm"> | |
| <b>{text}</b><br> | |
| <span class="badge badge-pill badge-light">{category}</span> | |
| </span> | |
| """ | |
| return html if text != "" else "" |