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/manage_competencies_page
19
 
20
    Manage competencies template.
21
 
22
    Classes required for JS:
23
 
24
    Data attibutes required for JS:
25
    * data-action=add
26
    * data-enhance=tree
27
    * data-region=term
28
    * data-region=selected-competency
29
 
30
    Example context (json):
31
    {
32
        "framework": {
33
            "description": "Framework",
34
            "id": 0
35
        },
36
        "competencies": [],
37
        "canmanage": false
38
    }
39
}}
40
<div data-region="managecompetencies">
41
<h2>
42
    {{{framework.shortname}}}
43
    {{#canmanage}}
44
            <a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{framework.id}}&pagecontextid={{pagecontextid}}&return=competencies">{{#pix}}t/edit, core, {{#str}}editcompetencyframework, tool_lp{{/str}}{{/pix}}</a>
45
    {{/canmanage}}
46
</h2>
47
<div>{{{framework.description}}}</div>
48
    <h3>{{#str}}competencies, core_competency{{/str}}</h3>
49
    <div class="row">
50
        <div class="col-lg-6">
51
            <p>
52
                <form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="d-flex flex-wrap align-items-center">
53
                    <div class="input-group mb-3">
54
                        <label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
55
                        <input class="form-control" type="text" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
56
                        <div class="input-group-append">
57
                            <button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
58
                        </div>
59
                    </div>
60
                </form>
61
            </p>
62
            <ul data-enhance="tree" class="competency-tree">
63
                {{> tool_lp/loading }}
64
            </ul>
65
        </div>
66
 
67
        <div class="col-lg-6">
68
            <div class="border p-2 mb-2">
69
                <div class="card-title">
70
                    <h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
71
                        <span data-region="competencyactionsmenu" class="float-sm-right">
72
                            <ul title="{{#str}}edit{{/str}}" class="competencyactionsmenu">
73
                                <li>
74
                                    <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
75
                                    <ul class="dropdown dropdown-menu">
76
                                    {{#canmanage}}
77
                                    <li class="dropdown-item">
78
                                        <a href="#" data-action="edit">
79
                                            {{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
80
                                        </a>
81
                                    </li>
82
                                    <li class="dropdown-item">
83
                                        <a href="#" data-action="move">
84
                                            {{#pix}}t/move{{/pix}} {{#str}}movetonewparent, tool_lp{{/str}}
85
                                        </a>
86
                                    </li>
87
                                    <li class="dropdown-item">
88
                                        <a href="#" data-action="delete">
89
                                            {{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
90
                                        </a>
91
                                    </li>
92
                                    <li class="dropdown-item">
93
                                        <a href="#" data-action="moveup">
94
                                            {{#pix}}t/up{{/pix}} {{#str}}moveup{{/str}}
95
                                        </a>
96
                                    </li>
97
                                    <li class="dropdown-item">
98
                                        <a href="#" data-action="movedown">
99
                                            {{#pix}}t/down{{/pix}} {{#str}}movedown{{/str}}
100
                                        </a>
101
                                    </li>
102
                                    {{/canmanage}}
103
                                    <li class="dropdown-item">
104
                                        <a href="#" data-action="linkedcourses">
105
                                            {{#pix}}t/viewdetails{{/pix}} {{#str}}linkedcourses, tool_lp{{/str}}
106
                                        </a>
107
                                    </li>
108
                                    {{#canmanage}}
109
                                    <li class="dropdown-item">
110
                                        <a href="#" data-action="relatedcompetencies">
111
                                            {{#pix}}t/add{{/pix}} {{#str}}addcrossreferencedcompetency, tool_lp{{/str}}
112
                                        </a>
113
                                    </li>
114
                                    <li class="dropdown-item">
115
                                        <a href="#" data-action="competencyrules">
116
                                            {{#pix}}t/edit{{/pix}} {{#str}}competencyrule, tool_lp{{/str}}
117
                                        </a>
118
                                    </li>
119
                                    {{/canmanage}}
120
                                </ul>
121
                            </li>
122
                        </ul>
123
                    </span>
124
                </div>
125
                <p data-region="competencyinfo">
126
                    {{#str}}nocompetencyselected, tool_lp{{/str}}
127
                </p>
128
                <div data-region="competencyactions">
129
                    {{#canmanage}}
130
                    <button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} <span data-region="term"></span></button>
131
                    {{/canmanage}}
132
                </div>
133
            </div>
134
        </div>
135
    </div>
136
</div>
137
 
138
{{#js}}
139
// Initialise the JS.
140
require(['tool_lp/tree', 'tool_lp/competencytree', 'tool_lp/competencyactions', 'jquery'],
141
        function(ariatree, treeModel, actions, $) {
142
 
143
    treeModel.init({{framework.id}},
144
                   {{#quote}} {{{framework.shortname}}} {{/quote}},
145
                   '{{search}}',
146
                   '[data-enhance=tree]',
147
                   {{canmanage}},
148
                   {{competencyid}});
149
 
150
    actions.init(treeModel, {{pagecontextid}}, '{{{framework.taxonomies}}}', {{{rulesmodules}}});
151
 
152
});
153
{{/js}}
154