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 |
Manage competency frameworks template.
|
|
|
19 |
|
|
|
20 |
Classes required for JS:
|
|
|
21 |
* drag-parentnode
|
|
|
22 |
* drag-handlecontainer
|
|
|
23 |
* drag-samenode
|
|
|
24 |
* competencyframeworkactions
|
|
|
25 |
|
|
|
26 |
Data attributes required for JS:
|
|
|
27 |
* data-region = managecompetencies
|
|
|
28 |
* data-frameworkid = id
|
|
|
29 |
* data-action = deletecompetencyframework
|
|
|
30 |
|
|
|
31 |
Context variables required for this template:
|
|
|
32 |
* competencyframeworks - array of objects containing id, shortname, idnumber, visible
|
|
|
33 |
* canmanage - true if this user has permission to manage the frameworks
|
|
|
34 |
* navigation - array of strings containing buttons for navigation
|
|
|
35 |
}}
|
|
|
36 |
<div data-region="managecompetencies">
|
|
|
37 |
<div class="float-left">
|
|
|
38 |
{{#navigation}}
|
|
|
39 |
{{{.}}}
|
|
|
40 |
{{/navigation}}
|
|
|
41 |
</div>
|
|
|
42 |
<table class="generaltable fullwidth managecompetencies">
|
|
|
43 |
<caption>{{#str}}listcompetencyframeworkscaption, tool_lp{{/str}}</caption>
|
|
|
44 |
<thead>
|
|
|
45 |
<tr>
|
|
|
46 |
<th scope="col">{{#str}}competencyframeworkname, tool_lp{{/str}}</th>
|
|
|
47 |
<th scope="col">{{#str}}competencies, core_competency{{/str}}</th>
|
|
|
48 |
<th scope="col">{{#str}}category, tool_lp{{/str}}</th>
|
|
|
49 |
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
|
|
|
50 |
</tr>
|
|
|
51 |
</thead>
|
|
|
52 |
<tbody class="drag-parentnode">
|
|
|
53 |
{{#competencyframeworks}}
|
|
|
54 |
<tr class="drag-samenode" data-frameworkid="{{id}}">
|
|
|
55 |
<td><span class="drag-handlecontainer"></span><span><a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{id}}&pagecontextid={{pagecontextid}}">{{{shortname}}} ({{idnumber}})</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
|
|
|
56 |
<td>{{competenciescount}}</td>
|
|
|
57 |
<td>{{contextnamenoprefix}}</td>
|
|
|
58 |
<td>
|
|
|
59 |
{{#canmanage}}
|
|
|
60 |
<ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
|
|
|
61 |
<li>
|
|
|
62 |
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
|
|
|
63 |
<ul class="dropdown dropdown-menu">
|
|
|
64 |
<li class="dropdown-item">
|
|
|
65 |
<a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{id}}&pagecontextid={{pagecontextid}}">
|
|
|
66 |
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
|
|
|
67 |
</a>
|
|
|
68 |
</li>
|
|
|
69 |
<li class="dropdown-item">
|
|
|
70 |
<a data-action="duplicatecompetencyframework" href="#" data-frameworkid="{{id}}">
|
|
|
71 |
{{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
|
|
|
72 |
</a>
|
|
|
73 |
</li>
|
|
|
74 |
<li class="dropdown-item">
|
|
|
75 |
<a data-action="deletecompetencyframework" href="#" data-frameworkid="{{id}}">
|
|
|
76 |
{{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
|
|
|
77 |
</a>
|
|
|
78 |
</li>
|
|
|
79 |
</ul>
|
|
|
80 |
</li>
|
|
|
81 |
</ul>
|
|
|
82 |
{{/canmanage}}
|
|
|
83 |
</td>
|
|
|
84 |
</tr>
|
|
|
85 |
{{/competencyframeworks}}
|
|
|
86 |
</tbody>
|
|
|
87 |
</table>
|
|
|
88 |
{{^competencyframeworks}}
|
|
|
89 |
<p class="alert alert-info">
|
|
|
90 |
{{#str}}nocompetencyframeworks, tool_lp{{/str}}
|
|
|
91 |
</p>
|
|
|
92 |
{{/competencyframeworks}}
|
|
|
93 |
|
|
|
94 |
{{#js}}
|
|
|
95 |
// Initialise the JS.
|
|
|
96 |
require(['tool_lp/frameworkactions',
|
|
|
97 |
'tool_lp/menubar'],
|
|
|
98 |
function(actionsMod, menubar) {
|
|
|
99 |
|
|
|
100 |
actionsMod.init({{pagecontextid}});
|
|
|
101 |
|
|
|
102 |
menubar.enhance('.competencyframeworkactions', {
|
|
|
103 |
"[data-action='deletecompetencyframework']": actionsMod.deleteHandler,
|
|
|
104 |
"[data-action='duplicatecompetencyframework']": actionsMod.duplicateHandler,
|
|
|
105 |
});
|
|
|
106 |
});
|
|
|
107 |
|
|
|
108 |
{{/js}}
|
|
|
109 |
|
|
|
110 |
</div>
|