MDL-69054 core_badges: allow editing OBv1.0 backpacks
[moodle.git] / badges / templates / external_backpacks_page.mustache
CommitLineData
aae219ac
DW
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{{!
1837b1d5 18 @template core_badges/external_backpacks_page
48c8a555 19
aae219ac
DW
20 Manage backpacks.
21
22 Context variables required for this template:
7444ba74 23 * backpacks - array of objects containing id, backpackweburl, enabled, apiversion and sortorder
48c8a555 24
1837b1d5
DW
25 Example context (json):
26 {
27 "backpacks": [
aa3a9c78 28 {"backpackweburl": "http://localhost/", "sitebackpack": true, "cantest": true}
92219c8f 29 ]
1837b1d5 30 }
aae219ac 31}}
a80541ea
SA
32
33<form action="{{baseurl}}" method="get" id="createbackpack">
34 <input type="hidden" name="action" value="edit"/>
35 <button type="submit" class="btn btn-secondary">{{#str}}newbackpack, core_badges{{/str}}</button>
36</form>
37
38<table class="generaltable fullwidth" id="backpacklist">
aae219ac
DW
39 <caption>{{#str}}listbackpacks, core_badges{{/str}}</caption>
40 <thead>
41 <tr>
42 <th scope="col">{{#str}}backpackweburl, core_badges{{/str}}</th>
43 <th scope="col">{{#str}}sitebackpack, core_badges{{/str}}</th>
44 <th scope="col">{{#str}}actions, core_badges{{/str}}</th>
45 </tr>
46 </thead>
47 <tbody>
48 {{#backpacks}}
a80541ea 49 <tr data-backpackurl="{{{backpackweburl}}}">
aae219ac
DW
50 <td> {{{backpackweburl}}} </td>
51 <td> {{#sitebackpack}}Yes{{/sitebackpack}} </td>
52 <td>
a80541ea 53 <a href="{{baseurl}}?id={{id}}&action=edit">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
a80541ea
SA
54 {{^iscurrent}}
55 <a href="{{baseurl}}?id={{id}}&action=delete" role="button" data-action="deletebackpack">
56 {{#pix}}t/delete, core,{{#str}}delete{{/str}}{{/pix}}
57 </a>
58 {{/iscurrent}}
92219c8f
SA
59 {{#cantest}}
60 <a href="{{baseurl}}?id={{id}}&action=test">{{#pix}}t/check, core,{{#str}}testsettings, core_badges{{/str}}{{/pix}}</a>
61 {{/cantest}}
aae219ac 62 </td>
aae219ac
DW
63 </tr>
64 {{/backpacks}}
65 </tbody>
92219c8f 66</table>