MDL-53473 tool_lp: Improvement to navigation flow of templates
[moodle.git] / admin / tool / lp / templates / template_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 competencies template.
19 }}
20 <div data-region="templatecompetenciespage">
21     <h2>
22         {{template.shortname}}
23         {{#template.canmanage}}
24             <a href="{{pluginbaseurl}}/edittemplate.php?id={{template.id}}&amp;pagecontextid={{pagecontextid}}">{{#pix}}t/edit, core, {{#str}}edittemplate, tool_lp{{/str}}{{/pix}}</a>
25         {{/template.canmanage}}
26     </h2>
27     <h3>{{#str}}templatecompetencies, tool_lp{{/str}}</h3>
28     {{#statistics}}
29         {{> tool_lp/template_statistics }}
30     {{/statistics}}
31     {{#canmanagetemplatecompetencies}}
32     <div data-region="actions" class="clearfix">
33         <div class="pull-right">
34             <button disabled>{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
35         </div>
36     </div>
37     {{/canmanagetemplatecompetencies}}
38     <div data-region="templatecompetencies">
39         <div class="managecompetencies">
40             <div class="drag-parentnode">
41                 {{#competencies}}
42                 <div class="drag-samenode" data-id="{{competency.id}}">
43                     <div class="well">
44                         {{#canmanagetemplatecompetencies}}
45                         <span class="drag-handlecontainer pull-left"></span>
46                         <div class="pull-right">
47                             <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
48                         </div>
49                         {{/canmanagetemplatecompetencies}}
50                         {{#competency}}
51                         <a id="competency-info-link-{{competency.idnumber}}"></a>
52                             {{> tool_lp/competency_summary }}
53                         {{/competency}}
54                         <strong>{{#str}}linkedcourseslist, tool_lp{{/str}}</strong>
55                         {{#hascourses}}
56                         <ul class="inline">
57                         {{#linkedcourses}}
58                             <li><a href="{{viewurl}}?id={{id}}">{{fullname}} ({{shortname}})</a></li>
59                         {{/linkedcourses}}
60                         </ul>
61                         {{/hascourses}}
62                         {{^hascourses}}
63                         <span class="label label-info">{{#str}}nolinkedcourses, tool_lp{{/str}}</span>
64                         {{/hascourses}}
65                     </div>
66                 </div>
67                 {{/competencies}}
68             </div>
69         </div>
70         {{^competencies}}
71         <p class="alert-info">
72             {{#str}}nocompetenciesintemplate, tool_lp{{/str}}
73         </p>
74         {{/competencies}}
75     </div>
76     <div data-region="actions">
77         {{#canmanagecompetencyframeworks}}
78         <div>
79             <p><a href="{{manageurl}}">{{#str}}managecompetenciesandframeworks, tool_lp{{/str}}</a></p>
80         </div>
81         {{/canmanagecompetencyframeworks}}
82     </div>
83 </div>
84 {{#js}}
85 require(['tool_lp/competencies'], function(mod) {
86     (new mod({{template.id}}, 'template', {{pagecontextid}}));
87 });
88 {{/js}}