1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
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.
|
|
|
8 |
|
|
|
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.
|
|
|
13 |
|
|
|
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/evidence_summary
|
|
|
19 |
|
|
|
20 |
Moodle template for the the summary of a single piece of evidence.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* actionuser User record from a user_summary_exporter
|
|
|
30 |
* userdate User formatted date this evidence was created
|
|
|
31 |
* grade Raw grade value if set
|
|
|
32 |
* gradename Scale grade item
|
|
|
33 |
* description Description of the evidence
|
|
|
34 |
* url Optional url for the evidence
|
|
|
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{ "actionuser": { "id": 1, "fullname": "Legend", "profileimageurlsmall": "https://secure.gravatar.com/avatar/78f83716ad197a25e175fbb747cff1ff?s=35&d=mm" },
|
|
|
38 |
"userdate": "Tuesday...",
|
|
|
39 |
"grade": 2,
|
|
|
40 |
"gradename": "Met",
|
|
|
41 |
"description": "The user competency was manually rated in the plan Personal plan A",
|
|
|
42 |
"url": "http://moodle.org/",
|
|
|
43 |
"candelete": true,
|
|
|
44 |
"id": 1
|
|
|
45 |
}
|
|
|
46 |
}}
|
|
|
47 |
<div class="border rounded p-4 mb-2 evidence d-block relative" data-region="evidence" data-id="{{id}}">
|
|
|
48 |
|
|
|
49 |
{{#grade}}
|
|
|
50 |
<p><span class="badge badge-success">{{gradename}}</span></p>
|
|
|
51 |
{{/grade}}
|
|
|
52 |
|
|
|
53 |
{{#candelete}}
|
|
|
54 |
<a href="#" class="btn btn-sm btn-danger float-right" data-action="delete-evidence">
|
|
|
55 |
<svg width="22" height="22" fill="none" viewBox="0 0 24 24">
|
|
|
56 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M6.75 7.75L7.59115 17.4233C7.68102 18.4568 8.54622 19.25 9.58363 19.25H14.4164C15.4538 19.25 16.319 18.4568 16.4088 17.4233L17.25 7.75"></path>
|
|
|
57 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M9.75 7.5V6.75C9.75 5.64543 10.6454 4.75 11.75 4.75H12.25C13.3546 4.75 14.25 5.64543 14.25 6.75V7.5"></path>
|
|
|
58 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" d="M5 7.75H19"></path>
|
|
|
59 |
</svg>
|
|
|
60 |
</a>
|
|
|
61 |
{{/candelete}}
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
{{#actionuser}}
|
|
|
65 |
<div class="my-2">
|
|
|
66 |
{{> tool_lp/user_summary }}
|
|
|
67 |
</div>
|
|
|
68 |
{{/actionuser}}
|
|
|
69 |
<small><time datetime="{{userdate}}">{{userdate}}</time></small>
|
|
|
70 |
<p class="pt-3 my-3 border-top">{{description}}</p>
|
|
|
71 |
{{#grade}}
|
|
|
72 |
<p><span class="badge badge-info">{{gradename}}</span></p>
|
|
|
73 |
{{/grade}}
|
|
|
74 |
<p>{{description}}</p>
|
|
|
75 |
{{#note}}
|
|
|
76 |
<blockquote>{{note}}</blockquote>
|
|
|
77 |
{{/note}}
|
|
|
78 |
{{#url}}
|
|
|
79 |
<p><a href="{{url}}" target="_blank" rel="noreferrer">{{url}}</a></p>
|
|
|
80 |
{{/url}}
|
|
|
81 |
</div>
|
|
|
82 |
|
|
|
83 |
{{#js}}
|
|
|
84 |
require(['tool_lp/evidence_delete'], function(EvidenceDelete) {
|
|
|
85 |
EvidenceDelete.register('[data-action="delete-evidence"]', '[data-region="evidence"]');
|
|
|
86 |
});
|
|
|
87 |
{{/js}}
|