{% macro separator(label, align='center') %} {# display a bloc separator @param label(unicode): label to show @param align(unicode): one of "left", "center", "right" #}
{% if align in ('center', 'right') %}
{% endif %}
{{label}}
{% if align in ('center', 'left') %}
{% endif %}
{% endmacro %} {% macro icon_item(icon_name, label, url, class="", delete_icon=false, data=none) %}
{{ icon(icon_name, cls='image is-64x64 is-inline-block') }} {% if delete_icon %} {% endif %}
{{label}}
{% endmacro %} {% macro disco_icon_grid(disco_entities, default_icon_name) %} {# display discovered entities in a grid @param disco_entities: entities which mush have a name and url key or attribute @param icon_name: name of a defined icon #}
{% for disco_entity in disco_entities %} {{ icon_item(disco_entity.icon_name or default_icon_name, disco_entity.name, disco_entity.url) }} {% endfor %}
{% endmacro %} {% macro interests_grid(interests, default_icon_name, delete_icon=true) %} {# display list of interests Can be called, in which call caller is called with 2 arguments: - part: par to fill, can be "header-title" or "content" - interest: current interest @param interests: list of interests @param default_icon_name: name of a defined icon to use when no thumb_url is available @param delete_icon: unset to remove the icon #}
{% for interest in interests %}
{% if caller is defined %} {{ caller("header-title", interest) }} {% endif %}
{% if delete_icon %}
{% endif %}
{% if caller is defined %} {{ caller("content", interest) }} {% else %} {{ interest.name|default(_("unnamed")) }} {% endif %}
{% endfor %}
{% endmacro %}