MDL-65217 form: allow to pass attributes to course element
[moodle.git] / lib / form / templates / element-advcheckbox.mustache
CommitLineData
58488d0f 1<div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
dc801cb6
MN
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">
3ec69c2e
BB
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="id_error_{{element.name}}"
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>
d2d150b2 46 <div class="form-control-feedback invalid-feedback" id="id_error_{{element.name}}" {{#error}} style="display: block;"{{/error}}>
63e4df60
DW
47 {{{error}}}
48 </div>
49 </div>
50</div>
51{{^element.frozen}}
52{{#js}}
2ede86d7 53require(['theme_boost/form-display-errors'], function(module) {
63e4df60
DW
54 module.enhance({{#quote}}{{element.id}}{{/quote}});
55});
56{{/js}}
57{{/element.frozen}}