# HG changeset patch # User Goffi # Date 1613824639 -3600 # Node ID 2a697b1376f10057907855f50febf8cdb0f40614 # Parent 75f1cd6da46e66f4be0664a5e4c8ee57f9ac5413 bulma (components/block): disco entities's `icon_name` is used as icon when available: otherwide, `default_icon_name` is used. diff -r 75f1cd6da46e -r 2a697b1376f1 sat_templates/templates/bulma/components/block.html --- a/sat_templates/templates/bulma/components/block.html Sat Feb 20 13:37:15 2021 +0100 +++ b/sat_templates/templates/bulma/components/block.html Sat Feb 20 13:37:19 2021 +0100 @@ -34,14 +34,14 @@ {% endmacro %} -{% macro disco_icon_grid(disco_entities, icon_name) %} +{% 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(icon_name, disco_entity.name, disco_entity.url) }} + {{ icon_item(disco_entity.icon_name or default_icon_name, disco_entity.name, disco_entity.url) }} {% endfor %}
{% endmacro %}