MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / lp / templates / competency_grader.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16 }}
17 {{!
18     @template tool_lp/competency_grader
20     Template for grading a competency.
22     Classes required for JS:
23       None
25     Data required for JS:
26     * ratings - list of value, name selected for valid ratings
28     Example context (json):
29     {
30         "ratings": [
31             {"name": "Bad", "value": 0, "selected": true},
32             {"name": "OK", "value": 1},
33             {"name": "Good", "value": 2}
34         ]
35     }
36 }}
37 <div class="competency-grader" data-region="competency-grader">
38     <form>
39         <div class="content">
40             <div data-region="rating">
41                 <label for="rating_{{uniqid}}">{{#str}}rating, tool_lp{{/str}}</label>
42                 <select name="rating" id="rating_{{uniqid}}" class="custom-select">
43                     {{#ratings}}
44                         <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
45                     {{/ratings}}
46                 </select>
47             </div>
48             <div data-region="comment" class="mt-1">
49                 <label for="comment_{{uniqid}}">{{#str}}ratecomment, tool_lp{{/str}}</label>
50                 <textarea name="comment" id="comment_{{uniqid}}" class="form-control mb-1"></textarea>
51             </div>
52         </div>
53         <div data-region="footer" class="float-sm-right">
54             <button data-action="rate" class="btn btn-primary">{{#str}}rate, tool_lp{{/str}}</button>
55             <button data-action="cancel" class="btn btn-secondary">{{#str}}cancel{{/str}}</button>
56         </div>
57         <div class="clearfix"></div>
58     </form>
59 </div>