changeset 307:605bce1df126

bulma (input/field): icon can now be specified with `submit` macro
author Goffi <goffi@goffi.org>
date Sat, 27 Feb 2021 20:51:32 +0100
parents 206a98e3d06b
children 3054387cac3b
files sat_templates/templates/bulma/input/field.html
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/input/field.html	Sat Feb 27 20:50:52 2021 +0100
+++ b/sat_templates/templates/bulma/input/field.html	Sat Feb 27 20:51:32 2021 +0100
@@ -114,13 +114,20 @@
     <input type="hidden" name="{{name}}" value="{{value}}">
 {% endmacro %}
 
-{% macro submit(text=_("Send"), id=none, class='', attrs=none) %}
+{% macro submit(text=_("Send"), id=none, class="", icon=none, attrs=none) %}
     {# submit button
 
     @param text(str): label of the button
     @param id(none, str): id of the element
     #}
     <div class="control {{class}}">
-        <button{{ {'id': id}|xmlattr }} class="button is-primary form_submit {{class}}" type="submit"{{(attrs or {})|xmlattr}}>{{text}}</button>
+        <button{{ {'id': id}|xmlattr }} class="button is-primary form_submit {{class}}" type="submit"{{(attrs or {})|xmlattr}}>
+            {{text}}
+            {% if icon %}
+                <span class="icon is-small">
+                    <i class="icon-{{icon}}"></i>
+                </span>
+            {% endif %}
+        </button>
     </div>
 {% endmacro %}