Created
January 9, 2021 14:38
-
-
Save wtpayne/f7cc02bd56f0e65f11fb4b76b80a0cad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
def _get_page(title, id_topic, list_id_ui): | |
""" | |
Return the HTML page. | |
""" | |
html = xact.lib.ui.web.markup.html | |
page = html.document(title = title) | |
with page.head: | |
html.meta(charset = 'utf-8') | |
html.meta(name = 'viewport', | |
content = 'width=device-width, initial-scale=1.0') | |
html.link(rel = 'stylesheet', | |
href = ('https://unpkg.com/tailwindcss' | |
'@^2/dist/tailwind.min.css')) | |
html.script(type = 'text/javascript', | |
src = '/htmx') | |
html.script(type = 'text/javascript', | |
src = '/xact_htmx_extension') | |
with page: | |
connect = 'connect:/{id_topic}'.format(id_topic = id_topic) | |
with html.div(data_hx_sse = connect, | |
_class = ('bg-gray-100', 'h-screen')) as parent: | |
for id_ui in list_id_ui: | |
html.div(data_hx_ext = 'xact', | |
data_hx_sse = 'swap:{id}'.format(id = id_ui), | |
data_hx_trigger = 'load', | |
data_hx_get = '/{id}'.format(id = id_ui)) | |
return page | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment