1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added weeks on #1 stat to artist and track pages

This commit is contained in:
Krateng
2019-06-27 10:40:38 +02:00
parent ae5b0fc90c
commit 495b00803d
8 changed files with 33 additions and 4 deletions

View File

@@ -41,6 +41,13 @@ def instructions(keys):
html_cert += "<a href='{link}'><img class='certrecord_small' src='{img}' title='{tooltip}' /></a>".format(tooltip=tooltip,img=img,link=tracklink)
html_topweeks = ""
if data.get("topweeks") not in [0,None]:
link = "/performance?artist=" + urllib.parse.quote(keys["artist"]) + "&trail=1&step=week"
title = str(data["topweeks"]) + " weeks on #1"
html_topweeks = "<a title='" + title + "' href='" + link + "'><img class='star' src='/media/star.png' />" + str(data["topweeks"]) + "</a>"
credited = data.get("replace")
includestr = " "
if credited is not None:
@@ -81,6 +88,7 @@ def instructions(keys):
"KEY_ASSOCIATED":includestr,
"KEY_MEDALS":html_medals,
"KEY_CERTS":html_cert,
"KEY_TOPWEEKS":html_topweeks,
# tracks
"KEY_TRACKLIST":html_tracks,
# pulse