Skip to content

Commit

Permalink
Make update image title generic
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSchmitt96 committed Sep 11, 2023
1 parent 512e2d9 commit 849ec33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion movie_bet_bot/models/movies/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def to_standings_image_html(
# add 175px to height of image per member with film update
html_height += 175
image_html = images.build_html_standings_block(
time=self.time_last_update.strftime("%m/%d %H:%M"),
title=f"Standings as of {self.time_last_update.strftime('%m/%d %H:%M')}",
members=html_members,
updates=html_updates,
show_update=show_last_update,
Expand Down
2 changes: 1 addition & 1 deletion movie_bet_bot/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{head}
</head>
<body>
<p class="{title_class}">Standings as of {time}</p>
<p class="{title_class}">{title}</p>
<div class="members {members_class}">
{members}
</div>
Expand Down
5 changes: 3 additions & 2 deletions movie_bet_bot/utils/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ def build_html_standings_update_films_block(poster: str, rating: str) -> str:
def build_html_standings_block(
members: str,
updates: str,
time: str,
title: str,
title_class: str = "",
members_class: str = "",
show_update: bool = True,
):
return constants.HTML_STANDINGS_TEMPLATE.format(
head=constants.HTML_HEAD,
time=time,
title=title,
members=members,
updates=updates,
updates_head_class="" if show_update else "hidden",
Expand All @@ -128,6 +128,7 @@ def build_html_avg_watchtimes_block(
):
return constants.HTML_STANDINGS_TEMPLATE.format(
head=constants.HTML_HEAD,
title="Average Watchtimes",
members=members,
updates="",
updates_head_class="hidden",
Expand Down

0 comments on commit 849ec33

Please sign in to comment.