Added UI for artist chart separation

This commit is contained in:
krateng 2023-10-19 17:26:52 +02:00
parent a12c52af1f
commit b9242d843e
3 changed files with 18 additions and 1 deletions

View File

@ -76,6 +76,10 @@ def update_jinja_environment():
"xassociated": [
{"identifier":"include_associated","replacekeys":{"associated":True},"localisation":"Associated"},
{"identifier":"exclude_associated","replacekeys":{"associated":False},"localisation":"Exclusive"}
],
"xseparate": [
{"identifier":"count_combined","replacekeys":{"separate":False},"localisation":"Combined"},
{"identifier":"count_separate","replacekeys":{"separate":True},"localisation":"Separate"}
]
}

View File

@ -32,7 +32,7 @@
<h1>Artist Charts</h1><a href="/top_artists"><span>View #1 Artists</span></a><br/>
{{ filterdesc.desc(filterkeys,limitkeys) }}
<br/><br/>
{% with delimitkeys = {} %}
{% with delimitkeys = {}, artistchart=True %}
{% include 'snippets/timeselection.jinja' %}
{% endwith %}

View File

@ -75,3 +75,16 @@
</div>
{% endif %}
{% if artistchart %}
<div>
{% for o in xseparate %}
{% if o.replacekeys | map('compare_key_in_dicts',o.replacekeys,allkeys) | alltrue %}
<span style='opacity:0.5;'>{{ o.localisation }}</span>
{% else %}
<a href='{{ mlj_uri.create_uri("",allkeys,o.replacekeys) }}'><span>{{ o.localisation }}</span></a>
{% endif %}
{{ "|" if not loop.last }}
{% endfor %}
</div>
{% endif %}