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
    <h4>{{#str}}learningplans, tool_lp{{/str}}</h4>
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
<h5 class="mt-3">{{#str}}locatecompetency, tool_lp{{/str}}</h5>
68
<div class="simplesearchform">
69
    <form data-region="filtercompetencies" data-planid="{{plan.id}}" class="form-inline">
70
        <div class="search-input-group d-inline-flex justify-content-between w-100">
71
            <label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
72
            <span class="search-input-icon">
73
                <svg width="20" height="20" fill="none" viewBox="0 0 24 24">
74
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 19.25L15.5 15.5M4.75 11C4.75 7.54822 7.54822 4.75 11 4.75C14.4518 4.75 17.25 7.54822 17.25 11C17.25 14.4518 14.4518 17.25 11 17.25C7.54822 17.25 4.75 14.4518 4.75 11Z"></path>
75
                </svg>
76
            </span>
77
            <input type="text"
78
            id="filter{{uniqid}}"
79
            class="search-input w-100"
80
            placeholder="{{#str}}search, tool_lp{{/str}}"
81
            aria-label="{{#str}}search, tool_lp{{/str}}"
82
            name="{{ inputname }}"
83
            data-region="input"
84
            autocomplete="off"
85
            value="{{ search }}"
86
            >
87
            <button type="submit" class="search-input-btn">
88
                <svg width="22" height="22" fill="none" viewBox="0 0 24 24">
89
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.75 6.75L19.25 12L13.75 17.25"></path>
90
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H4.75"></path>
91
                </svg>
92
                <span class="sr-only">{{ searchstring }}</span>
93
            </button>
94
        </div>
95
    </form>
96
</div>
97
<ul data-enhance="linktree" style="display: none;" class="mt-2 mx-0 p-3 competency-tree">
98
    <li><span>{{{plan.name}}}</span>
99
        <ul class="pl-2">
100
            {{#competencies}}
101
                {{> tool_lp/competencies_tree }}
102
            {{/competencies}}
103
        </ul>
104
    </li>
105
</ul>
106
 
107
<div data-region="link-buttons" class="mt-1 float-sm-right">
108
    <input type="button" class="btn btn-primary" data-action="add" value="{{#str}}add{{/str}}"/>
109
    <input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
110
</div>
111
<div class="clearfix"></div>
112
</div>