##// 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 <span tal:define="name name|field.name;
2 true_val true_val|field.widget.true_val;
3 css_class css_class|field.widget.css_class;
4 style style|field.widget.style;
5 oid oid|field.oid;
6 help_block help_block|field.widget.help_block|'';
7 "
8 tal:omit-tag="">
9
1 <div class="checkbox">
10 <div class="checkbox">
2 <input tal:define="name name|field.name;
11 <input type="checkbox" name="${name}" value="${true_val}"
3 true_val true_val|field.widget.true_val;
12 id="${oid}"
4 css_class css_class|field.widget.css_class;
13 tal:attributes="checked cstruct == true_val;
5 style style|field.widget.style;
14 class css_class;
6 oid oid|field.oid"
15 style style;"
7 type="checkbox"
16 />
8 name="${name}" value="${true_val}"
17 <p tal:condition="help_block" class="help-block">${help_block}</p>
9 id="${oid}"
10 tal:attributes="checked cstruct == true_val;
11 class css_class;
12 style style;" />
13
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
@@ -6,21 +6,25 b''
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 <input type="text" name="${name}" value="${cstruct}"
11
12 tal:attributes="class string: form-control ${css_class or ''};
12 <input type="text" name="${name}" value="${cstruct}"
13 style style"
13 id="${oid}"
14 placeholder="${placeholder}"
14 placeholder="${placeholder}"
15 id="${oid}"/>
15
16 tal:attributes="class string: form-control ${css_class or ''};
17 style style"
18 />
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