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_user_plans
19
 
20
    Show a competency tree and allow picking a competency.
21
 
22
    Context variables required for this template:
23
    * singlePlan - boolean
24
 
25
    * plans - array of plans
26
      * id
27
      * selected
28
      * name
29
 
30
    * plan
31
      * id
32
      * name
33
 
34
    * competencies - array of nodes
35
      * id - competency id
36
      * name - competency idnumber
37
      * children - array of children
38
      * haschildren - boolean
39
 
40
    Example context (json):
41
    {
42
        "singlePlan": false,
43
        "plans": [
44
            {
45
                "id": "1",
46
                "name": "Plan"
47
            }
48
        ],
49
        "plan": {
50
            "id": "1",
51
            "name": "Plan"
52
        },
53
        "competencies": []
54
    }
55
}}
56
 
57
<div data-region="competencylinktree">
58
{{^singlePlan}}
59
    <h3>{{#str}}learningplans, tool_lp{{/str}}</h3>
60
    <select data-action="chooseplan" class="custom-select">
61
    {{#plans}}
62
        <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{name}}}</option>
63
    {{/plans}}
64
    </select>
65
{{/singlePlan}}
66
 
67
<h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>
68
 
69
<form data-region="filtercompetencies" data-planid="{{plan.id}}" class="d-flex flex-wrap align-items-center">
70
    <div class="mb-3 d-flex">
71
        <label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
72
        <input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
73
        <button class="btn btn-secondary ml-1">{{#pix}}a/search, ,{{#str}}search{{/str}}{{/pix}}</button>
74
    </div>
75
</form>
76
 
77
<ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
78
    <li><span>{{{plan.name}}}</span>
79
        <ul>
80
            {{#competencies}}
81
                {{> tool_lp/competencies_tree }}
82
            {{/competencies}}
83
        </ul>
84
    </li>
85
</ul>
86
 
87
<div data-region="link-buttons" class="mt-1 float-sm-right">
88
    <input type="button" class="btn btn-primary" data-action="add" value="{{#str}}add{{/str}}"/>
89
    <input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
90
</div>
91
<div class="clearfix"></div>
92
</div>