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/>.
18 User learning plans page.
20 Classes required for JS:
23 Data attributes required for JS:
25 * data-planid = plans.id
26 * data-userid = userid
27 * data-action = deleteplan
29 Context variables required for this template:
30 * userid - The plan user id
31 * pluginbaseurl - tool_lp base url
32 * plans - The list of learning plans
33 * navigation - array of strings containing buttons for navigation
36 <div data-region="plans">
37 <div class="pull-left">
42 <table class="generaltable fullwidth">
43 <caption>{{#str}}listplanscaption, tool_lp{{/str}}</caption>
46 <th scope="col">{{#str}}planname, tool_lp{{/str}}</th>
47 <th scope="col">{{#str}}templatebased, tool_lp{{/str}}</th>
48 <th scope="col">{{#str}}status, tool_lp{{/str}}</th>
49 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
54 <tr data-region="plan-node" data-id="{{id}}" data-userid="{{userid}}">
56 <span><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></span>
59 {{#isbasedontemplate}}
60 <span class="badge badge-info">{{#str}}yes{{/str}}</span>
61 {{/isbasedontemplate}}
62 {{^isbasedontemplate}}
63 <span class="badge">{{#str}}no{{/str}}</span>
64 {{/isbasedontemplate}}
66 <td>{{statusname}}</td>
69 <div style="display: inline-block;">
70 <ul title="{{#str}}edit{{/str}}" class="planactions">
72 <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
73 <ul class="dropdown dropdown-menu">
74 <li class="{{^canbeedited}} disabled {{/canbeedited}} dropdown-item">
75 <a href="{{#canbeedited}}
76 {{pluginbaseurl}}/editplan.php?id={{id}}&userid={{userid}}&return=plans
82 {{#pix}}t/edit{{/pix}} {{#str}}editthisplan, tool_lp{{/str}}
86 <li class="dropdown-item">
87 <a data-action="plan-reopen" href="#">
88 {{#pix}}t/edit{{/pix}} {{#str}}reopenplan, tool_lp{{/str}}
92 {{#iscompleteallowed}}
93 <li class="dropdown-item">
94 <a data-action="plan-complete" href="#">
95 {{#pix}}t/edit{{/pix}} {{#str}}completeplan, tool_lp{{/str}}
98 {{/iscompleteallowed}}
99 {{#isrequestreviewallowed}}
100 <li class="dropdown-item">
101 <a data-action="plan-request-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
103 {{/isrequestreviewallowed}}
104 {{#iscancelreviewrequestallowed}}
105 <li class="dropdown-item">
106 <a data-action="plan-cancel-review-request" href="#">{{#pix}}t/edit{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
108 {{/iscancelreviewrequestallowed}}
109 {{#isstartreviewallowed}}
110 <li class="dropdown-item">
111 <a data-action="plan-start-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}startreview, tool_lp{{/str}}</a>
113 {{/isstartreviewallowed}}
114 {{#isstopreviewallowed}}
115 <li class="dropdown-item">
116 <a data-action="plan-stop-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}stopreview, tool_lp{{/str}}</a>
118 {{/isstopreviewallowed}}
119 {{#isapproveallowed}}
120 <li class="dropdown-item">
121 <a data-action="plan-approve" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planapprove, tool_lp{{/str}}</a>
123 {{/isapproveallowed}}
124 {{#isunapproveallowed}}
125 <li class="dropdown-item">
126 <a data-action="plan-unapprove" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planunapprove, tool_lp{{/str}}</a>
128 {{/isunapproveallowed}}
130 <li class="dropdown-item">
131 <a data-action="plan-unlink" href="#">
132 {{#pix}}t/edit{{/pix}} {{#str}}unlinkplantemplate, tool_lp{{/str}}
136 <li class="dropdown-item">
137 <a data-action="plan-delete" href="#">
138 {{#pix}}t/delete{{/pix}} {{#str}}deletethisplan, tool_lp{{/str}}
152 <p class="alert alert-info">
153 {{#str}}nouserplans, tool_lp{{/str}}
157 {{#canreaduserevidence}}
158 <div class="pull-left">
159 <a href="{{pluginbaseurl}}/user_evidence_list.php?userid={{userid}}">{{#str}}userevidence, tool_lp{{/str}}</a>
161 {{/canreaduserevidence}}
164 // Initialise the JS.
165 require(['tool_lp/planactions'],
166 function(ActionsMod) {
168 var planActions = new ActionsMod('plans');
169 planActions.enhanceMenubar('.planactions');