MDL-56800 theme_boost: Remove name from hardFrozen radio
[moodle.git] / theme / boost / templates / core_form / element-radio.mustache
CommitLineData
e816b872
DP
1{{!
2 @template theme_boost/core_form/element-radio
3
4 Example context (json):
5 {
6 "element": {
c03f1de1
DM
7 "id": "id_test_radio0",
8 "name": "test_radio_button"
e816b872
DP
9 }
10 }
11
12}}
58488d0f 13<div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
dc801cb6
MN
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">
344321e1 22 <label>
06ded0ed
AN
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}}
c03f1de1 27 id="{{element.id}}" value="{{element.value}}"
e816b872 28 {{#element.checked}}checked{{/element.checked}}
edd83703 29 {{#element.frozen}}disabled{{/element.frozen}}
344321e1
DW
30 {{#error}}
31 autofocus aria-describedby="id_error_{{element.name}}"
32 {{/error}} {{{element.attributes}}} >
dc801cb6
MN
33 {{#text}}
34 {{{.}}}
35 {{/text}}
36 {{^text}}
70f00107 37 {{{label}}}
dc801cb6
MN
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>
344321e1
DW
45 <div class="form-control-feedback" id="id_error_{{element.name}}" {{^error}} style="display: none;"{{/error}}>
46 {{{error}}}
47 </div>
48 </div>
49</div>
63e4df60 50{{^element.frozen}}
344321e1 51{{#js}}
2ede86d7 52require(['theme_boost/form-display-errors'], function(module) {
4691b2d0 53 module.enhance({{#quote}}{{element.id}}{{/quote}});
344321e1 54});
63e4df60
DW
55{{/js}}
56{{/element.frozen}}