MDL-64506 templates: Remove BS2 spans from elements.
[moodle.git] / admin / tool / lp / templates / manage_competencies_page.mustache
CommitLineData
d9a39950
DW
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{{!
8aff6f6f
DW
18 @template tool_lp/manage_competencies_page
19
d9a39950
DW
20 Manage competencies template.
21
22 Classes required for JS:
23
24 Data attibutes required for JS:
72c9be0d 25 * data-action=add
d9a39950 26 * data-enhance=tree
8cb101a7
FM
27 * data-region=term
28 * data-region=selected-competency
d9a39950 29
8aff6f6f
DW
30 Example context (json):
31 {
595fa0c5 32 "framework": {
8aff6f6f
DW
33 "description": "Framework",
34 "id": 0
35 },
36 "competencies": [],
37 "canmanage": false
38 }
d9a39950 39}}
8cb101a7 40<div data-region="managecompetencies">
a4f1b030 41<h2>
32cf4bcb 42 {{{framework.shortname}}}
a4f1b030
IT
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>
cb22606c 47<div>{{{framework.description}}}</div>
207136f2 48 <h3>{{#str}}competencies, core_competency{{/str}}</h3>
3ec69c2e 49 <div class="row-fluid row">
6ecc4459 50 <div class="col-lg-6">
207136f2
DW
51 <p>
52 <form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="form-inline">
53 <div class="form-group">
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 <button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
57 </div>
58 </form>
59 </p>
60 <ul data-enhance="tree" class="competency-tree">
61 {{> tool_lp/loading }}
d9a39950 62 </ul>
207136f2
DW
63 </div>
64
6ecc4459 65 <div class="card col-lg-6">
3ec69c2e 66 <div class="card-block card-body">
207136f2
DW
67 <div class="card-title">
68 <h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
69 <span data-region="competencyactionsmenu" class="pull-xs-right">
70 <ul title="{{#str}}edit{{/str}}" class="competencyactionsmenu">
71 <li>
72 <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
7b02521c 73 <ul class="dropdown dropdown-menu">
81a989e6 74 {{#canmanage}}
207136f2
DW
75 <li class="dropdown-item">
76 <a href="#" data-action="edit">
77 {{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
78 </a>
79 </li>
80 <li class="dropdown-item">
81 <a href="#" data-action="move">
82 {{#pix}}t/move{{/pix}} {{#str}}movetonewparent, tool_lp{{/str}}
83 </a>
84 </li>
85 <li class="dropdown-item">
86 <a href="#" data-action="delete">
87 {{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
88 </a>
89 </li>
90 <li class="dropdown-item">
91 <a href="#" data-action="moveup">
92 {{#pix}}t/up{{/pix}} {{#str}}moveup{{/str}}
93 </a>
94 </li>
95 <li class="dropdown-item">
96 <a href="#" data-action="movedown">
97 {{#pix}}t/down{{/pix}} {{#str}}movedown{{/str}}
98 </a>
99 </li>
81a989e6 100 {{/canmanage}}
207136f2
DW
101 <li class="dropdown-item">
102 <a href="#" data-action="linkedcourses">
103 {{#pix}}t/viewdetails{{/pix}} {{#str}}linkedcourses, tool_lp{{/str}}
104 </a>
105 </li>
81a989e6 106 {{#canmanage}}
207136f2
DW
107 <li class="dropdown-item">
108 <a href="#" data-action="relatedcompetencies">
109 {{#pix}}t/add{{/pix}} {{#str}}addcrossreferencedcompetency, tool_lp{{/str}}
110 </a>
111 </li>
112 <li class="dropdown-item">
113 <a href="#" data-action="competencyrules">
114 {{#pix}}t/edit{{/pix}} {{#str}}competencyrule, tool_lp{{/str}}
115 </a>
116 </li>
81a989e6 117 {{/canmanage}}
207136f2
DW
118 </ul>
119 </li>
120 </ul>
121 </span>
122 </div>
123 <p data-region="competencyinfo">
124 {{#str}}nocompetencyselected, tool_lp{{/str}}
125 </p>
207136f2 126 <div data-region="competencyactions">
81a989e6 127 {{#canmanage}}
207136f2 128 <button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} <span data-region="term"></span></button>
81a989e6 129 {{/canmanage}}
207136f2 130 </div>
207136f2
DW
131 </div>
132 </div>
133 </div>
d9a39950
DW
134</div>
135
136{{#js}}
137// Initialise the JS.
85dbaf91
DW
138require(['tool_lp/tree', 'tool_lp/competencytree', 'tool_lp/competencyactions', 'jquery'],
139 function(ariatree, treeModel, actions, $) {
d9a39950 140
fff88ad1 141 treeModel.init({{framework.id}},
32cf4bcb 142 {{#quote}} {{{framework.shortname}}} {{/quote}},
fff88ad1 143 '{{search}}',
d57c079a 144 '[data-enhance=tree]',
15e6a76e
DW
145 {{canmanage}},
146 {{competencyid}});
d9a39950 147
a214d35e 148 actions.init(treeModel, {{pagecontextid}}, '{{{framework.taxonomies}}}', {{{rulesmodules}}});
d9a39950 149
d9a39950
DW
150});
151{{/js}}
152