0e5e186a12a18cfeac1602dddb129874a0b1a0bd
[moodle.git] / lib / form / templates / element-checkbox.mustache
1 <div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
2     <div class="col-md-3">
3         <span class="float-sm-right text-nowrap">
4             {{#required}}<abbr class="initialism text-danger" title="{{#str}}required{{/str}}">{{#pix}}req, core, {{#str}}required{{/str}}{{/pix}}</abbr>{{/required}}
5         </span>
6         {{#text}}
7             <label for="{{element.id}}">
8                 {{{label}}}
9             </label>
10         {{/text}}
11     </div>
12     <div class="col-md-9 checkbox">
13         <div class="form-check">
14             <label>
15             {{^element.hardfrozen}}
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.value}}
24                     value="{{element.value}}"
25                 {{/element.value}}
26                 {{^element.value}}
27                     value="1"
28                 {{/element.value}}
29                 id="{{element.id}}" {{#element.checked}}checked{{/element.checked}}
30                 {{#error}}
31                     autofocus aria-describedby="{{element.iderror}}"
32                 {{/error}}
33                 {{#element.frozen}}
34                     disabled
35                 {{/element.frozen}}
36                 {{{element.attributes}}} >
37                 {{#text}}
38                     {{{.}}}
39                 {{/text}}
40                 {{^text}}
41                     {{{label}}}
42                 {{/text}}
43             </label>
44             <span class="text-nowrap">
45                 {{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">!</abbr>{{/advanced}}
46                 {{{helpbutton}}}
47             </span>
48         </div>
49         <div class="form-control-feedback invalid-feedback" id="{{element.iderror}}" {{#error}} style="display: block;"{{/error}}>
50             {{{error}}}
51         </div>
52     </div>
53 </div>
54 {{^element.frozen}}
55 {{#js}}
56 require(['theme_boost/form-display-errors'], function(module) {
57     module.enhance({{#quote}}{{element.id}}{{/quote}});
58 });
59 {{/js}}
60 {{/element.frozen}}