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 learning plan templates template.
20 Classes required for JS:
25 Data attibutes required for JS:
26 * data-region = managetemplates
27 * data-templateid = id
28 * data-action = deletetemplate
30 Context variables required for this template:
31 * templates - array of objects containing id, shortname, visible, canmanage, contextname
32 * navigation - array of strings containing buttons for navigation
34 <div data-region="managetemplates">
35 <div class="btn-group pull-right">
40 <table class="generaltable fullwidth managetemplates">
41 <caption>{{#str}}listtemplatescaption, tool_lp{{/str}}</caption>
44 <th scope="col">{{#str}}templatename, tool_lp{{/str}}</th>
45 <th scope="col">{{#str}}context, core_role{{/str}}</th>
46 <th scope="col">{{#str}}cohorts, core_cohort{{/str}}</th>
47 <th scope="col">{{#str}}userplans, tool_lp{{/str}}</th>
49 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
53 <tbody class="drag-parentnode">
55 <tr class="drag-samenode" data-templateid="{{id}}">
56 <td><a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&pagecontextid={{pagecontextid}}">{{shortname}}</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
57 <td>{{contextname}}</td>
58 <td><a class="template-cohorts" href="{{pluginbaseurl}}/template_cohorts.php?id={{id}}&pagecontextid={{pagecontextid}}">{{cohortscount}}</a></td>
59 <td><a class="template-userplans" href="{{pluginbaseurl}}/template_plans.php?id={{id}}&pagecontextid={{pagecontextid}}">{{planscount}}</a></td>
62 <ul class="templateactions">
64 <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
65 <ul class="dropdown-menu">
67 <a href="{{pluginbaseurl}}/edittemplate.php?id={{id}}&pagecontextid={{pagecontextid}}&return=templates">
68 {{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
72 <a data-action="duplicatetemplate" data-templateid="{{id}}" href="#">
73 {{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
77 <a data-action="deletetemplate" data-templateid="{{id}}" href="#">
78 {{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
91 <p class="alert-info">
92 {{#str}}notemplates, tool_lp{{/str}}
98 require(['tool_lp/templateactions',
100 function(actionsMod, menubar) {
102 actionsMod.init({{pagecontextid}});
104 menubar.enhance('.templateactions', {
105 '[data-action="deletetemplate"]': actionsMod.deleteHandler,
106 '[data-action="duplicatetemplate"]': actionsMod.duplicateHandler