c030220a95e2ed95b5e801ead511dae4d85da6fc
[moodle.git] / theme / boost / templates / core_form / element-radio.mustache
1 {{!
2     @template theme_boost/core_form/element-radio
4     Example context (json):
5     {
6         "element": {
7             "id": "id_test_radio0",
8             "name": "test_radio_button"
9         }
10     }
12 }}
13 <div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
14     <div class="col-md-3">
15         {{#text}}
16             <label for="{{element.id}}">
17                 {{{label}}}
18             </label>
19         {{/text}}
20     </div>
21     <div class="col-md-9 checkbox">
22         <label>
23         <input type="radio" name="{{element.name}}"
24             id="{{element.id}}" value="{{element.value}}"
25             {{#element.checked}}checked{{/element.checked}}
26             {{#element.frozen}}disabled{{/element.frozen}}
27             {{#error}}
28                 autofocus aria-describedby="id_error_{{element.name}}"
29             {{/error}} {{{element.attributes}}} >
30         {{#text}}
31             {{{.}}}
32         {{/text}}
33         {{^text}}
34             {{{label}}}
35         {{/text}}
36         </label>
37         <span class="text-nowrap">
38             {{#required}}<abbr class="initialism text-danger" title="{{#str}}required{{/str}}">✲</abbr>{{/required}}
39             {{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">❗</abbr>{{/advanced}}
40             {{{helpbutton}}}
41         </span>
42         <div class="form-control-feedback" id="id_error_{{element.name}}" {{^error}} style="display: none;"{{/error}}>
43             {{{error}}}
44         </div>
45     </div>
46 </div>
47 {{^element.frozen}}
48 {{#js}}
49 require(['theme_boost/form-display-errors'], function(module) {
50     module.enhance({{#quote}}{{element.id}}{{/quote}});
51 });
52 {{/js}}
53 {{/element.frozen}}