2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 Manage competency frameworks template.
20 Classes required for JS:
22 * drag-handlecontainer
24 * competencyframeworkactions
26 Data attributes required for JS:
27 * data-region = managecompetencies
28 * data-frameworkid = id
29 * data-action = deletecompetencyframework
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
36 <div data-region="managecompetencies">
37 <div class="float-left">
42 <table class="generaltable fullwidth managecompetencies">
43 <caption>{{#str}}listcompetencyframeworkscaption, tool_lp{{/str}}</caption>
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>
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>
60 <ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
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}}
69 <li class="dropdown-item">
70 <a data-action="duplicatecompetencyframework" href="#" data-frameworkid="{{id}}">
71 {{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
74 <li class="dropdown-item">
75 <a data-action="deletecompetencyframework" href="#" data-frameworkid="{{id}}">
76 {{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
85 {{/competencyframeworks}}
88 {{^competencyframeworks}}
89 <p class="alert alert-info">
90 {{#str}}nocompetencyframeworks, tool_lp{{/str}}
92 {{/competencyframeworks}}
96 require(['tool_lp/frameworkactions',
98 function(actionsMod, menubar) {
100 actionsMod.init({{pagecontextid}});
102 menubar.enhance('.competencyframeworkactions', {
103 "[data-action='deletecompetencyframework']": actionsMod.deleteHandler,
104 "[data-action='duplicatecompetencyframework']": actionsMod.duplicateHandler,