MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / tool / lp / templates / user_competency_summary_in_course.mustache
CommitLineData
9f422dc2
DW
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/user_competency_summary_in_course
19
20 Moodle template for the the summary of a user competency
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 * usercompetencysummary - object containing:
30 * showrelatedcompetencies - boolean
31 * cangrade - boolean
9f422dc2
DW
32 * competency - competency summary record
33 * user - user record
34 * usercompetency - user competency record
35 * evidence - array of evidence
36 * course - course summary record
37
38 This template does not have an example context because it includes ajax functionality.
39}}
40{{#usercompetencysummary}}
182f6092 41<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
9f422dc2
DW
42<div data-region="competency-summary">
43 {{#competency}}
44 {{> tool_lp/competency_summary }}
45 {{/competency}}
46 <dl>
db650737
DW
47 <dt>{{#str}}activities, tool_lp{{/str}}</dt>
48 <dd data-region="coursecompetencyactivities">
e3ceb79a 49 <p>
207136f2 50 <ul class="inline list-inline">
db650737 51 {{#coursemodules}}
207136f2 52 <li class="list-inline-item"><a href="{{url}}"><img src="{{iconurl}}"> {{name}} </a></li>
db650737
DW
53 {{/coursemodules}}
54 {{^coursemodules}}
207136f2 55 <li class="list-inline-item"><span class="alert">{{#str}}noactivities, tool_lp{{/str}}</span></li>
db650737
DW
56 {{/coursemodules}}
57 </ul>
e3ceb79a 58 </p>
db650737 59 </dd>
e1b93e42
IT
60 {{#displayuser}}
61 {{#user}}
62 <dt>{{#str}}user{{/str}}</dt>
63 <dd>
64 {{>tool_lp/user_summary}}
65 </dd>
66 {{/user}}
67 {{/displayuser}}
c0417b04
DW
68 <dt>{{#str}}userplans, competency{{/str}}</dt>
69 <dd>
70 <p>
71 <ul class="inline list-inline">
72 {{#plans}}
73 <li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
74 {{/plans}}
75 {{^plans}}
76 <li>{{#str}}nouserplanswithcompetency, competency{{/str}}</li>
77 {{/plans}}
78 </ul>
79 </p>
80 </dd>
e0c2d7c0 81 {{#usercompetencycourse}}
9f422dc2
DW
82 <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
83 <dd>
3f2c68f1 84 <span class="badge{{^proficiency}} badge-danger{{/proficiency}} pull-left">
9f422dc2
DW
85 {{proficiencyname}}
86 </span>
87 </dd>
88 <dt>{{#str}}rating, tool_lp{{/str}}</dt>
89 <dd>{{gradename}}
5cb320c1 90 {{#cangrade}}
207136f2 91 <button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
5cb320c1 92 {{/cangrade}}
9f422dc2 93 </dd>
e0c2d7c0 94 {{/usercompetencycourse}}
9f422dc2 95 {{#js}}
3b11d638 96 require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
9f422dc2 97
5cb320c1 98 var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
182f6092 99 var competencyElement = $('[data-region-id="{{uniqid}}"]');
e1b93e42
IT
100
101 var displayuser = ('{{displayuser}}' == 'true') ? true : false;
102 var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
9f422dc2
DW
103
104 inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
105 });
106
107 {{/js}}
9f422dc2 108 </dl>
182f6092 109 {{#commentarea}}
47cddb9c
FM
110 {{#canpostorhascomments}}
111 {{>tool_lp/comment_area}}
112 {{/canpostorhascomments}}
182f6092 113 {{/commentarea}}
9f422dc2
DW
114 <dl data-region="evidence-listing">
115 <dt>{{#str}}evidence, tool_lp{{/str}}</dt>
116 <dd>
117 {{#evidence}}
118 {{> tool_lp/evidence_summary }}
119 {{/evidence}}
120 {{^evidence}}
121 <p>{{#str}}noevidence, tool_lp{{/str}}</p>
122 {{/evidence}}
123 </dd>
124 </dl>
125</div>
269bcf7e 126</div>
9f422dc2 127{{/usercompetencysummary}}