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 |
<h3 class="d-inline-flex align-items-center w-100 mb-4">
|
|
|
42 |
{{{framework.shortname}}}
|
|
|
43 |
{{#canmanage}}
|
|
|
44 |
<a class="btn btn-icon btn-secondary ml-3" href="{{pluginbaseurl}}/editcompetencyframework.php?id={{framework.id}}&pagecontextid={{pagecontextid}}&return=competencies" title="{{#str}}editcompetencyframework, tool_lp{{/str}}">
|
|
|
45 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
|
|
|
46 |
</a>
|
|
|
47 |
{{/canmanage}}
|
|
|
48 |
</h2>
|
|
|
49 |
|
|
|
50 |
<div class="rui-framework-desc">{{{framework.description}}}</div>
|
|
|
51 |
|
|
|
52 |
<h5>{{#str}}competencies, core_competency{{/str}}</h5>
|
|
|
53 |
<div class="row-fluid row">
|
|
|
54 |
<div class="col-lg-6">
|
|
|
55 |
<div class="simplesearchform">
|
|
|
56 |
<form data-region="filtercompetencies" data-planid="{{plan.id}}" class="form-inline">
|
|
|
57 |
<div class="search-input-group d-inline-flex justify-content-between w-100">
|
|
|
58 |
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
|
|
|
59 |
<span class="search-input-icon">
|
|
|
60 |
<svg width="20" height="20" fill="none" viewBox="0 0 24 24">
|
|
|
61 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 19.25L15.5 15.5M4.75 11C4.75 7.54822 7.54822 4.75 11 4.75C14.4518 4.75 17.25 7.54822 17.25 11C17.25 14.4518 14.4518 17.25 11 17.25C7.54822 17.25 4.75 14.4518 4.75 11Z"></path>
|
|
|
62 |
</svg>
|
|
|
63 |
</span>
|
|
|
64 |
<input type="text"
|
|
|
65 |
id="filter{{uniqid}}"
|
|
|
66 |
class="search-input w-100"
|
|
|
67 |
placeholder="{{#str}}search, tool_lp{{/str}}"
|
|
|
68 |
aria-label="{{#str}}search, tool_lp{{/str}}"
|
|
|
69 |
name="{{ inputname }}"
|
|
|
70 |
data-region="input"
|
|
|
71 |
autocomplete="off"
|
|
|
72 |
value="{{ search }}"
|
|
|
73 |
>
|
|
|
74 |
<button type="submit" class="search-input-btn">
|
|
|
75 |
<svg width="22" height="22" fill="none" viewBox="0 0 24 24">
|
|
|
76 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.75 6.75L19.25 12L13.75 17.25"></path>
|
|
|
77 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H4.75"></path>
|
|
|
78 |
</svg>
|
|
|
79 |
<span class="sr-only">{{ searchstring }}</span>
|
|
|
80 |
</button>
|
|
|
81 |
</div>
|
|
|
82 |
</form>
|
|
|
83 |
</div>
|
|
|
84 |
<ul data-enhance="tree" class="competency-tree mt-2 mx-0 p-3">
|
|
|
85 |
{{> tool_lp/loading }}
|
|
|
86 |
</ul>
|
|
|
87 |
</div>
|
|
|
88 |
|
|
|
89 |
<div class="col-lg-6">
|
|
|
90 |
<div class="card p-2 p-md-3 border-radius">
|
|
|
91 |
<div class="card-title">
|
|
|
92 |
<h5 data-region="selected-competency" class="border-bottom pt-2 pb-2 mb-0 float-left">{{#str}}selectedcompetency, tool_lp{{/str}}</h5>
|
|
|
93 |
<span data-region="competencyactionsmenu" class="float-right">
|
|
|
94 |
<ul title="{{#str}}edit{{/str}}" class="competencyactionsmenu mb-0 px-0">
|
|
|
95 |
<li>
|
|
|
96 |
<a href="#" class="btn btn-icon btn-secondary" title="{{#str}}edit{{/str}}">
|
|
|
97 |
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
|
|
|
98 |
</a>
|
|
|
99 |
<ul class="dropdown dropdown-menu">
|
|
|
100 |
{{#canmanage}}
|
|
|
101 |
<li class="dropdown-item">
|
|
|
102 |
<a href="#" data-action="edit">
|
|
|
103 |
{{#pix}}t/edit, core,{{/pix}} {{#str}}edit{{/str}}
|
|
|
104 |
</a>
|
|
|
105 |
</li>
|
|
|
106 |
<li class="dropdown-item">
|
|
|
107 |
<a href="#" data-action="move">
|
|
|
108 |
{{#pix}}t/move, core,{{/pix}} {{#str}}movetonewparent, tool_lp{{/str}}
|
|
|
109 |
</a>
|
|
|
110 |
</li>
|
|
|
111 |
<li class="dropdown-item">
|
|
|
112 |
<a href="#" data-action="delete">
|
|
|
113 |
{{#pix}}t/delete, core,{{/pix}} {{#str}}delete{{/str}}
|
|
|
114 |
</a>
|
|
|
115 |
</li>
|
|
|
116 |
<li class="dropdown-item">
|
|
|
117 |
<a href="#" data-action="moveup">
|
|
|
118 |
{{#pix}}t/up, core,{{/pix}} {{#str}}moveup{{/str}}
|
|
|
119 |
</a>
|
|
|
120 |
</li>
|
|
|
121 |
<li class="dropdown-item">
|
|
|
122 |
<a href="#" data-action="movedown">
|
|
|
123 |
{{#pix}}t/down, core,{{/pix}} {{#str}}movedown{{/str}}
|
|
|
124 |
</a>
|
|
|
125 |
</li>
|
|
|
126 |
{{/canmanage}}
|
|
|
127 |
<li class="dropdown-item">
|
|
|
128 |
<a href="#" data-action="linkedcourses">
|
|
|
129 |
{{#pix}}t/viewdetails, core,{{/pix}} {{#str}}linkedcourses, tool_lp{{/str}}
|
|
|
130 |
</a>
|
|
|
131 |
</li>
|
|
|
132 |
{{#canmanage}}
|
|
|
133 |
<li class="dropdown-item">
|
|
|
134 |
<a href="#" data-action="relatedcompetencies">
|
|
|
135 |
{{#pix}}t/add, core,{{/pix}} {{#str}}addcrossreferencedcompetency, tool_lp{{/str}}
|
|
|
136 |
</a>
|
|
|
137 |
</li>
|
|
|
138 |
<li class="dropdown-item">
|
|
|
139 |
<a href="#" data-action="competencyrules">
|
|
|
140 |
{{#pix}}t/edit, core,{{/pix}} {{#str}}competencyrule, tool_lp{{/str}}
|
|
|
141 |
</a>
|
|
|
142 |
</li>
|
|
|
143 |
{{/canmanage}}
|
|
|
144 |
</ul>
|
|
|
145 |
</li>
|
|
|
146 |
</ul>
|
|
|
147 |
</span>
|
|
|
148 |
</div>
|
|
|
149 |
<div data-region="competencyinfo">
|
|
|
150 |
<div class="badge badge-warning">{{#str}}nocompetencyselected, tool_lp{{/str}}</div>
|
|
|
151 |
</div>
|
|
|
152 |
<div data-region="competencyactions" class="mb-0">
|
|
|
153 |
{{#canmanage}}
|
|
|
154 |
<button class="btn btn-primary" data-action="add">
|
|
|
155 |
<span class="mr-2">
|
|
|
156 |
<svg width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
|
157 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4.75 12C4.75 7.99594 7.99594 4.75 12 4.75V4.75C16.0041 4.75 19.25 7.99594 19.25 12V12C19.25 16.0041 16.0041 19.25 12 19.25V19.25C7.99594 19.25 4.75 16.0041 4.75 12V12Z"></path>
|
|
|
158 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 8.75003V15.25"></path>
|
|
|
159 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15.25 12L8.75 12"></path>
|
|
|
160 |
</svg>
|
|
|
161 |
</span>
|
|
|
162 |
<span data-region="term"></span>
|
|
|
163 |
</button>
|
|
|
164 |
{{/canmanage}}
|
|
|
165 |
</div>
|
|
|
166 |
</div>
|
|
|
167 |
</div>
|
|
|
168 |
</div>
|
|
|
169 |
|
|
|
170 |
</div>
|
|
|
171 |
|
|
|
172 |
{{#js}}
|
|
|
173 |
// Initialise the JS.
|
|
|
174 |
require(['tool_lp/tree', 'tool_lp/competencytree', 'tool_lp/competencyactions', 'jquery'],
|
|
|
175 |
function(ariatree, treeModel, actions, $) {
|
|
|
176 |
|
|
|
177 |
treeModel.init({{framework.id}},
|
|
|
178 |
{{#quote}} {{{framework.shortname}}} {{/quote}},
|
|
|
179 |
'{{search}}',
|
|
|
180 |
'[data-enhance=tree]',
|
|
|
181 |
{{canmanage}},
|
|
|
182 |
{{competencyid}});
|
|
|
183 |
|
|
|
184 |
actions.init(treeModel, {{pagecontextid}}, '{{{framework.taxonomies}}}', {{{rulesmodules}}});
|
|
|
185 |
|
|
|
186 |
});
|
|
|
187 |
{{/js}}
|
|
|
188 |
|