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/>.
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
32 <div data-region="user-evidence-page" data-id="{{id}}" data-userid="{{userid}}">
36 <a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&userid={{userid}}">{{#pix}}t/edit, core, {{#str}}editthisuserevidence, tool_lp{{/str}}{{/pix}}</a>
40 <div data-region="actions" class="clearfix">
41 <div class="float-left">
43 <button class="btn btn-secondary mb-1" data-action="link-competency">{{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}</button>
49 <div data-region="user-evidence-summary">
55 <ul class="user-evidence-documents">
57 <li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
60 <li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}">{{filename}}</a></li>
65 <div data-region="user-evidence-competencies">
66 <h3>{{#str}}linkedcompetencies, tool_lp{{/str}}</h3>
67 <table class="generaltable fullwidth">
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>
73 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
79 <tr data-id="{{competency.id}}">
81 <a href="{{pluginbaseurl}}/user_competency.php?id={{usercompetency.id}}" data-id="{{usercompetency.id}}">{{{competency.shortname}}}</a>
84 {{usercompetency.statusname}} {{#usercompetency.reviewer.fullname}} / {{usercompetency.reviewer.fullname}}{{/usercompetency.reviewer.fullname}}
86 {{#userevidence.canmanage}}
88 <div class="float-left">
89 <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
92 {{/userevidence.canmanage}}
98 <p class="alert alert-info">
99 {{#str}}nocompetenciesinevidence, tool_lp{{/str}}
101 {{/usercompetencies}}
107 require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
109 var uea = new UserEvidenceActions('evidence');
110 uea.registerEvents();
117 require(['tool_lp/competencydialogue'], function(Compdialogue) {