Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
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.
8
 
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.
13
 
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
19
 
20
    Show a competency tree and allow picking a competency.
21
 
22
    Context variables required for this template:
23
    * frameworks - array of competency framework
24
      * id
25
      * shortname
26
      * idnumber
27
      * selected
28
 
29
    * framework - competency framework
30
      * id
31
      * name
32
      * shortname
33
      * idnumber
34
 
35
    * competencies - array of nodes
36
      * id - competency id
37
      * name - competency idnumber
38
      * children - array of children
39
      * haschildren - boolean
40
 
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>
64
 
65
<form data-region="filtercompetencies" class="d-flex flex-wrap align-items-center" data-frameworkid="{{framework.id}}">
66
    <div class="mb-3 d-flex">
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 ml-1">{{#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>