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/>.
20 <div data-region="plan-page" data-id="{{plan.id}}" data-userid="{{plan.userid}}">
24 <a href="{{pluginbaseurl}}/editplan.php?id={{plan.id}}&userid={{plan.userid}}">{{#pix}}t/edit, core, {{#str}}editplan, tool_lp{{/str}}{{/pix}}</a>
28 <div data-region="actions" class="clearfix">
29 <div class="pull-left">
30 <!-- Button to add competencies to the plan -->
31 <button class="btn" data-action="add">{{#pix}}t/add{{/pix}} {{#str}}addcompetency, tool_lp{{/str}}</button>
35 <div data-region="plan-summary">
36 {{{plan.description}}}
38 <dt>{{#str}}status, tool_lp{{/str}}</dt>
43 - {{plan.reviewer.fullname}}
46 {{#plan.iscompleteallowed}}
47 (<a data-action="plan-complete" href="#">{{#str}}completeplan, tool_lp{{/str}}</a>)
48 {{/plan.iscompleteallowed}}
49 {{#plan.isreopenallowed}}
50 (<a data-action="plan-reopen" href="#">{{#str}}reopenplan, tool_lp{{/str}}</a>)
51 {{/plan.isreopenallowed}}
52 {{#plan.isrequestreviewallowed}}
53 (<a data-action="plan-request-review" href="#">{{#str}}requestreview, tool_lp{{/str}}</a>)
54 {{/plan.isrequestreviewallowed}}
55 {{#plan.iscancelreviewrequestallowed}}
56 (<a data-action="plan-cancel-review-request" href="#">{{#str}}cancelreviewrequest, tool_lp{{/str}}</a>)
57 {{/plan.iscancelreviewrequestallowed}}
58 {{#plan.isstartreviewallowed}}
59 (<a data-action="plan-start-review" href="#">{{#str}}startreview, tool_lp{{/str}}</a>)
60 {{/plan.isstartreviewallowed}}
61 {{#plan.isstopreviewallowed}}
62 (<a data-action="plan-stop-review" href="#">{{#str}}stopreview, tool_lp{{/str}}</a>)
63 {{/plan.isstopreviewallowed}}
64 {{#plan.isapproveallowed}}
65 (<a data-action="plan-approve" href="#">{{#str}}planapprove, tool_lp{{/str}}</a>)
66 {{/plan.isapproveallowed}}
67 {{#plan.isunapproveallowed}}
68 (<a data-action="plan-unapprove" href="#">{{#str}}planunapprove, tool_lp{{/str}}</a>)
69 {{/plan.isunapproveallowed}}
73 <dt>{{#str}}duedate, tool_lp{{/str}}</dt>
74 <dd>{{plan.duedateformatted}}</dd>
77 <dt>{{#str}}template, tool_lp{{/str}}</dt>
80 <a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&pagecontextid={{contextid}}">
82 {{{plan.template.shortname}}}{{#canread}}</a>{{/canread}}
83 {{#plan.isunlinkallowed}}
84 (<a data-action="plan-unlink" href="#">{{#str}}unlinkplantemplate, tool_lp{{/str}}</a>)
85 {{/plan.isunlinkallowed}}
89 <dt>{{#str}}description{{/str}}</dt>
90 <dd>{{{plan.description}}}</dd>
92 <dt>{{#str}}progress, tool_lp{{/str}}</dt>
94 {{< tool_lp/progress_bar}}
96 {{#str}}xcompetenciesproficientoutofy, tool_lp, { "x": "{{proficientcompetencycount}}", "y": "{{competencycount}}" }{{/str}}
98 {{$percentage}}{{proficientcompetencypercentage}}{{/percentage}}
99 {{$percentlabel}}{{proficientcompetencypercentageformatted}} %{{/percentlabel}}
100 {{/tool_lp/progress_bar}}
104 {{#plan.commentarea}}
105 {{#canpostorhascomments}}
106 <div data-region="comments">
107 {{>tool_lp/comment_area}}
109 {{/canpostorhascomments}}
110 {{/plan.commentarea}}
111 <div data-region="plan-competencies">
112 <h3>{{#str}}learningplancompetencies, tool_lp{{/str}}</h3>
113 <table class="generaltable fullwidth managecompetencies">
116 <th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
117 <th scope="col">{{#str}}rating, tool_lp{{/str}}</th>
118 <th scope="col">{{#str}}proficient, tool_lp{{/str}}</th>
119 {{^plan.iscompleted}}
120 <th scope="col">{{#str}}status, tool_lp{{/str}}</th>
121 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
122 {{/plan.iscompleted}}
125 <tbody class="drag-parentnode">
127 <tr class="drag-samenode" data-node="user-competency" data-id="{{competency.id}}"
128 data-competencyid="{{competency.id}}"
129 data-userid="{{plan.userid}}">
131 {{#plan.canbeedited}}
132 <span class="drag-handlecontainer pull-left"></span>
133 {{/plan.canbeedited}}
134 <a data-usercompetency="true" href="#">{{{competency.shortname}}}</a>
135 <em>{{competency.idnumber}}</em>
138 <span class="pull-left">{{#str}}path, tool_lp{{/str}} </span>{{> tool_lp/competency_path }}
141 {{#plan.iscompleted}}
142 <td>{{usercompetencyplan.gradename}}</td>
143 <td>{{usercompetencyplan.proficiencyname}}</td>
144 {{/plan.iscompleted}}
145 {{^plan.iscompleted}}
146 <td>{{usercompetency.gradename}}</td>
147 <td>{{usercompetency.proficiencyname}}</td>
148 <td>{{usercompetency.statusname}}</td>
149 {{/plan.iscompleted}}
150 {{^plan.iscompleted}}
152 <ul title="{{#str}}edit{{/str}}" class="user-competency-actions">
154 <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
155 <ul class="dropdown-menu">
156 {{#usercompetency.isrequestreviewallowed}}
158 <a href="#" data-action="request-review">{{#pix}}t/edit, core{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
160 {{/usercompetency.isrequestreviewallowed}}
161 {{#usercompetency.iscancelreviewrequestallowed}}
163 <a href="#" data-action="cancel-review-request">{{#pix}}t/edit, core{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
165 {{/usercompetency.iscancelreviewrequestallowed}}
166 {{#plan.canbeedited}}
168 <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core{{/pix}} {{#str}}delete{{/str}}</a>
170 {{/plan.canbeedited}}
172 <a href="#" data-action="find-courses-link" data-id="{{competency.id}}">{{#pix}}t/preview, core{{/pix}} {{#str}}findcourses, tool_lp{{/str}}</a>
178 {{/plan.iscompleted}}
184 <p class="alert alert-info">
185 {{#str}}nocompetenciesinlearningplan, tool_lp{{/str}}
191 require(['tool_lp/competencies', 'tool_lp/planactions', 'tool_lp/user_competency_workflow', 'tool_lp/user_competency_plan_popup'], function(mod, actionsMod, UserCompWorkflow, Popup) {
192 var planActions = new actionsMod('plan');
194 (new mod({{plan.id}}, 'plan', {{contextid}}));
195 (new Popup('[data-region=plan-page]', '[data-usercompetency=true]', {{plan.id}}));
196 planActions.registerEvents();
198 var ucw = new UserCompWorkflow();
199 ucw.enhanceMenubar('.user-competency-actions');
200 ucw.on('status-changed', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
201 ucw.on('error-occured', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));