Moodle release 3.3rc1
[moodle.git] / theme / boost / templates / core / dataformat_selector.mustache
blob7c11ab397547d69f16682f37a159d6e65314b339
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/>.
17 {{!
18     @template core/dataformat_selector
20     Context variables required for this template:
21     * label
22     * base
23     * name
24     * params
25     * options
26     * sesskey
27     * submit
29     Example context (json):
30     {
31         "base": "http://example.org/",
32         "name": "test",
33         "value": "test",
34         "label": "Download table data as",
35         "params": false,
36         "options": [{"label": "CSV", "name": "csv"}, {"label": "Excel", "name": "excel"}],
37         "submit": "Download",
38         "sesskey": ""
39     }
41 <form method="get" action="{{base}}" class="dataformatselector m-a-1">
42     <div class="form-inline text-xs-right">
43         <input type="hidden" name="sesskey" value="{{sesskey}}">
44         <label for="downloadtype_{{name}}" class="m-r-1">{{label}}</label>
45         <select name="{{name}}" id="downloadtype_{{name}}" class="form-control">
46             {{#options}}
47                 <option value="{{value}}">{{label}}</option>
48             {{/options}}
49         </select>
50         <button type="submit" class="btn btn-secondary">{{submit}}</button>
51         {{#params}}
52             <input type="hidden" name="{{name}}" value="{{value}}">
53         {{/params}}
54     </div>
55 </form>