MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / tool / lp / templates / user_competency_summary_in_course.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     @template tool_lp/user_competency_summary_in_course
20     Moodle template for the the summary of a user competency
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * usercompetencysummary - object containing:
30         * showrelatedcompetencies - boolean
31         * cangrade - boolean
32         * competency - competency summary record
33         * user - user record
34         * usercompetency - user competency record
35         * evidence - array of evidence
36     * course - course summary record
38     This template does not have an example context because it includes ajax functionality.
39 }}
40 {{#usercompetencysummary}}
41 <div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
42 <div data-region="competency-summary">
43     {{#competency}}
44         {{> tool_lp/competency_summary }}
45     {{/competency}}
46     <dl>
47         <dt>{{#str}}activities, tool_lp{{/str}}</dt>
48         <dd data-region="coursecompetencyactivities">
49         <p>
50         <ul class="inline list-inline">
51         {{#coursemodules}}
52             <li class="list-inline-item"><a href="{{url}}"><img src="{{iconurl}}"> {{name}} </a></li>
53         {{/coursemodules}}
54         {{^coursemodules}}
55             <li class="list-inline-item"><span class="alert">{{#str}}noactivities, tool_lp{{/str}}</span></li>
56         {{/coursemodules}}
57         </ul>
58         </p>
59         </dd>
60         {{#displayuser}}
61         {{#user}}
62         <dt>{{#str}}user{{/str}}</dt>
63         <dd>
64             {{>tool_lp/user_summary}}
65         </dd>
66         {{/user}}
67         {{/displayuser}}
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>
81         {{#usercompetencycourse}}
82         <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
83         <dd>
84             <span class="badge{{^proficiency}} badge-danger{{/proficiency}} pull-left">
85                 {{proficiencyname}}
86             </span>
87         </dd>
88         <dt>{{#str}}rating, tool_lp{{/str}}</dt>
89         <dd>{{gradename}}
90             {{#cangrade}}
91                 <button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
92             {{/cangrade}}
93         </dd>
94         {{/usercompetencycourse}}
95         {{#js}}
96         require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
98             var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
99             var competencyElement = $('[data-region-id="{{uniqid}}"]');
101             var displayuser = ('{{displayuser}}' == 'true') ? true : false;
102             var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
104             inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
105         });
107         {{/js}}
108     </dl>
109     {{#commentarea}}
110         {{#canpostorhascomments}}
111             {{>tool_lp/comment_area}}
112         {{/canpostorhascomments}}
113     {{/commentarea}}
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>
126 </div>
127 {{/usercompetencysummary}}