# HG changeset patch # User Goffi # Date 1619887487 -7200 # Node ID 8c779fb4638483b40453ab49326d0bdf2c2f062c # Parent 580fa5482e88b67b25a296a70d0e6cc31cf663a2 bulma (components/block): interests_grid is more customisable: - new `delete_icon` argument can be set to `false` if delete icon is not desired - the macro can now be called, the caller then get 2 arguments: part to customise and current interest. Part to customise can be: * `header-title`: markup to put in the title * `content`: car content (replaces the default `interest.name`) diff -r 580fa5482e88 -r 8c779fb46384 sat_templates/templates/bulma/components/block.html --- a/sat_templates/templates/bulma/components/block.html Sat May 01 18:41:11 2021 +0200 +++ b/sat_templates/templates/bulma/components/block.html Sat May 01 18:44:47 2021 +0200 @@ -46,18 +46,29 @@ {% endmacro %} -{% macro interests_grid(interests, default_icon_name) %} +{% 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 %}
- - {{ interest.name|default(_("unnamed")) }} - + {% if caller is defined %} + {{ caller("content", interest) }} + {% else %} + + {{ interest.name|default(_("unnamed")) }} + + {% endif %}