##// END OF EJS Templates
form-templates: allow checkboxes to have help block.
marcink -
r2558:572d9909 default
parent child Browse files
Show More
@@ -1,20 +1,26 b''
1 <div class="checkbox">
1 <span tal:define="name name|field.name;
2 <input tal:define="name name|field.name;
3 true_val true_val|field.widget.true_val;
2 true_val true_val|field.widget.true_val;
4 css_class css_class|field.widget.css_class;
3 css_class css_class|field.widget.css_class;
5 style style|field.widget.style;
4 style style|field.widget.style;
6 oid oid|field.oid"
5 oid oid|field.oid;
7 type="checkbox"
6 help_block help_block|field.widget.help_block|'';
8 name="${name}" value="${true_val}"
7 "
8 tal:omit-tag="">
9
10 <div class="checkbox">
11 <input type="checkbox" name="${name}" value="${true_val}"
9 id="${oid}"
12 id="${oid}"
10 tal:attributes="checked cstruct == true_val;
13 tal:attributes="checked cstruct == true_val;
11 class css_class;
14 class css_class;
12 style style;" />
15 style style;"
13
16 />
17 <p tal:condition="help_block" class="help-block">${help_block}</p>
14 <label for="${field.oid}">
18 <label for="${field.oid}">
15 <span tal:condition="hasattr(field, 'schema') and hasattr(field.schema, 'label')"
19 <span tal:condition="hasattr(field, 'schema') and hasattr(field.schema, 'label')"
16 tal:replace="field.schema.label" class="checkbox-label" >
20 tal:replace="field.schema.label" class="checkbox-label" >
17 </span>
21 </span>
18
22
19 </label>
23 </label>
20 </div> No newline at end of file
24 </div>
25
26 </span> No newline at end of file
@@ -1,26 +1,30 b''
1 <span tal:define="name name|field.name;
1 <span tal:define="name name|field.name;
2 css_class css_class|field.widget.css_class;
2 css_class css_class|field.widget.css_class;
3 oid oid|field.oid;
3 oid oid|field.oid;
4 mask mask|field.widget.mask;
4 mask mask|field.widget.mask;
5 placeholder placeholder|field.widget.placeholder|field.placeholder|'';
5 placeholder placeholder|field.widget.placeholder|field.placeholder|'';
6 mask_placeholder mask_placeholder|field.widget.mask_placeholder;
6 mask_placeholder mask_placeholder|field.widget.mask_placeholder;
7 style style|field.widget.style;
7 style style|field.widget.style;
8 help_block help_block|field.widget.help_block|'';
8 help_block help_block|field.widget.help_block|'';
9 "
9 "
10 tal:omit-tag="">
10 tal:omit-tag="">
11
11 <input type="text" name="${name}" value="${cstruct}"
12 <input type="text" name="${name}" value="${cstruct}"
13 id="${oid}"
14 placeholder="${placeholder}"
15
12 tal:attributes="class string: form-control ${css_class or ''};
16 tal:attributes="class string: form-control ${css_class or ''};
13 style style"
17 style style"
14 placeholder="${placeholder}"
18 />
15 id="${oid}"/>
16
19
17 <p tal:condition="help_block" class="help-block">${help_block}</p>
20 <p tal:condition="help_block" class="help-block">${help_block}</p>
18 <script tal:condition="mask" type="text/javascript">
21 <script tal:condition="mask" type="text/javascript">
19 deform.addCallback(
22 deform.addCallback(
20 '${oid}',
23 '${oid}',
21 function (oid) {
24 function (oid) {
22 $("#" + oid).mask("${mask}",
25 $("#" + oid).mask("${mask}",
23 {placeholder:"${mask_placeholder}"});
26 {placeholder:"${mask_placeholder}"});
24 });
27 });
25 </script>
28 </script>
29
26 </span> No newline at end of file
30 </span>
General Comments 0
You need to be logged in to leave comments. Login now