diff --git a/maloja/globalconf.py b/maloja/globalconf.py index bba0938..91b917e 100644 --- a/maloja/globalconf.py +++ b/maloja/globalconf.py @@ -34,9 +34,6 @@ def datadir(*args): from doreah import config config( - pyhp={ - "version": 2 - }, settings={ "files":[ datadir("settings/default.ini"), diff --git a/maloja/jinja_filters.py b/maloja/jinja_filters.py index b78da42..c2d6899 100644 --- a/maloja/jinja_filters.py +++ b/maloja/jinja_filters.py @@ -2,3 +2,40 @@ def fixlength(real,target): t = real[:target] while len(t) + {% for e in ranges %} + + {% set thisrange = e.range %} + {% set track = e.track %} + + {{ thisrange.desc() }} + + {% if e.track is none %} +
+ n/a + 0 + + {% else %} + {{ htmlgenerators.entity_column(track,image=utilities.getTrackImage(track.artists,track.title,fast=True)) }} + {{ htmlgenerators.scrobblesTrackLink(track,thisrange.urikeys(),amount=e.scrobbles) }} + {{ htmlgenerators.scrobblesTrackLink(track,thisrange.urikeys(),percent=e.scrobbles*100/maxbar) }} + {% endif %} + + + {% endfor %} + + + +{%- endmacro %} diff --git a/maloja/web/jinja/top_tracks.jinja b/maloja/web/jinja/top_tracks.jinja new file mode 100644 index 0000000..e35ee95 --- /dev/null +++ b/maloja/web/jinja/top_tracks.jinja @@ -0,0 +1,32 @@ +{% extends "abstracts/base.jinja" %} +{% block title %}Maloja - #1 Tracks{% endblock %} + + + + +{% set entries = dbp.get_top_tracks(filterkeys,limitkeys,delimitkeys) %} +{% set repr = entries | find_representative('track','scrobbles') %} +{% set img = "/favicon.png" if repr is none else utilities.getTrackImage(repr.track.artists,repr.track.title) %} + + +{% block content %} + + + + + +
+
+
+

#1 Tracks


+ {{ limitkeys.timerange.desc(prefix=True) }} + +

+ {{ htmlmodules.module_filterselection(_urikeys,delimit=True) }} +
+ + + {% import 'partials/top_tracks.jinja' as top_tracks %} + {{ top_tracks.top_tracks(filterkeys,limitkeys,delimitkeys,amountkeys) }} + +{% endblock %}