comparison 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
comparison
equal deleted inserted replaced
9:7a1626e78d53 10:8b5615a1bf3d
1 {% macro choices(name, choices_list, checked=none) %}
2 {% for choice in choices_list %}
3 <label><input type="radio" name="{{name}}" value="{{choice}}"{{"checked" if checked==choice}}>{{choice}}</label>
4 {% endfor %}
5 {% endmacro %}
6
7 {% macro int(name, label="", init=0) %}
8 <label><input type="number" name="{{name}}" value="{{init}}" step="1" min="0">{{label}}</label>
9 {% endmacro %}
10
11 {% macro meta(name, value) %}
12 <input type="hidden" name="{{name}}" value="{{value}}">
13 {% endmacro %}
14
15 {% macro submit() %}
16 <input type="submit" value="Send">
17 {% endmacro %}