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/>.
15 @template mod_data/presets
17 Form containing all database presets displayed within a table.
19 Context variables required for this template:
20 * formactionul - The form action url.
21 * d - The database id.
22 * presets - List of presets containing id, name, fullname, shortname and actions.
24 Example context (json):
26 "formactionul": "http://www.example.com",
31 "name": "Image gallery",
32 "shortname": "imagegallery",
33 "fullname": "Image gallery",
39 "name": "Preset saved manually",
40 "shortname": "Preset saved manually",
41 "fullname": "Preset saved manually (admin)",
48 {{#str}}presetshelp, mod_data{{/str}}
50 <form method="post" action="{{formactionul}}" class="mt-4">
51 <input type="hidden" name="d" value="{{d}}">
52 <input type="hidden" name="mode" value="usepreset">
53 <input type="hidden" name="action" value="select">
55 <table id="presets-list" class="generaltable fullwidth">
58 <th class="pl-4 border-top-0" scope="col" style="width: 3%"></th>
59 <th class="pl-4 border-top-0" scope="col">{{#str}} name {{/str}}</th>
60 <th class="pl-4 border-top-0" scope="col" style="width: 3%">{{#showmanage}}{{#str}} action {{/str}}{{/showmanage}}</th>
66 <td class="p-4 border-right">
67 <input type="radio" name="fullname" value="{{userid}}/{{shortname}}" />
69 <td class="p-4">{{fullname}}</td>
70 <td class="p-4 preset_action_menu">
72 <div class="float-right">
82 <input type="submit" name="selectpreset" value="{{#str}}usepreset, mod_data{{/str}}" class="btn btn-secondary mt-2 float-right" disabled>
86 require(['mod_data/selectpreset'], function(selectPreset) {