b1a4d6f078e0e89e974cf123a8d3ae1676c264d6
[moodle.git] / admin / tool / lp / templates / user_evidence_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     User evidence page template.
20     Data attributes required for JS:
21     * data-action = link-competency
22     * data-action = delete-competency-link
23     * data-region = user-evidence-page
24     * data-id = user evidence ID, or competency ID
25     * data-userid = user evidence user ID
27     Context variables required for this template:
28     * userevidence - The user evidence
29     * pluginbaseurl - The plugin base URL
30 }}
31 {{#userevidence}}
32 <div data-region="user-evidence-page" data-id="{{id}}" data-userid="{{userid}}">
33     <h2>
34         {{{name}}}
35         {{#canmanage}}
36             <a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&amp;userid={{userid}}">{{#pix}}t/edit, core, {{#str}}editthisuserevidence, tool_lp{{/str}}{{/pix}}</a>
37         {{/canmanage}}
38     </h2>
39     {{#canmanage}}
40     <div data-region="actions" class="clearfix">
41         <div class="pull-left">
42             {{#userhasplan}}
43                 <button class="btn btn-secondary mb-1" data-action="link-competency">{{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}</button>
44             {{/userhasplan}}
45         </div>
46     </div>
47     {{/canmanage}}
49     <div data-region="user-evidence-summary">
50         {{#description}}
51             <div>
52                 {{{description}}}
53             </div>
54         {{/description}}
55         <ul class="user-evidence-documents">
56             {{#url}}
57                 <li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
58             {{/url}}
59             {{#files}}
60                 <li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}">{{filename}}</a></li>
61             {{/files}}
62         </ul>
63     </div>
65     <div data-region="user-evidence-competencies">
66         <h3>{{#str}}linkedcompetencies, tool_lp{{/str}}</h3>
67         <table class="generaltable fullwidth">
68             <thead>
69                 <tr>
70                     <th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
71                     <th scope="col">{{#str}}status, tool_lp{{/str}} / {{#str}}reviewer, tool_lp{{/str}}</th>
72                     {{#canmanage}}
73                         <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
74                     {{/canmanage}}
75                 </tr>
76             </thead>
77             <tbody>
78                 {{#usercompetencies}}
79                 <tr data-id="{{competency.id}}">
80                     <td>
81                         <a href="{{pluginbaseurl}}/user_competency.php?id={{usercompetency.id}}" data-id="{{usercompetency.id}}">{{{competency.shortname}}}</a>
82                     </td>
83                      <td>
84                         {{usercompetency.statusname}} {{#usercompetency.reviewer.fullname}} / {{usercompetency.reviewer.fullname}}{{/usercompetency.reviewer.fullname}}
85                     </td>
86                     {{#userevidence.canmanage}}
87                         <td>
88                             <div class="pull-left">
89                                 <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
90                             </div>
91                         </td>
92                     {{/userevidence.canmanage}}
93                 </tr>
94                 {{/usercompetencies}}
95             </tbody>
96         </table>
97         {{^usercompetencies}}
98             <p class="alert alert-info">
99                 {{#str}}nocompetenciesinevidence, tool_lp{{/str}}
100             </p>
101         {{/usercompetencies}}
102     </div>
103 </div>
105 {{#canmanage}}
106 {{#js}}
107 require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
109     var uea = new UserEvidenceActions('evidence');
110     uea.registerEvents();
112 });
113 {{/js}}
114 {{/canmanage}}
116 {{#js}}
117 require(['tool_lp/competencydialogue'], function(Compdialogue) {
118     Compdialogue.init();
119 });
120 {{/js}}
122 {{/userevidence}}