Mercurial > libervia-templates
diff default/input/field.html @ 10:8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 27 Apr 2017 01:07:28 +0200 |
parents | |
children | d4a8afa7b590 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/input/field.html Thu Apr 27 01:07:28 2017 +0200 @@ -0,0 +1,17 @@ +{% macro choices(name, choices_list, checked=none) %} + {% for choice in choices_list %} + <label><input type="radio" name="{{name}}" value="{{choice}}"{{"checked" if checked==choice}}>{{choice}}</label> + {% endfor %} +{% endmacro %} + +{% macro int(name, label="", init=0) %} + <label><input type="number" name="{{name}}" value="{{init}}" step="1" min="0">{{label}}</label> +{% endmacro %} + +{% macro meta(name, value) %} + <input type="hidden" name="{{name}}" value="{{value}}"> +{% endmacro %} + +{% macro submit() %} + <input type="submit" value="Send"> +{% endmacro %}