PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/tool/lp/templates/plan_page.mustache

https://github.com/pauln/moodle
Mustache | 203 lines | 178 code | 6 blank | 19 comment | 0 complexity | 816729400a9ef6b26052d6364c248208 MD5 | raw file
  1. {{!
  2. This file is part of Moodle - http://moodle.org/
  3. Moodle is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. Moodle is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  13. }}
  14. {{!
  15. Plan page template.
  16. }}
  17. <div data-region="plan-page" data-id="{{plan.id}}" data-userid="{{plan.userid}}">
  18. <h2>
  19. {{plan.name}}
  20. {{#plan.canbeedited}}
  21. <a href="{{pluginbaseurl}}/editplan.php?id={{plan.id}}&amp;userid={{plan.userid}}">{{#pix}}t/edit, core, {{#str}}editplan, tool_lp{{/str}}{{/pix}}</a>
  22. {{/plan.canbeedited}}
  23. </h2>
  24. {{#plan.canbeedited}}
  25. <div data-region="actions" class="clearfix">
  26. <div class="pull-left">
  27. <!-- Button to add competencies to the plan -->
  28. <button class="btn" data-action="add">{{#pix}}t/add{{/pix}} {{#str}}addcompetency, tool_lp{{/str}}</button>
  29. </div>
  30. </div>
  31. {{/plan.canbeedited}}
  32. <div data-region="plan-summary">
  33. {{{plan.description}}}
  34. <dl>
  35. <dt>{{#str}}status, tool_lp{{/str}}</dt>
  36. <dd>
  37. {{plan.statusname}}
  38. {{#plan.isinreview}}
  39. - {{plan.reviewer.fullname}}
  40. {{/plan.isinreview}}
  41. {{#plan.iscompleteallowed}}
  42. (<a data-action="plan-complete" href="#">{{#str}}completeplan, tool_lp{{/str}}</a>)
  43. {{/plan.iscompleteallowed}}
  44. {{#plan.isreopenallowed}}
  45. (<a data-action="plan-reopen" href="#">{{#str}}reopenplan, tool_lp{{/str}}</a>)
  46. {{/plan.isreopenallowed}}
  47. {{#plan.isrequestreviewallowed}}
  48. (<a data-action="plan-request-review" href="#">{{#str}}requestreview, tool_lp{{/str}}</a>)
  49. {{/plan.isrequestreviewallowed}}
  50. {{#plan.iscancelreviewrequestallowed}}
  51. (<a data-action="plan-cancel-review-request" href="#">{{#str}}cancelreviewrequest, tool_lp{{/str}}</a>)
  52. {{/plan.iscancelreviewrequestallowed}}
  53. {{#plan.isstartreviewallowed}}
  54. (<a data-action="plan-start-review" href="#">{{#str}}startreview, tool_lp{{/str}}</a>)
  55. {{/plan.isstartreviewallowed}}
  56. {{#plan.isstopreviewallowed}}
  57. (<a data-action="plan-stop-review" href="#">{{#str}}stopreview, tool_lp{{/str}}</a>)
  58. {{/plan.isstopreviewallowed}}
  59. {{#plan.isapproveallowed}}
  60. (<a data-action="plan-approve" href="#">{{#str}}planapprove, tool_lp{{/str}}</a>)
  61. {{/plan.isapproveallowed}}
  62. {{#plan.isunapproveallowed}}
  63. (<a data-action="plan-unapprove" href="#">{{#str}}planunapprove, tool_lp{{/str}}</a>)
  64. {{/plan.isunapproveallowed}}
  65. </dd>
  66. {{#plan.duedate}}
  67. <dt>{{#str}}duedate, tool_lp{{/str}}</dt>
  68. <dd>{{plan.duedateformatted}}</dd>
  69. {{/plan.duedate}}
  70. {{#plan.template}}
  71. <dt>{{#str}}template, tool_lp{{/str}}</dt>
  72. <dd>
  73. {{#canread}}
  74. <a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&amp;pagecontextid={{contextid}}">
  75. {{/canread}}
  76. {{plan.template.shortname}}{{#canread}}</a>{{/canread}}
  77. {{#plan.isunlinkallowed}}
  78. (<a data-action="plan-unlink" href="#">{{#str}}unlinkplantemplate, tool_lp{{/str}}</a>)
  79. {{/plan.isunlinkallowed}}
  80. </dd>
  81. {{/plan.template}}
  82. {{#description}}
  83. <dt>{{#str}}description{{/str}}</dt>
  84. <dd>{{{plan.description}}}</dd>
  85. {{/description}}
  86. <dt>{{#str}}progress, tool_lp{{/str}}</dt>
  87. <dd>
  88. <div class="span4">
  89. <div class="progresstext">
  90. {{#str}}xcompetenciesproficientoutofy, tool_lp, { "x": "{{proficientcompetencycount}}", "y": "{{competencycount}}" }{{/str}}
  91. </div>
  92. </div>
  93. <div class="span4">
  94. <span class="pull-right label label-info">{{proficientcompetencypercentageformatted}} %</span>
  95. <div class="progress">
  96. <div class="bar" style="width: {{proficientcompetencypercentage}}%;"></div>
  97. </div>
  98. </div>
  99. </dd>
  100. </dl>
  101. </div>
  102. {{#plan.commentarea}}
  103. {{#canpostorhascomments}}
  104. <div data-region="comments">
  105. {{>tool_lp/comment_area}}
  106. </div>
  107. {{/canpostorhascomments}}
  108. {{/plan.commentarea}}
  109. <div data-region="plan-competencies">
  110. <h3>{{#str}}learningplancompetencies, tool_lp{{/str}}</h3>
  111. <table class="generaltable fullwidth managecompetencies">
  112. <thead>
  113. <tr>
  114. <th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
  115. <th scope="col">{{#str}}rating, tool_lp{{/str}}</th>
  116. <th scope="col">{{#str}}proficient, tool_lp{{/str}}</th>
  117. {{^plan.iscompleted}}
  118. <th scope="col">{{#str}}status, tool_lp{{/str}}</th>
  119. <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
  120. {{/plan.iscompleted}}
  121. </tr>
  122. </thead>
  123. <tbody class="drag-parentnode">
  124. {{#competencies}}
  125. <tr class="drag-samenode" data-node="user-competency" data-id="{{competency.id}}"
  126. data-competencyid="{{competency.id}}"
  127. data-userid="{{plan.userid}}">
  128. <td>
  129. {{#plan.canbeedited}}
  130. <span class="drag-handlecontainer pull-left"></span>
  131. {{/plan.canbeedited}}
  132. <a data-usercompetency="true" href="#">{{competency.shortname}}</a>
  133. <em>{{competency.idnumber}}</em>
  134. {{#comppath}}
  135. <br>
  136. <span class="pull-left">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
  137. {{/comppath}}
  138. </td>
  139. {{#plan.iscompleted}}
  140. <td>{{usercompetencyplan.gradename}}</td>
  141. <td>{{usercompetencyplan.proficiencyname}}</td>
  142. {{/plan.iscompleted}}
  143. {{^plan.iscompleted}}
  144. <td>{{usercompetency.gradename}}</td>
  145. <td>{{usercompetency.proficiencyname}}</td>
  146. <td>{{usercompetency.statusname}}</td>
  147. {{/plan.iscompleted}}
  148. {{^plan.iscompleted}}
  149. <td>
  150. <ul title="{{#str}}edit{{/str}}" class="user-competency-actions">
  151. <li>
  152. <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
  153. <ul class="dropdown-menu">
  154. {{#usercompetency.isrequestreviewallowed}}
  155. <li>
  156. <a href="#" data-action="request-review">{{#pix}}t/edit, core{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
  157. </li>
  158. {{/usercompetency.isrequestreviewallowed}}
  159. {{#usercompetency.iscancelreviewrequestallowed}}
  160. <li>
  161. <a href="#" data-action="cancel-review-request">{{#pix}}t/edit, core{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
  162. </li>
  163. {{/usercompetency.iscancelreviewrequestallowed}}
  164. {{#plan.canbeedited}}
  165. <li>
  166. <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core{{/pix}} {{#str}}delete{{/str}}</a>
  167. </li>
  168. {{/plan.canbeedited}}
  169. <li>
  170. <a href="#" data-action="find-courses-link" data-id="{{competency.id}}">{{#pix}}t/preview, core{{/pix}} {{#str}}findcourses, tool_lp{{/str}}</a>
  171. </li>
  172. </ul>
  173. </li>
  174. </ul>
  175. </td>
  176. {{/plan.iscompleted}}
  177. </tr>
  178. {{/competencies}}
  179. </tbody>
  180. </table>
  181. </div>
  182. </div>
  183. {{#js}}
  184. require(['tool_lp/competencies', 'tool_lp/planactions', 'tool_lp/user_competency_workflow', 'tool_lp/user_competency_plan_popup'], function(mod, actionsMod, UserCompWorkflow, Popup) {
  185. var planActions = new actionsMod('plan');
  186. (new mod({{plan.id}}, 'plan', {{contextid}}));
  187. (new Popup('[data-region=plan-page]', '[data-usercompetency=true]', {{plan.id}}));
  188. planActions.registerEvents();
  189. var ucw = new UserCompWorkflow();
  190. ucw.enhanceMenubar('.user-competency-actions');
  191. ucw.on('status-changed', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
  192. ucw.on('error-occured', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
  193. });
  194. {{/js}}