mirrored from git://git.moodle.org/moodle.git
/
user_evidence_page.mustache
113 lines (100 loc) · 3.94 KB
/
user_evidence_page.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
User evidence page template.
Data attributes required for JS:
* data-action = link-competency
* data-action = delete-competency-link
* data-region = user-evidence-page
* data-id = user evidence ID, or competency ID
* data-userid = user evidence user ID
Context variables required for this template:
* userevidence - The user evidence
* pluginbaseurl - The plugin base URL
}}
{{#userevidence}}
<div data-region="user-evidence-page" data-id="{{id}}" data-userid="{{userid}}">
<h2>
{{name}}
{{#canmanage}}
<a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&userid={{userid}}&return=evidence">{{#pix}}t/edit, core, {{#str}}editthisuserevidence, tool_lp{{/str}}{{/pix}}</a>
{{/canmanage}}
</h2>
<div data-region="user-evidence-summary">
{{#description}}
<div>
{{{description}}}
</div>
{{/description}}
<ul class="user-evidence-documents">
{{#url}}
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}}
{{#files}}
<li><img src="{{iconurl}}" alt=""> <a href="{{url}}">{{filename}}</a></li>
{{/files}}
</ul>
</div>
<div data-region="user-evidence-competencies">
<h3>{{#str}}linkedcompetencies, tool_lp{{/str}}</h3>
<table class="generaltable fullwidth">
<thead>
<tr>
<th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
{{#userevidence.canmanage}}
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
{{/userevidence.canmanage}}
</tr>
</thead>
<tbody>
{{#competencies}}
<tr data-id="{{id}}">
<td>
<a href="#" data-action="competency-dialogue" data-id="{{id}}">{{shortname}}</a>
</td>
{{#userevidence.canmanage}}
<td>
<div class="pull-left">
<a href="#" data-action="delete-competency-link" data-id="{{id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
</div>
</td>
{{/userevidence.canmanage}}
</tr>
{{/competencies}}
</tbody>
</table>
<div data-region="actions">
<div class="pull-right">
{{#canmanage}}
<button class="btn" data-action="link-competency">{{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}</button>
{{/canmanage}}
</div>
</div>
</div>
</div>
{{#canmanage}}
{{#js}}
require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
var uea = new UserEvidenceActions('evidence');
uea.registerEvents();
});
{{/js}}
{{/canmanage}}
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
var competencydialogue = new Compdialogue({includerelated : true});
competencydialogue.watch('[data-region="user-evidence-competencies"]');
});
{{/js}}
{{/userevidence}}