MDL-69054 core_badges: allow editing OBv1.0 backpacks
[moodle.git] / badges / templates / external_backpacks_page.mustache
1 {{!
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/>.
16 }}
17 {{!
18     @template core_badges/external_backpacks_page
20     Manage backpacks.
22     Context variables required for this template:
23     * backpacks - array of objects containing id, backpackweburl, enabled, apiversion and sortorder
25     Example context (json):
26     {
27         "backpacks": [
28             {"backpackweburl": "http://localhost/", "sitebackpack": true, "cantest": true}
29         ]
30     }
31 }}
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>
38 <table class="generaltable fullwidth" id="backpacklist">
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}}
49         <tr data-backpackurl="{{{backpackweburl}}}">
50             <td> {{{backpackweburl}}} </td>
51             <td> {{#sitebackpack}}Yes{{/sitebackpack}} </td>
52             <td>
53                 <a href="{{baseurl}}?id={{id}}&action=edit">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
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}}
59             {{#cantest}}
60                 <a href="{{baseurl}}?id={{id}}&action=test">{{#pix}}t/check, core,{{#str}}testsettings, core_badges{{/str}}{{/pix}}</a>
61             {{/cantest}}
62             </td>
63         </tr>
64         {{/backpacks}}
65     </tbody>
66 </table>