MDL-56800 theme_boost: Remove name from hardFrozen radio
[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         {{^element.hardfrozen}}{{#element.frozen}}{{#element.checked}}
24             <input type="hidden" name="{{element.name}}" value="{{element.value}}">
25         {{/element.checked}}{{/element.frozen}}{{/element.hardfrozen}}
26         <input type="radio" {{^element.hardfrozen}}name="{{element.name}}"{{/element.hardfrozen}}
27             id="{{element.id}}" value="{{element.value}}"
28             {{#element.checked}}checked{{/element.checked}}
29             {{#element.frozen}}disabled{{/element.frozen}}
30             {{#error}}
31                 autofocus aria-describedby="id_error_{{element.name}}"
32             {{/error}} {{{element.attributes}}} >
33         {{#text}}
34             {{{.}}}
35         {{/text}}
36         {{^text}}
37             {{{label}}}
38         {{/text}}
39         </label>
40         <span class="text-nowrap">
41             {{#required}}<abbr class="initialism text-danger" title="{{#str}}required{{/str}}">✲</abbr>{{/required}}
42             {{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">❗</abbr>{{/advanced}}
43             {{{helpbutton}}}
44         </span>
45         <div class="form-control-feedback" id="id_error_{{element.name}}" {{^error}} style="display: none;"{{/error}}>
46             {{{error}}}
47         </div>
48     </div>
49 </div>
50 {{^element.frozen}}
51 {{#js}}
52 require(['theme_boost/form-display-errors'], function(module) {
53     module.enhance({{#quote}}{{element.id}}{{/quote}});
54 });
55 {{/js}}
56 {{/element.frozen}}