comparison sat_templates/default/input/field.html @ 147:33c7ce833d3f

install: setup.py fix + moved "default" dir in a "sat_templates" dir: the merge request at https://bugs.goffi.org/mr/view/3 was a good basis, but not fully working ("default" dir was removed), this patch fixes it, and do some improvments: - moved "default" in "sat_templates" dir, which correspond to the python module, so it can be found easily from python - added VERSION, and mercurial hash detection, in the same way as for Cagou and backend - slight modification of classifiers - replaces tabs coming from MR by spaces
author Goffi <goffi@goffi.org>
date Sat, 02 Jun 2018 17:25:43 +0200
parents default/input/field.html@da8f1ba9034d
children b84d20af0ed3
comparison
equal deleted inserted replaced
146:7dc00829c32f 147:33c7ce833d3f
1 {% macro choices(name, choices_list, checked=none) %}
2 {% for choice, label in choices_list %}
3 <div class="form_input">
4 <input id="{{name|next_gidx}}" type="radio" name="{{name}}" value="{{choice}}"{{" checked" if checked==choice}}><label for="{{name|cur_gidx}}">{{label}}</label>
5 </div>
6 {% endfor %}
7 {% endmacro %}
8
9 {% macro int(name, label="", init=0) %}
10 <span class="form_input">
11 <label for="{{name|next_gidx}}">{{label}}</label><input id="{{name|cur_gidx}}" type="number" name="{{name}}" value="{{init}}" step="1" min="0">
12 </span>
13 {% endmacro %}
14
15 {% macro text(name, label="", placeholder="", required=false) %}
16 {# single line text field
17 additional kwargs will be passed as attributes #}
18 <span class="form_input">
19 <label for="{{name|next_gidx}}">{{label}}</label><input id="{{name|cur_gidx}}" type="text" name="{{name}}" placeholder="{{placeholder}}" {{"required" if required}} {{kwargs|xmlattr}}>
20 </span>
21 {% endmacro %}
22
23 {% macro password(name, label="", required=false) %}
24 {# password field
25 additional kwargs will be passed as attributes #}
26 <span class="form_input">
27 <label for="{{name|next_gidx}}">{{label}}</label><input id="{{name|cur_gidx}}" type="password" name="{{name}}" {{"required" if required}} {{kwargs|xmlattr}}>
28 </span>
29 {% endmacro %}
30
31 {% macro email(name, label="", required=false) %}
32 {# email field
33 additional kwargs will be passed as attributes #}
34 <span class="form_input">
35 <label for="{{name|next_gidx}}">{{label}}</label><input id="{{name|cur_gidx}}" type="email" name="{{name}}" {{"required" if required}} {{kwargs|xmlattr}}>
36 </span>
37 {% endmacro %}
38
39 {% macro textarea(name, rows=10, cols=50, placeholder='', required=false) %}
40 <textarea name="{{name}}" rows="{{rows}}" cols="{{cols}}" placeholder="{{placeholder}}" {{"required" if required}}></textarea>
41 {% endmacro %}
42
43 {% macro meta(name, value) %}
44 <input type="hidden" name="{{name}}" value="{{value}}">
45 {% endmacro %}
46
47 {% macro submit(text=_("Send")) %}
48 <input class="form_submit button" type="submit" value="{{text}}">
49 {% endmacro %}