diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index edfe0ba..96e0c01 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -19,7 +19,8 @@ requires = [ "nimrodel>=0.6.3", "setproctitle>=1.1.10", "wand>=0.5.4", - "lesscpy>=0.13" + "lesscpy>=0.13", + "jinja2">2.11 ] resources = [ "web/*/*", diff --git a/maloja/database.py b/maloja/database.py index 416ebc8..c17fe77 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -600,6 +600,7 @@ def artistInfo(artist): position = c["rank"] performance = get_performance(artist=artist,step="week") return { + "artist":artist, "scrobbles":scrobbles, "position":position, "associated":others, @@ -645,6 +646,7 @@ def trackInfo(track): return { + "track":track, "scrobbles":scrobbles, "position":position, "medals":{"gold":[],"silver":[],"bronze":[],**MEDALS_TRACKS.get((frozenset(track["artists"]),track["title"]),{})}, diff --git a/maloja/server.py b/maloja/server.py index 13d776a..176a47c 100755 --- a/maloja/server.py +++ b/maloja/server.py @@ -6,6 +6,8 @@ from .globalconf import datadir, DATA_DIR # server stuff from bottle import Bottle, route, get, post, error, run, template, static_file, request, response, FormsDict, redirect, template, HTTPResponse, BaseRequest import waitress +# templating +from jinja2 import Environment, PackageLoader, select_autoescape # monkey patching from . import monkey # rest of the project @@ -206,7 +208,7 @@ JINJA_CONTEXT = { ] } -from jinja2 import Environment, PackageLoader, select_autoescape + jinjaenv = Environment( loader=PackageLoader('maloja', 'web/jinja'), autoescape=select_autoescape(['html', 'xml']) diff --git a/maloja/static/less/maloja.less b/maloja/static/less/maloja.less index 7dc7ffe..3c1b60e 100644 --- a/maloja/static/less/maloja.less +++ b/maloja/static/less/maloja.less @@ -290,6 +290,17 @@ span.stat_selector_pulse,span.stat_selector_topartists,span.stat_selector_toptra } + +h2 { + display:inline-block; + padding-right:5px; + margin-bottom:10px; + margin-top:15px; +} +h2+span.afterheader { + color:@TEXT_COLOR_TERTIARY; +} + /* SHINY*/ .medal { top:5px; diff --git a/maloja/web/jinja/artist.jinja b/maloja/web/jinja/artist.jinja index 585bde5..258e62d 100644 --- a/maloja/web/jinja/artist.jinja +++ b/maloja/web/jinja/artist.jinja @@ -28,6 +28,7 @@ {% block content %} +{% import 'partials/awards_artist.jinja' as awards %}
{{ artist }}- {% if competes %}{{ positionstring }}{% endif %} + {% if competes %}#{{ info.position }}{% endif %}{% if competes and included %} associated: {{ htmlgenerators.artistLinks(included) }} {% elif not competes %} - Competing under {{ htmlgenerators.artistLink(credited) }} ({{ positionstring }}) + Competing under {{ htmlgenerators.artistLink(credited) }} (#{{ info.position }}) {% endif %} {{ info['scrobbles'] }} Scrobbles - {% import 'partials/awards.jinja' as awards %} + {% if competes %} {{ awards.medals(info) }} @@ -74,7 +75,7 @@ {# htmlmodules.module_trackcharts(**filterkeys,max_=15)[0] #} {% import 'partials/charts_tracks.jinja' as charts_tracks %} -{{ charts_tracks.charts_tracks(filterkeys,limitkeys,amountkeys,compare=false) }} +{{ charts_tracks.charts_tracks(filterkeys,limitkeys,{"perpage":15,"page":0},compare=false) }}@@ -83,7 +84,7 @@ |
Pulse- +{% for range in xranges %} Performance+ {% if not competes %}of {{ htmlgenerators.artistLink(credited) }} + {% endif %} +{% for range in xranges %} @@ -144,7 +148,7 @@ |
{%if loop.changed(e.scrobbles) %}#{{ e.rank }}{% endif %} | @@ -41,6 +45,7 @@{{ htmlgenerators.scrobblesTrackLink(e['track'],urihandler.internal_to_uri(limitkeys),amount=e['scrobbles']) }} | {{ htmlgenerators.scrobblesTrackLink(e['track'],urihandler.internal_to_uri(limitkeys),percent=e['scrobbles']*100/maxbar) }} |
- - | +{{ malojatime.timestamp_desc(s["time"],short=shortTimeDesc) }} | {{ entityrow.row(s) }}
+ {% if adminmode %}
+
+ {% else %}
+
+
+ {% endif %}
+ |
+
+ {{ htmlgenerators.artistLinks(track.artists) }} + {{ track.title }}+ {{ awards.certs(track) }} + #{{ info.position }} ++ + + + + + + + {{ awards.medals(info) }} + {{ awards.topweeks(info) }} + + + |
+
+ Pulse++ {% for range in xranges %} + + {{ range.localisation }} + + {% if not loop.last %}|{% endif %} + {% endfor %} + + + + {% import 'partials/pulse.jinja' as pulse %} + {% for range in xranges %} + + + + {% endfor %} + |
+
+
+ Performance++ {% for range in xranges %} + + {{ range.localisation }} + + {% if not loop.last %}|{% endif %} + {% endfor %} + + + + {% import 'partials/performance.jinja' as performance %} + {% for range in xranges %} + + + + {% endfor %} + + |
+