From 09b1fd446b6399afb4e685d8ab3835e13e9ec574 Mon Sep 17 00:00:00 2001 From: Krateng Date: Thu, 13 Jun 2019 16:56:41 +0200 Subject: [PATCH] Added info about record certifications to artist page --- website/artist.html | 2 +- website/artist.py | 14 +++++++++++++- website/css/maloja.css | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/website/artist.html b/website/artist.html index 50caf83..b97911a 100644 --- a/website/artist.html +++ b/website/artist.html @@ -21,7 +21,7 @@

KEY_SCROBBLES Scrobbles

KEY_DESCRIPTION

- KEY_MEDALS + KEY_MEDALS KEY_CERTS diff --git a/website/artist.py b/website/artist.py index 46183d4..4db1dc3 100644 --- a/website/artist.py +++ b/website/artist.py @@ -5,7 +5,7 @@ from malojatime import today,thisweek,thismonth,thisyear def instructions(keys): from utilities import getArtistImage - from htmlgenerators import artistLink, artistLinks + from htmlgenerators import artistLink, artistLinks, link_address from urihandler import compose_querystring, uri_to_internal from htmlmodules import module_pulse, module_performance, module_trackcharts, module_scrobblelist @@ -30,6 +30,17 @@ def instructions(keys): for y in data["medals"]["bronze"]: html_medals += "" + str(y) + "" + html_cert = "" + for track in database.get_tracks(artist=artist): + info = database.trackInfo(track) + if info.get("certification") is not None: + img = "/media/record_{cert}.png".format(cert=info["certification"]) + trackname = track["title"].replace("'","'") + tracklink = link_address(track) + tooltip = "{title} has reached {cert} status".format(title=trackname,cert=info["certification"].capitalize()) + html_cert += "".format(tooltip=tooltip,img=img,link=tracklink) + + credited = data.get("replace") includestr = " " if credited is not None: @@ -69,6 +80,7 @@ def instructions(keys): "KEY_POSITION":pos, "KEY_ASSOCIATED":includestr, "KEY_MEDALS":html_medals, + "KEY_CERTS":html_cert, # tracks "KEY_TRACKLIST":html_tracks, # pulse diff --git a/website/css/maloja.css b/website/css/maloja.css index af9ade7..56f4db0 100644 --- a/website/css/maloja.css +++ b/website/css/maloja.css @@ -379,6 +379,10 @@ img.certrecord { height:30px; vertical-align: text-bottom; } +img.certrecord_small { + height:20px; + vertical-align: text-bottom; +} /*