MDL-64506 templates: Move BS2 labels to BS4 badges
[moodle.git] / admin / tool / lp / templates / plans_page.mustache
CommitLineData
4db373d5
DM
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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 User learning plans page.
19
20 Classes required for JS:
21 * planactions
22
23 Data attributes required for JS:
24 * data-region = plans
25 * data-planid = plans.id
26 * data-userid = userid
27 * data-action = deleteplan
28
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
34}}
35
d65b912d 36<div data-region="plans">
912a1830 37<div class="pull-left">
d11d4c14
SG
38 {{#navigation}}
39 {{{.}}}
40 {{/navigation}}
41</div>
4db373d5
DM
42<table class="generaltable fullwidth">
43 <caption>{{#str}}listplanscaption, tool_lp{{/str}}</caption>
44 <thead>
45 <tr>
46 <th scope="col">{{#str}}planname, tool_lp{{/str}}</th>
19456fec 47 <th scope="col">{{#str}}templatebased, tool_lp{{/str}}</th>
4db373d5
DM
48 <th scope="col">{{#str}}status, tool_lp{{/str}}</th>
49 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
50 </tr>
51 </thead>
52 <tbody>
53 {{#plans}}
12888aba 54 <tr data-region="plan-node" data-id="{{id}}" data-userid="{{userid}}">
4db373d5 55 <td>
32cf4bcb 56 <span><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></span>
19456fec
IT
57 </td>
58 <td>
59 {{#isbasedontemplate}}
3f2c68f1 60 <span class="badge badge-info">{{#str}}yes{{/str}}</span>
19456fec
IT
61 {{/isbasedontemplate}}
62 {{^isbasedontemplate}}
3f2c68f1 63 <span class="badge">{{#str}}no{{/str}}</span>
19456fec 64 {{/isbasedontemplate}}
4db373d5
DM
65 </td>
66 <td>{{statusname}}</td>
67 <td>
3c230247 68 {{#canmanage}}
4db373d5 69 <div style="display: inline-block;">
d65b912d
DW
70 <ul title="{{#str}}edit{{/str}}" class="planactions">
71 <li>
72 <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
7b02521c 73 <ul class="dropdown dropdown-menu">
207136f2 74 <li class="{{^canbeedited}} disabled {{/canbeedited}} dropdown-item">
d805cc37 75 <a href="{{#canbeedited}}
8ae09bb0 76 {{pluginbaseurl}}/editplan.php?id={{id}}&amp;userid={{userid}}&amp;return=plans
d805cc37
IT
77 {{/canbeedited}}
78 {{^canbeedited}}
79 #
80 {{/canbeedited}}
81 ">
d65b912d 82 {{#pix}}t/edit{{/pix}} {{#str}}editthisplan, tool_lp{{/str}}
4db373d5
DM
83 </a>
84 </li>
3c230247 85 {{#isreopenallowed}}
207136f2 86 <li class="dropdown-item">
12888aba 87 <a data-action="plan-reopen" href="#">
d805cc37
IT
88 {{#pix}}t/edit{{/pix}} {{#str}}reopenplan, tool_lp{{/str}}
89 </a>
90 </li>
3c230247
FM
91 {{/isreopenallowed}}
92 {{#iscompleteallowed}}
207136f2 93 <li class="dropdown-item">
12888aba 94 <a data-action="plan-complete" href="#">
d805cc37
IT
95 {{#pix}}t/edit{{/pix}} {{#str}}completeplan, tool_lp{{/str}}
96 </a>
97 </li>
3c230247
FM
98 {{/iscompleteallowed}}
99 {{#isrequestreviewallowed}}
207136f2 100 <li class="dropdown-item">
3c230247
FM
101 <a data-action="plan-request-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
102 </li>
103 {{/isrequestreviewallowed}}
104 {{#iscancelreviewrequestallowed}}
207136f2 105 <li class="dropdown-item">
3c230247
FM
106 <a data-action="plan-cancel-review-request" href="#">{{#pix}}t/edit{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
107 </li>
108 {{/iscancelreviewrequestallowed}}
109 {{#isstartreviewallowed}}
207136f2 110 <li class="dropdown-item">
3c230247
FM
111 <a data-action="plan-start-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}startreview, tool_lp{{/str}}</a>
112 </li>
113 {{/isstartreviewallowed}}
114 {{#isstopreviewallowed}}
207136f2 115 <li class="dropdown-item">
3c230247
FM
116 <a data-action="plan-stop-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}stopreview, tool_lp{{/str}}</a>
117 </li>
118 {{/isstopreviewallowed}}
119 {{#isapproveallowed}}
207136f2 120 <li class="dropdown-item">
3c230247
FM
121 <a data-action="plan-approve" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planapprove, tool_lp{{/str}}</a>
122 </li>
123 {{/isapproveallowed}}
124 {{#isunapproveallowed}}
207136f2 125 <li class="dropdown-item">
3c230247
FM
126 <a data-action="plan-unapprove" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planunapprove, tool_lp{{/str}}</a>
127 </li>
128 {{/isunapproveallowed}}
129 {{#isunlinkallowed}}
207136f2 130 <li class="dropdown-item">
a8902ee2
SG
131 <a data-action="plan-unlink" href="#">
132 {{#pix}}t/edit{{/pix}} {{#str}}unlinkplantemplate, tool_lp{{/str}}
133 </a>
134 </li>
3c230247 135 {{/isunlinkallowed}}
207136f2 136 <li class="dropdown-item">
12888aba 137 <a data-action="plan-delete" href="#">
d65b912d 138 {{#pix}}t/delete{{/pix}} {{#str}}deletethisplan, tool_lp{{/str}}
4db373d5
DM
139 </a>
140 </li>
d65b912d 141 </ul>
4db373d5 142 </ul>
4db373d5 143 </div>
3c230247 144 {{/canmanage}}
4db373d5
DM
145 </td>
146 </tr>
147 {{/plans}}
148 </tbody>
149</table>
150
151{{^plans}}
beb3441b 152<p class="alert alert-info">
4db373d5
DM
153 {{#str}}nouserplans, tool_lp{{/str}}
154</p>
155{{/plans}}
156
6c2b163c
FM
157{{#canreaduserevidence}}
158<div class="pull-left">
159 <a href="{{pluginbaseurl}}/user_evidence_list.php?userid={{userid}}">{{#str}}userevidence, tool_lp{{/str}}</a>
160</div>
161{{/canreaduserevidence}}
4db373d5
DM
162
163{{#js}}
164// Initialise the JS.
12888aba 165require(['tool_lp/planactions'],
f0049415 166 function(ActionsMod) {
4db373d5 167
f0049415 168 var planActions = new ActionsMod('plans');
12888aba 169 planActions.enhanceMenubar('.planactions');
4db373d5
DM
170});
171
172{{/js}}
173
174</div>