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

Added record certification icon on web interface

This commit is contained in:
Krateng 2019-06-13 12:12:47 +02:00
parent 746475390f
commit b4a6036c0e
7 changed files with 12 additions and 2 deletions

View File

@ -550,7 +550,7 @@ def trackInfo(track):
scrobbles = c["scrobbles"]
position = c["rank"]
cert = None
threshold_gold, threshold_platinum, threshold_diamond = settings.get_settings("SCROBBLES_GOLD","SCROBBLES_PLATINUM","SCROBBLES_PLATINUM")
threshold_gold, threshold_platinum, threshold_diamond = settings.get_settings("SCROBBLES_GOLD","SCROBBLES_PLATINUM","SCROBBLES_DIAMOND")
if scrobbles >= threshold_diamond: cert = "diamond"
elif scrobbles >= threshold_platinum: cert = "platinum"
elif scrobbles >= threshold_gold: cert = "gold"

View File

@ -375,6 +375,12 @@ a.bronze {
img.certrecord {
height:30px;
vertical-align: text-bottom;
}
/*
**
**

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -15,7 +15,7 @@
</td>
<td class="text">
<span>KEY_ARTISTS</span><br/>
<h1>KEY_TRACKTITLE</h1> <span class="rank"><a href="/charts_tracks?max=100">KEY_POSITION</a></span>
<h1>KEY_TRACKTITLE</h1> KEY_CERTS <span class="rank"><a href="/charts_tracks?max=100">KEY_POSITION</a></span>
<p class="stats"><a href="/scrobbles?KEY_SCROBBLELINK">KEY_SCROBBLES Scrobbles</a></p>

View File

@ -21,6 +21,9 @@ def instructions(keys):
scrobblesnum = str(data["scrobbles"])
pos = "#" + str(data["position"])
html_cert = ""
if data["certification"] is not None:
html_cert = "<img class='certrecord' src='/media/record_{cert}.png' title='This track has reached {certc} status' />".format(cert=data["certification"],certc=data["certification"].capitalize())
html_medals = ""
if "medals" in data and data["medals"] is not None:
@ -61,6 +64,7 @@ def instructions(keys):
"KEY_IMAGEURL":imgurl,
"KEY_SCROBBLELINK":compose_querystring(keys),
"KEY_MEDALS":html_medals,
"KEY_CERTS":html_cert,
"KEY_SCROBBLELIST":html_scrobbles,
# pulse
"KEY_PULSE_MONTHS":html_pulse_months,