annotate default/input/field.html @ 20:8fa2fd2e928e

default: added i18n support
author Goffi <goffi@goffi.org>
date Sun, 21 May 2017 16:10:44 +0200
parents d4a8afa7b590
children 38328c57f3ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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) %}
20
8fa2fd2e928e default: added i18n support
Goffi <goffi@goffi.org>
parents: 18
diff changeset
2 {% for choice, label in choices_list %}
18
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
3 <div class="form_input">
20
8fa2fd2e928e default: added i18n support
Goffi <goffi@goffi.org>
parents: 18
diff changeset
4 <input id="{{'field'|next_gidx}}" type="radio" name="{{name}}" value="{{choice}}"{{" checked" if checked==choice}}><label for="{{'field'|cur_gidx}}">{{label}}</label>
18
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
5 </div>
10
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
6 {% endfor %}
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
7 {% endmacro %}
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
8
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
9 {% macro int(name, label="", init=0) %}
18
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
10 <span class="form_input">
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
11 <label id="{{'field'|next_gidx}}">{{label}}</label><input id="{{'field'|cur_gidx}}" type="number" name="{{name}}" value="{{init}}" step="1" min="0"></label>
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
12 </span>
10
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 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
16 <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
17 {% endmacro %}
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
18
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
19 {% macro submit() %}
20
8fa2fd2e928e default: added i18n support
Goffi <goffi@goffi.org>
parents: 18
diff changeset
20 <input type="submit" value="{{_("Send")}}">
10
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
21 {% endmacro %}