changeset 300:2a697b1376f1

bulma (components/block): disco entities's `icon_name` is used as icon when available: otherwide, `default_icon_name` is used.
author Goffi <goffi@goffi.org>
date Sat, 20 Feb 2021 13:37:19 +0100
parents 75f1cd6da46e
children ba6f0af3a3f9
files sat_templates/templates/bulma/components/block.html
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
     </div>
 {% 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
 #}
     <div class="columns">
         {% 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 %}
     </div>
 {% endmacro %}