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

Refactored charts into includes

This commit is contained in:
Krateng 2020-09-03 15:43:18 +02:00
parent a6088ec7b7
commit 785e6cfa17
6 changed files with 12 additions and 20 deletions

View File

@ -12,3 +12,4 @@ countas Dai Meng SNH48
countas Mo Han SNH48
countas Su Shanshan SNH48
countas Lin Hui S.I.N.G.
replaceartist 鞠婧禕 Ju Jungyi

Can't render this file because it has a wrong number of fields in line 4.

View File

@ -74,9 +74,10 @@
<h2><a href='{{ mlj_uri.create_uri("/charts_tracks",filterkeys) }}'>Top Tracks</a></h2>
{% import 'partials/charts_tracks.jinja' as charts_tracks %}
{{ charts_tracks.charts_tracks(filterkeys,limitkeys,{"perpage":15,"page":0},compare=false) }}
{% with amountkeys={"perpage":15,"page":0} %}
{% include 'partials/charts_tracks.jinja' %}
{% endwith %}
<br/>

View File

@ -39,8 +39,9 @@
<br/><br/>
{% endif %}
{% import 'partials/charts_artists.jinja' as charts_artists %}
{{ charts_artists.charts_artists(limitkeys,amountkeys,compare=true) }}
{% with compare=true %}
{% include 'partials/charts_artists.jinja' %}
{% endwith %}
{% import 'snippets/pagination.jinja' as pagination %}
{{ pagination.pagination(filterkeys,limitkeys,delimitkeys,amountkeys,pages) }}

View File

@ -41,8 +41,9 @@
<br/><br/>
{% endif %}
{% import 'partials/charts_tracks.jinja' as charts_tracks %}
{{ charts_tracks.charts_tracks(filterkeys,limitkeys,amountkeys,charts=charts,compare=true) }}
{% with compare=true %}
{% include 'partials/charts_tracks.jinja' %}
{% endwith %}
{% import 'snippets/pagination.jinja' as pagination %}
{{ pagination.pagination(filterkeys,limitkeys,delimitkeys,amountkeys,pages) }}

View File

@ -1,9 +1,7 @@
{% import 'snippets/links.jinja' as links %}
{% import 'snippets/entityrow.jinja' as entityrow %}
{% macro charts_artists(limitkeys,amountkeys,charts=None,compare=False) %}
{% if charts is none %}
{% if charts is undefined %}
{% set charts = dbp.get_charts_artists(limitkeys) %}
{% endif %}
@ -59,7 +57,3 @@
{% endif %}
{% endfor %}
</table>
{%- endmacro %}

View File

@ -1,9 +1,7 @@
{% import 'snippets/links.jinja' as links %}
{% import 'snippets/entityrow.jinja' as entityrow %}
{% macro charts_tracks(filterkeys,limitkeys,amountkeys,charts=None,compare=False) %}
{% if charts is none %}
{% if charts is undefined %}
{% set charts = dbp.get_charts_tracks(filterkeys,limitkeys) %}
{% endif %}
{% if compare %}
@ -56,7 +54,3 @@
{% endif %}
{% endfor %}
</table>
{%- endmacro %}