mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
26 lines
549 B
Django/Jinja
26 lines
549 B
Django/Jinja
{% macro link(entity) -%}
|
|
{% if 'artists' in entity %}
|
|
{% set name = entity.title %}
|
|
{% else %}
|
|
{% set name = entity %}
|
|
{% endif %}
|
|
|
|
<a href="{{ url(entity) }}">{{ name }}</a>
|
|
{%- endmacro %}
|
|
|
|
{% macro links(entities) -%}
|
|
{% for entity in entities -%}
|
|
{{ link(entity) }}{{ ", " if not loop.last }}
|
|
{%- endfor %}
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% macro url(entity) -%}
|
|
{% if 'artists' in entity %}
|
|
{{ mlj_uri.create_uri("/track",{'track':entity}) }}
|
|
{% else %}
|
|
{{ mlj_uri.create_uri("/artist",{'artist':entity}) }}
|
|
{% endif %}
|
|
{%- endmacro %}
|