MDL-55584 theme_noname: Patching for better feel in grades
[moodle.git] / theme / noname / templates / core / single_select.mustache
1 <div class="{{classes}} d-inline-block">
2     <form method="{{method}}" action="{{action}}" class="form-inline">
3         {{#params}}
4             <input type="hidden" name="{{name}}" value="{{value}}">
5         {{/params}}
6         <div class="form-group">
7             {{#label}}
8                 <label for="{{id}}" {{#labelattributes}}{{name}}="{{value}}" {{/labelattributes}}>
9                     {{{label}}}
10                 </label>
11             {{/label}}
12             {{#helpicon}}
13                 {{>core/help_icon}}
14             {{/helpicon}}
15             <select {{#attributes}}{{name}}="{{value}}" {{/attributes}} id="{{id}}" class="custom-select {{classes}}" name="{{name}}">
16                 {{#options}}
17                     <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
18                 {{/options}}
19             </select>
20         </div>
21         <noscript>
22             <button type="submit" class="btn btn-secondary">{{#str}}go, core{{/str}}</button>
23         </noscript>
24     </form>
25 </div>
26 {{#js}}
27 require(['core/yui'], function(Y) {
28     Y.use('moodle-core-formautosubmit', function() {
29         M.core.init_formautosubmit({
30             selectid: '{{id}}',
31             nothing: {{#hasnothing}}'{{nothingkey}}'{{/hasnothing}}{{^hasnothing}}false{{/hasnothing}}
32         });
33     });
34 });
35 {{/js}}