mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Reorganized charts code
This commit is contained in:
parent
ed62cbfc0b
commit
59e38e24ee
@ -25,22 +25,23 @@ def instructions(keys):
|
|||||||
else:
|
else:
|
||||||
imgurl = ""
|
imgurl = ""
|
||||||
|
|
||||||
topartists = ""
|
html_tiles = ""
|
||||||
imgdiv = '<div style="background-image:url('+imgurl+')"></div>'
|
|
||||||
if get_settings("CHARTS_DISPLAY_TILES"):
|
if get_settings("CHARTS_DISPLAY_TILES"):
|
||||||
topartists = module_artistcharts_tiles(timerange=timekeys["timerange"])
|
html_tiles = module_artistcharts_tiles(timerange=timekeys["timerange"])
|
||||||
imgdiv = """<div style="background-image:url('favicon.png')"></div>"""
|
imgurl = "favicon.png"
|
||||||
|
|
||||||
|
imgdiv = '<div style="background-image:url('+imgurl+')"></div>'
|
||||||
|
|
||||||
|
|
||||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||||
|
|
||||||
|
|
||||||
replace = {
|
replace = {
|
||||||
"KEY_TOPARTIST_IMAGEDIV":imgdiv,
|
"KEY_TOPARTIST_IMAGEDIV":imgdiv,
|
||||||
"KEY_ARTISTCHART":topartists,
|
"KEY_ARTISTCHART":html_tiles,
|
||||||
"KEY_ARTISTLIST":html_charts,
|
"KEY_ARTISTLIST":html_charts,
|
||||||
"KEY_RANGE":limitstring,
|
"KEY_RANGE":limitstring,
|
||||||
"KEY_FILTERSELECTOR":html_filterselector}
|
"KEY_FILTERSELECTOR":html_filterselector
|
||||||
|
}
|
||||||
|
|
||||||
return (replace,pushresources)
|
return (replace,pushresources)
|
||||||
|
@ -25,20 +25,23 @@ def instructions(keys):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
html_tiles = ""
|
||||||
|
|
||||||
if filterkeys.get("artist") is not None:
|
if filterkeys.get("artist") is not None:
|
||||||
imgurl = getArtistImage(filterkeys.get("artist"))
|
imgurl = getArtistImage(filterkeys.get("artist"))
|
||||||
limitstring = "by " + artistLink(filterkeys.get("artist"))
|
limitstring = "by " + artistLink(filterkeys.get("artist"))
|
||||||
toptracks = ""
|
|
||||||
imgdiv = '<div style="background-image:url('+imgurl+')"></div>'
|
|
||||||
elif rep is not None:
|
elif rep is not None:
|
||||||
imgurl = getTrackImage(rep["artists"],rep["title"])
|
imgurl = getTrackImage(rep["artists"],rep["title"])
|
||||||
if get_settings("CHARTS_DISPLAY_TILES"):
|
|
||||||
toptracks = module_trackcharts_tiles(timerange=timekeys["timerange"])
|
|
||||||
imgdiv = """<div style="background-image:url('favicon.png')"></div>"""
|
|
||||||
else:
|
else:
|
||||||
imgurl = ""
|
imgurl = ""
|
||||||
|
|
||||||
|
html_tiles = ""
|
||||||
|
if get_settings("CHARTS_DISPLAY_TILES"):
|
||||||
|
html_tiles = module_trackcharts_tiles(timerange=timekeys["timerange"])
|
||||||
|
imgurl = "favicon.png"
|
||||||
|
|
||||||
|
imgdiv = '<div style="background-image:url('+imgurl+')"></div>'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
limitstring += " " + timekeys["timerange"].desc(prefix=True)
|
limitstring += " " + timekeys["timerange"].desc(prefix=True)
|
||||||
@ -49,7 +52,7 @@ def instructions(keys):
|
|||||||
|
|
||||||
replace = {
|
replace = {
|
||||||
"KEY_TOPARTIST_IMAGEDIV":imgdiv,
|
"KEY_TOPARTIST_IMAGEDIV":imgdiv,
|
||||||
"KEY_TRACKCHART":toptracks,
|
"KEY_TRACKCHART":html_tiles,
|
||||||
"KEY_TRACKLIST":html_charts,
|
"KEY_TRACKLIST":html_charts,
|
||||||
"KEY_LIMITS":limitstring,
|
"KEY_LIMITS":limitstring,
|
||||||
"KEY_FILTERSELECTOR":html_filterselector,
|
"KEY_FILTERSELECTOR":html_filterselector,
|
||||||
|
Loading…
Reference in New Issue
Block a user