Review hypertext: Use placeholder element for icons

This commit is contained in:
rubenwardy 2024-10-08 13:24:17 +01:00
parent 69904dbe81
commit f621cd13d2

@ -328,9 +328,9 @@ def package_reviews_as_hypertext(package: Package, formspec_version: int = 7):
content = html_to_minetest(html, package.get_url("packages.view", absolute=True), content = html_to_minetest(html, package.get_url("packages.view", absolute=True),
formspec_version, False, f"review_{review.id}_")["body"].strip() formspec_version, False, f"review_{review.id}_")["body"].strip()
author = make_link(abs_url_for("users.profile", username=review.author.username), review.author.display_name) author = make_link(abs_url_for("users.profile", username=review.author.username), review.author.display_name)
rating = ["👎", "👎", "-", "👍", "👍"][review.rating - 1] rating = ["<thumbsup>", "<thumbsup>", "<neutral>", "<thumbsup>", "<thumbsup>"][review.rating - 1]
comments = make_link(abs_url_for("threads.view", id=review.thread.id), "Comments") comments = make_link(abs_url_for("threads.view", id=review.thread.id), "Comments")
body += f"{author} {review.rating}\n<big>{escape_hypertext(review.thread.title)}</big>\n{content}\n{comments}\n\n" body += f"{author} {rating}\n<big>{escape_hypertext(review.thread.title)}</big>\n{content}\n{comments}\n\n"
return { return {
"head": HEAD, "head": HEAD,