Mercurial > libervia-templates
diff sat_templates/templates/bulma/input/field.html @ 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 | 81689d346cf6 |
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 %}