MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / lp / templates / competency_picker.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_picker
20     Show a competency tree and allow picking a competency.
22     Context variables required for this template:
23     * frameworks - array of competency framework
24       * id
25       * shortname
26       * idnumber
27       * selected
29     * framework - competency framework
30       * id
31       * name
32       * shortname
33       * idnumber
35     * competencies - array of nodes
36       * id - competency id
37       * name - competency idnumber
38       * children - array of children
39       * haschildren - boolean
41     Example context (json):
42     {
43         "frameworks": [
44             {
45                 "id": "1",
46                 "shortname": "Framework",
47                 "idnumber": "F1"
48             }
49         ],
50         "competencies": [
51         ]
52     }
53 }}
54 <div data-region="competencylinktree">
55 {{^singleFramework}}
56 <h3>{{#str}}competencyframeworks, tool_lp{{/str}}</h3>
57 <select data-action="chooseframework" class="custom-select">
58 {{#frameworks}}
59 <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} <em>{{idnumber}}</em></option>
60 {{/frameworks}}
61 </select>
62 {{/singleFramework}}
63 <h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>
65 <form data-region="filtercompetencies" class="form-inline" data-frameworkid="{{framework.id}}">
66     <div class="form-group">
67         <label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
68         <input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
69         <button class="btn btn-secondary">{{#pix}}a/search, ,{{#str}}search{{/str}}{{/pix}}</button>
70     </div>
71 </form>
72 <ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
73     <li><span>{{{framework.shortname}}}</span>
74         <ul>
75             {{#competencies}}
76                 {{> tool_lp/competencies_tree }}
77             {{/competencies}}
78         </ul>
79     </li>
80 </ul>
81 <div data-region="link-buttons" class="mt-1 float-sm-right">
82     <input type="button" class="btn btn-primary" data-action="add" value="{{#str}}add{{/str}}"/>
83     <input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
84 </div>
85 <div class="clearfix"></div>
86 </div>