MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / tool / lp / templates / course_competencies_page.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/course_competencies_page
20     Course competencies template.
22     For a full list of the context for this template see the course_competencies_page renderable.
24     This template includes ajax functionality, so it cannot be shown in the template library.
25 }}
26 <div data-region="coursecompetenciespage">
27     <div data-region="actions" class="clearfix">
28         <div class="pull-xs-left">
29             {{#canmanagecoursecompetencies}}
30                 <button class="btn btn-secondary" disabled>{{#str}}addcoursecompetencies, tool_lp{{/str}}</button>
31             {{/canmanagecoursecompetencies}}
32         </div>
33     </div>
34     <div data-region="configurecoursecompetencies">
35     {{#cangradecompetencies}}
36         <p class="alert {{^settings.pushratingstouserplans}}alert-info{{/settings.pushratingstouserplans}}">
37         {{#settings.pushratingstouserplans}}
38             {{#str}}coursecompetencyratingsarepushedtouserplans, tool_lp{{/str}}
39         {{/settings.pushratingstouserplans}}
40         {{^settings.pushratingstouserplans}}
41             {{#str}}coursecompetencyratingsarenotpushedtouserplans, tool_lp{{/str}}
42         {{/settings.pushratingstouserplans}}
43         {{#canconfigurecoursecompetencies}}
44             <a href="#"
45                data-action="configure-course-competency-settings"
46                data-courseid="{{courseid}}"
47                data-pushratingstouserplans="{{settings.pushratingstouserplans}}">
48                 {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}
49             </a>
50         {{/canconfigurecoursecompetencies}}
51         </p>
52     {{/cangradecompetencies}}
53     </div>
54 {{#statistics}}
55 {{> tool_lp/course_competency_statistics }}
56 {{/statistics}}
57 <div data-region="coursecompetencies">
58 <table class="generaltable fullwidth managecompetencies">
59 <tbody class="drag-parentnode">
60 {{#competencies}}
61     <tr class="drag-samenode" data-id="{{competency.id}}">
62     <td>
63         {{#canmanagecoursecompetencies}}
64         <span class="drag-handlecontainer pull-xs-left"></span>
65         <div class="pull-xs-right">
66             <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">
67                 {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}
68             </a>
69         </div>
70         <div class="clearfix"></div>
71         {{/canmanagecoursecompetencies}}
72         {{#competency}}
73             <a href="{{pluginbaseurl}}/user_competency_in_course.php?courseid={{courseid}}&competencyid={{competency.id}}&userid={{gradableuserid}}"
74                    id="competency-info-link-{{competency.id}}"
75                    title="{{#str}}viewdetails, tool_lp{{/str}}">
76                 <p><strong>{{{competency.shortname}}} <em>{{competency.idnumber}}</em></strong></p>
77             </a>
78             <p>{{{competency.description}}}</p>
79         {{/competency}}
80         {{#comppath}}
81             <span class="pull-xs-left">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
82         {{/comppath}}
83         {{#usercompetencycourse}}
84             {{#grade}}
85             <span class="badge {{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span>
86             {{/grade}}
87         {{/usercompetencycourse}}
88         {{#canmanagecoursecompetencies}}
89         <div data-region="coursecompetency-ruleoutcome">
90             <label>
91                 {{#str}}uponcoursecompletion, tool_lp{{/str}}
92                 <select data-field="ruleoutcome" data-id="{{coursecompetency.id}}" class="custom-select">
93                   {{#ruleoutcomeoptions}}
94                      <option value="{{value}}" {{#selected}}selected{{/selected}}>{{text}}</option>
95                   {{/ruleoutcomeoptions}}
96                 </select>
97             </label>
98         </div>
99         {{/canmanagecoursecompetencies}}
100         <div data-region="coursecompetencyactivities">
101         <p>
102         <strong>{{#str}}activities{{/str}}</strong>
103         <ul class="inline list-inline p-2">
104         {{#coursemodules}}
105             <li class="list-inline-item"><a href="{{url}}"><img src="{{iconurl}}"> {{name}} </a></li>
106         {{/coursemodules}}
107         {{^coursemodules}}
108             <li class="list-inline-item">{{#str}}noactivities, tool_lp{{/str}}</li>
109         {{/coursemodules}}
110         </ul>
111         </p>
112         </div>
113         <div data-region="learningplans">
114         <p>
115         <strong>{{#str}}userplans, core_competency{{/str}}</strong>
116         <ul class="inline list-inline p-2">
117         {{#plans}}
118             <li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
119         {{/plans}}
120         {{^plans}}
121             <li class="list-inline-item">{{#str}}nouserplanswithcompetency, core_competency{{/str}}</li>
122         {{/plans}}
123         </ul>
124         </p>
125         </div>
126     </td>
127     </tr>
128 {{/competencies}}
129 </tbody>
130 </table>
131 {{^competencies}}
132 <p class="alert alert-info">
133     {{#str}}nocompetenciesincourse, tool_lp{{/str}}
134 </p>
135 {{/competencies}}
136 </div>
137 <div data-region="actions">
138     {{#canmanagecompetencyframeworks}}
139         <p><a href="{{manageurl}}">{{#str}}managecompetenciesandframeworks, tool_lp{{/str}}</a></p>
140     {{/canmanagecompetencyframeworks}}
141 </div>
142 </div>
143 {{#js}}
144 require(['tool_lp/competencies'], function(mod) {
145     (new mod({{courseid}}, 'course', {{pagecontextid}}));
146 });
147 {{/js}}
148 {{#canconfigurecoursecompetencies}}
149 {{#js}}
150 require(['tool_lp/course_competency_settings'], function(Mod) {
151     (new Mod('[data-action=configure-course-competency-settings]'));
152 });
153 {{/js}}
154 {{/canconfigurecoursecompetencies}}