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/competencies_tree
19
 
20
    Recursively build a competencies tree.
21
 
22
    Classes required for JS:
23
 
24
    Data attibutes required for JS:
25
    * data-enhance=movetree
26
 
27
    Context variables required for this template:
28
    * id, shortname, idnumber, sortorder, parentid, competencyframeworkid, path, children
29
 
30
    Example context (json):
31
    {
32
        "id": 1,
33
        "shortname": "short",
34
        "idnumber": "SHORT",
35
        "sortorder": 1,
36
        "parentid": 0,
37
        "competencyframeworkid": 1,
38
        "path": "/",
39
        "haschildren": true,
40
        "children": [{
41
            "id": 2,
42
            "shortname": "child",
43
            "idnumber": "CHILD",
44
            "sortorder": 1,
45
            "parentid": 1,
46
            "competencyframeworkid": 1,
47
            "path": "/1/",
48
            "children": []
49
        }]
50
    }
51
}}
52
<li data-id="{{id}}" class="m-1">
53
    {{#canmanage}}
54
    <span draggable="true" class="p-2">
55
        {{{shortname}}}
56
    </span>
57
    {{/canmanage}}
58
    {{^canmanage}}
59
    <span class="p-2">
60
        {{{shortname}}}
61
    </span>
62
    {{/canmanage}}
63
    {{#haschildren}}
64
    <ul class="pl-2">
65
    {{#children}}
66
    {{> tool_lp/competencies_tree }}
67
    {{/children}}
68
    </ul>
69
    {{/haschildren}}
70
</li>