MDL-64506 templates: Remove BS2 spans from elements.
[moodle.git] / admin / tool / lp / templates / manage_competencies_page.mustache
1 {{!
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/>.
16 }}
17 {{!
18     @template tool_lp/manage_competencies_page
20     Manage competencies template.
22     Classes required for JS:
24     Data attibutes required for JS:
25     * data-action=add
26     * data-enhance=tree
27     * data-region=term
28     * data-region=selected-competency
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 <h2>
42     {{{framework.shortname}}}
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>
47 <div>{{{framework.description}}}</div>
48     <h3>{{#str}}competencies, core_competency{{/str}}</h3>
49     <div class="row-fluid row">
50         <div class="col-lg-6">
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 }}
62             </ul>
63         </div>
65         <div class="card col-lg-6">
66             <div class="card-block card-body">
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>
73                                     <ul class="dropdown dropdown-menu">
74                                     {{#canmanage}}
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>
100                                     {{/canmanage}}
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>
106                                     {{#canmanage}}
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>
117                                     {{/canmanage}}
118                                 </ul>
119                             </li>
120                         </ul>
121                     </span>
122                 </div>
123                 <p data-region="competencyinfo">
124                     {{#str}}nocompetencyselected, tool_lp{{/str}}
125                 </p>
126                 <div data-region="competencyactions">
127                     {{#canmanage}}
128                     <button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} <span data-region="term"></span></button>
129                     {{/canmanage}}
130                 </div>
131             </div>
132         </div>
133     </div>
134 </div>
136 {{#js}}
137 // Initialise the JS.
138 require(['tool_lp/tree', 'tool_lp/competencytree', 'tool_lp/competencyactions', 'jquery'],
139         function(ariatree, treeModel, actions, $) {
141     treeModel.init({{framework.id}},
142                    {{#quote}} {{{framework.shortname}}} {{/quote}},
143                    '{{search}}',
144                    '[data-enhance=tree]',
145                    {{canmanage}},
146                    {{competencyid}});
148     actions.init(treeModel, {{pagecontextid}}, '{{{framework.taxonomies}}}', {{{rulesmodules}}});
150 });
151 {{/js}}