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/>.
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
29 * framework - competency framework
35 * competencies - array of nodes
37 * name - competency idnumber
38 * children - array of children
39 * haschildren - boolean
41 Example context (json):
46 "shortname": "Framework",
54 <div data-region="competencylinktree">
56 <h3>{{#str}}competencyframeworks, tool_lp{{/str}}</h3>
57 <select data-action="chooseframework" class="custom-select">
59 <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} <em>{{idnumber}}</em></option>
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>
72 <ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
73 <li><span>{{{framework.shortname}}}</span>
76 {{> tool_lp/competencies_tree }}
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}}"/>
85 <div class="clearfix"></div>