annotate default/input/field.html @ 19:422c54e0204a

event: adaptation to changes in backend/Libervia + background_image can now be specified in template data
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 12:59:43 +0200
parents d4a8afa7b590
children 8fa2fd2e928e
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) %}
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 %}
18
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
3 <div class="form_input">
d4a8afa7b590 input/field: <label> is separated from <input>
Goffi <goffi@goffi.org>
parents: 10
diff changeset
4 <input id="{{'field'|next_gidx}}" type="radio" name="{{name}}" value="{{choice}}"{{" checked" if checked==choice}}><label for="{{'field'|cur_gidx}}">{{choice}}</label>
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() %}
8b5615a1bf3d articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
diff changeset
20 <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
21 {% endmacro %}