maloja/maloja/web/jinja/snippets/entityrow.jinja

39 lines
1.1 KiB
Django/Jinja
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% macro row(entity,counting=[]) %}
{% import 'snippets/links.jinja' as links %}
{% if entity is mapping and 'title' in entity %}
{% set img = images.get_track_image(entity) %}
{% elif entity is mapping and 'albumtitle' in entity %}
{% set img = images.get_album_image(entity) %}
{% else %}
{% set img = images.get_artist_image(entity) %}
{% endif %}
<td class='icon'>
{% if settings['DISPLAY_ART_ICONS'] %}
<div class="lazy" data-bg="{{ img }}"></div>
{% endif %}
</td>
{% if entity is mapping and 'artists' in entity %}
{% if settings['TRACK_SEARCH_PROVIDER'] %}
<td class='searchProvider'>{{ links.link_search(entity) }}</td>
{% endif %}
<td class='track'>
<span class='artist_in_trackcolumn'>{{ links.links(entity.artists) }}</span> {{ links.link(entity) }}
</td>
{% elif entity is mapping and 'albumtitle' in entity %}
<td class='album'>
<span class='artist_in_trackcolumn'>{{ links.links(entity.artists) }}</span> {{ links.link(entity) }}
</td>
{% else %}
<td class='artist'>{{ links.link(entity) }}
{% if counting != [] %}
<span class='extra'>incl. {{ links.links(counting) }}</span>
{% endif %}
</td>
{% endif %}
{% endmacro %}