Mercurial > libervia-templates
annotate 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 |
rev | line source |
---|---|
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 {% macro choices(name, choices_list, checked=none) %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 {% for choice in choices_list %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 <label><input type="radio" name="{{name}}" value="{{choice}}"{{"checked" if checked==choice}}>{{choice}}</label> |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 {% endfor %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 {% endmacro %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 {% macro int(name, label="", init=0) %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 <label><input type="number" name="{{name}}" value="{{init}}" step="1" min="0">{{label}}</label> |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 {% endmacro %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 {% macro meta(name, value) %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 <input type="hidden" name="{{name}}" value="{{value}}"> |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 {% endmacro %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 {% macro submit() %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 <input type="submit" value="Send"> |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 {% endmacro %} |