add sanitize=False to all ui.html elements
This commit is contained in:
@@ -30,7 +30,7 @@ class PlyrVideoPlayer:
|
|||||||
)
|
)
|
||||||
|
|
||||||
with ui.element("div").classes("plyr-container"):
|
with ui.element("div").classes("plyr-container"):
|
||||||
ui.html(video_html)
|
ui.html(video_html, sanitize=False)
|
||||||
|
|
||||||
options = {}
|
options = {}
|
||||||
options.setdefault("settings", [])
|
options.setdefault("settings", [])
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ class ContentCard:
|
|||||||
|
|
||||||
with self.poster_column:
|
with self.poster_column:
|
||||||
with ui.column(wrap=False).classes("w-full").style("gap: 0px; margin: 0; padding: 3px 3px 3px 10px;"):
|
with ui.column(wrap=False).classes("w-full").style("gap: 0px; margin: 0; padding: 3px 3px 3px 10px;"):
|
||||||
ui.html(f"<b>{self.content.title}</b>").style("font-size: 16px")
|
ui.html(f"<b>{self.content.title}</b>", sanitize=False).style("font-size: 16px")
|
||||||
ui.html(f"<i>{self.content.og_title}</i>").style("font-size: 10px")
|
ui.html(f"<i>{self.content.og_title}</i>", sanitize=False).style("font-size: 10px")
|
||||||
|
|
||||||
with ui.column(wrap=True).classes("w-full").style("gap: 0px; margin: 0; padding: 3px 3px 10px 10px"):
|
with ui.column(wrap=True).classes("w-full").style("gap: 0px; margin: 0; padding: 3px 3px 10px 10px"):
|
||||||
ui.html(f"<b><i>{"<br>".join((self.content.genres))}</i></b>").style("font-size: 8px")
|
ui.html(f"<b><i>{"<br>".join(self.content.genres)}</i></b>", sanitize=False).style("font-size: 8px")
|
||||||
|
|
||||||
self.card.on("mouseover", self.on_card_hover)
|
self.card.on("mouseover", self.on_card_hover)
|
||||||
self.card.on("mouseleave", self.on_card_unhover)
|
self.card.on("mouseleave", self.on_card_unhover)
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ class ContentDialog(ui.dialog):
|
|||||||
self.title_column.style("gap: 0; margin: 0; padding: 0;")
|
self.title_column.style("gap: 0; margin: 0; padding: 0;")
|
||||||
|
|
||||||
with self.title_column:
|
with self.title_column:
|
||||||
ui.html(f"<b>{self.content.title}</b>").style("font-size: 22px")
|
ui.html(f"<b>{self.content.title}</b>", sanitize=False).style("font-size: 22px")
|
||||||
ui.html(f"<i>{self.content.og_title}</i>").style("font-size: 14px")
|
ui.html(f"<i>{self.content.og_title}</i>", sanitize=False).style("font-size: 14px")
|
||||||
ui.html(f"<b><i>{", ".join(self.content.genres)}</i></b>").style("font-size: 12px")
|
ui.html(f"<b><i>{", ".join(self.content.genres)}</i></b>", sanitize=False).style("font-size: 12px")
|
||||||
|
|
||||||
with self.card:
|
with self.card:
|
||||||
self.additional_info_column = ui.column(wrap=False)
|
self.additional_info_column = ui.column(wrap=False)
|
||||||
@@ -35,23 +35,23 @@ class ContentDialog(ui.dialog):
|
|||||||
with self.additional_info_column:
|
with self.additional_info_column:
|
||||||
release_date = self.content.release_date.split("-")[::-1]
|
release_date = self.content.release_date.split("-")[::-1]
|
||||||
release_date = ".".join(release_date)
|
release_date = ".".join(release_date)
|
||||||
ui.html(f"<b>Release Date: </b>{release_date}").style("font-size: 12px")
|
ui.html(f"<b>Release Date: </b>{release_date}", sanitize=False).style("font-size: 12px")
|
||||||
ui.html(f"<b>Average Score: </b>{round(self.content.vote_average, 2)}").style("font-size: 12px")
|
ui.html(f"<b>Average Score: </b>{round(self.content.vote_average, 2)}", sanitize=False).style("font-size: 12px")
|
||||||
|
|
||||||
if self.content.type == "movie":
|
if self.content.type == "movie":
|
||||||
budget = "$" + f"{self.content.budget:_}".replace("_", ".")
|
budget = "$" + f"{self.content.budget:_}".replace("_", ".")
|
||||||
ui.html(f"<b>Budget: </b>{budget}").style("font-size: 12px")
|
ui.html(f"<b>Budget: </b>{budget}", sanitize=False).style("font-size: 12px")
|
||||||
ui.html(f"<b>Runtime: </b>{convert_runtime(self.content.runtime)}").style("font-size: 12px")
|
ui.html(f"<b>Runtime: </b>{convert_runtime(self.content.runtime)}", sanitize=False).style("font-size: 12px")
|
||||||
elif self.content.type == "tv":
|
elif self.content.type == "tv":
|
||||||
ui.html(f"<b>Number of Seasons: </b>{self.content.number_of_seasons}").style("font-size: 12px")
|
ui.html(f"<b>Number of Seasons: </b>{self.content.number_of_seasons}", sanitize=False).style("font-size: 12px")
|
||||||
ui.html(f"<b>Number of Episodes: </b>{self.content.number_of_episodes}").style("font-size: 12px")
|
ui.html(f"<b>Number of Episodes: </b>{self.content.number_of_episodes}", sanitize=False).style("font-size: 12px")
|
||||||
total_runtime = sum([ep.runtime for ep in
|
total_runtime = sum([ep.runtime for ep in
|
||||||
itertools.chain.from_iterable([s.episodes for s in self.content.seasons])])
|
itertools.chain.from_iterable([s.episodes for s in self.content.seasons])])
|
||||||
ui.html(f"<b>Total Runtime: </b>{convert_runtime(total_runtime)}").style("font-size: 12px")
|
ui.html(f"<b>Total Runtime: </b>{convert_runtime(total_runtime)}", sanitize=False).style("font-size: 12px")
|
||||||
if self.content.in_production:
|
if self.content.in_production:
|
||||||
ui.html("<b><i>Currently in production</i></b>").style("font-size: 12px")
|
ui.html("<b><i>Currently in production</i></b>", sanitize=False).style("font-size: 12px")
|
||||||
else:
|
else:
|
||||||
ui.html("<b><i>Finished</i></b>").style("font-size: 12px")
|
ui.html("<b><i>Finished</i></b>", sanitize=False).style("font-size: 12px")
|
||||||
|
|
||||||
with self.card, ui.row(wrap=False).classes("w-full").style("display: flex; justify-content: center;"):
|
with self.card, ui.row(wrap=False).classes("w-full").style("display: flex; justify-content: center;"):
|
||||||
ui.button("Create Room").on_click(self.create_room).props("rounded push")
|
ui.button("Create Room").on_click(self.create_room).props("rounded push")
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ async def draw_header():
|
|||||||
|
|
||||||
with ui.row(wrap=False).classes("items-center"):
|
with ui.row(wrap=False).classes("items-center"):
|
||||||
if user := await check_user():
|
if user := await check_user():
|
||||||
ui.html(f"<b>{user.username}</b>")
|
ui.html(f"<b>{user.username}</b>", sanitize=False)
|
||||||
ui.button(icon="logout", on_click=lambda: logout(redirect=True)).props("rounded")
|
ui.button(icon="logout", on_click=lambda: logout(redirect=True)).props("rounded")
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ async def page():
|
|||||||
ui.image(content.poster_url).style("width: 100px; border-radius: 15px")
|
ui.image(content.poster_url).style("width: 100px; border-radius: 15px")
|
||||||
|
|
||||||
with ui.column(wrap=False).style("gap: 0px;"):
|
with ui.column(wrap=False).style("gap: 0px;"):
|
||||||
ui.html(f"{room.uid}")
|
ui.html(f"{room.uid}", sanitize=False)
|
||||||
ui.html(f"<b>{content.title}</b>")
|
ui.html(f"<b>{content.title}</b>", sanitize=False)
|
||||||
|
|
||||||
users = [globals.USERS_DATABASE.by_uid[uid] for uid in room.connected_users]
|
users = [globals.USERS_DATABASE.by_uid[uid] for uid in room.connected_users]
|
||||||
ui.html(f"<i>{", ".join(u.username for u in users)}</i>")
|
ui.html(f"<i>{", ".join(u.username for u in users)}</i>", sanitize=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user