e775939fb55843dd7f72b7263fcfc707c8b76ca9
[moodle.git] / lib / form / templates / element-advcheckbox.mustache
1 <div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
2     <div class="col-md-3">
3         {{#text}}
4             <label for="{{element.id}}">
5                 {{{label}}}
6             </label>
7         {{/text}}
8     </div>
9     <div class="col-md-9 checkbox">
10         <div class="form-check">
11             <label>
12             {{^element.hardfrozen}}
13                 {{^element.frozen}}
14                     <input type="hidden" name="{{element.name}}" value="{{element.deselectedvalue}}">
15                 {{/element.frozen}}
16                 {{#element.frozen}}
17                     <input type="hidden" name="{{element.name}}" value="{{element.frozenvalue}}">
18                 {{/element.frozen}}
19             {{/element.hardfrozen}}
20             <input type="checkbox"
21                 name="{{element.name}}"
22                 class="form-check-input {{element.extraclasses}}"
23                 {{#element.selectedvalue}}
24                     value="{{element.selectedvalue}}"
25                 {{/element.selectedvalue}}
26                 id="{{element.id}}" {{#element.checked}}checked{{/element.checked}}
27                 {{#error}}
28                     autofocus aria-describedby="{{element.iderror}}"
29                 {{/error}}
30                 {{#element.frozen}}
31                     disabled
32                 {{/element.frozen}}
33                 {{{element.attributes}}} >
34                 {{#text}}
35                     {{{.}}}
36                 {{/text}}
37                 {{^text}}
38                     {{{label}}}
39                 {{/text}}
40             </label>
41             <span class="text-nowrap">
42                 {{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">!</abbr>{{/advanced}}
43                 {{{helpbutton}}}
44             </span>
45         </div>
46         <div class="form-control-feedback invalid-feedback" id="{{element.iderror}}" {{#error}} style="display: block;"{{/error}}>
47             {{{error}}}
48         </div>
49     </div>
50 </div>
51 {{^element.frozen}}
52 {{#js}}
53 require(['theme_boost/form-display-errors'], function(module) {
54     module.enhance({{#quote}}{{element.id}}{{/quote}});
55 });
56 {{/js}}
57 {{/element.frozen}}