1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Changed timeselection snippet to include

This commit is contained in:
Krateng 2020-09-13 10:24:34 +02:00
parent 60a06efad8
commit 6316e45265
No known key found for this signature in database
GPG Key ID: 46735607861C6FCE
9 changed files with 17 additions and 24 deletions

View File

@ -5,7 +5,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,9,7
version = 2,9,8
versionstr = ".".join(str(n) for n in version)
links = {
"pypi":"malojaserver",

View File

@ -27,8 +27,9 @@
<h1>Artist Charts</h1><a href="/top_artists"><span>View #1 Artists</span></a><br/>
<span>{{ limitkeys.timerange.desc(prefix=True) }}</span>
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys) }}
{% with delimitkeys = {} %}
{% include 'snippets/timeselection.jinja' %}
{% endwith %}
</td>
</tr>

View File

@ -29,8 +29,9 @@
{% if filterkeys.get('artist') is not none %}by {{ links.link(filterkeys.get('artist')) }}{% endif %}
<span>{{ limitkeys.timerange.desc(prefix=True) }}</span>
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys) }}
{% with delimitkeys = {} %}
{% include 'snippets/timeselection.jinja' %}
{% endwith %}
</td>
</tr>

View File

@ -25,8 +25,7 @@
<br/>
{{ filterdesc.desc(filterkeys,limitkeys,prefix='of') }}
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys,delimit=True) }}
{% include 'snippets/timeselection.jinja' %}
</td>
</tr>

View File

@ -25,8 +25,7 @@
<br/>
{{ filterdesc.desc(filterkeys,limitkeys,prefix='of') }}
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys,delimit=True) }}
{% include 'snippets/timeselection.jinja' %}
</td>
</tr>

View File

@ -31,8 +31,9 @@
<br/>
<p class="stats">{{ scrobbles.__len__() }} Scrobbles</p>
<br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys) }}
{% with delimitkeys = {} %}
{% include 'snippets/timeselection.jinja' %}
{% endwith %}
</td>
</tr>

View File

@ -1,13 +1,10 @@
{% macro selector(filterkeys,limitkeys,delimitkeys,amountkeys,limit=True,delimit=False) %}
<!-- drop keys that are not relevant so they don't clutter the URI -->
{% if not limit %}{% set limitkeys = {} %}{% endif %}
{% if not delimit %}{% set delimitkeys = {} %}{% endif %}
{% set allkeys = [filterkeys,limitkeys,delimitkeys,amountkeys] | combine_dicts %}
{% if limit %}
{% if limitkeys != {} %}
<div>
{% set thisrange = limitkeys.timerange %}
@ -42,7 +39,7 @@
{% endif %}
{% if delimit %}
{% if delimitkeys != {} %}
<div>
{% for cat in [xdelimiters,xtrails] %}
{% for r in cat %}
@ -59,6 +56,3 @@
</div>
{% endif %}
{% endmacro %}

View File

@ -20,8 +20,7 @@
<span>{{ limitkeys.timerange.desc(prefix=True) }}</span>
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys,delimit=True) }}
{% include 'snippets/timeselection.jinja' %}
</td>
</tr>
</table>

View File

@ -20,8 +20,7 @@
<span>{{ limitkeys.timerange.desc(prefix=True) }}</span>
<br/><br/>
{% import 'snippets/timeselection.jinja' as timeselection %}
{{ timeselection.selector(filterkeys,limitkeys,delimitkeys,delimit=True) }}
{% include 'snippets/timeselection.jinja' %}
</td>
</tr>
</table>