Update server.py

This commit is contained in:
Nova Cat 2025-03-16 17:48:50 -07:00
parent ff656d650b
commit 874d9827d3

View file

@ -82,7 +82,7 @@ def search():
return render_template("error.html", message="This site has a fursona file, but the JSON doesn't have a \"sonas\" property.", theme=theme), 500
for sona in res["sonas"]:
# Avatar image
img = f'<img src="{sona["avatar"]}" alt="{sona["avatarAlt"]}" title="{sona["avatarAlt"]}" class="card-img-top">' if "avatar" in sona else f'<img src="/fallback.svg" alt="NO AVATAR" title="NO AVATAR" class="card-img-top">'
img = f'<img src="{sona["avatar"]}" alt="{sona["avatarAlt"] if "avatarAlt" in sona else "No alt text"}" title="{sona["avatarAlt"] if "avatarAlt" in sona else "No alt text"}" class="card-img-top">' if "avatar" in sona else f'<img src="/fallback.svg" alt="NO AVATAR" title="NO AVATAR" class="card-img-top">'
if "avatarAttribution" in sona:
img += f'<div class="card-body text-muted">{sona["avatarAttribution"]}</div>'
@ -95,7 +95,7 @@ def search():
# TODO: Replace the info icons with bootstrap-sona logos
colors += f'<svg width="24px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill="{color}" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg> {color}<br><br>'
# Reference sheet (link)
ref = f'<a href="{sona["ref"]}" title="{sona["refAlt"]}" class="btn btn-primary">Reference sheet</a>' if "ref" in sona else ""
ref = f'<a href="{sona["ref"]}" title="{sona["refAlt"] if "refAlt" in sona else "No alt text"}" class="btn btn-primary">Reference sheet</a>' if "ref" in sona else ""
# Age
age = f'<p>Age: {sona["age"]}</p>' if "age" in sona else ""
# Everything else.