MDL-49650 tool_templatelibrary: New tool for browsing mustache templates
[moodle.git] / admin / tool / templatelibrary / templates / list_templates_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     Moodle template to the template library
20     The purpose of this template is build the entire page for the template library (by including smaller templates).
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * data-region, data-field
28     Context variables required for this template:
29     * allcomponents - array of components containing templates. Each component has a name and a component attribute.
31 }}
32 <div data-region="list-templates">
33     <form class="form-horizontal form-search">
34         <div class="control-group">
35             <label for="selectcomponent" class="control-label">{{#str}}component, tool_templatelibrary{{/str}}</label>
36             <div class="controls">
37                 <select id="selectcomponent" data-field="component">
38                     <option value="">{{#str}}all, tool_templatelibrary{{/str}}</option>
39                     {{#allcomponents}}
40                         <option value="{{component}}">{{name}}</option>
41                     {{/allcomponents}}
42                 </select>
43             </div>
44         </div>
45         <div class="control-group">
46             <label for="search" class="control-label">{{#str}}search, tool_templatelibrary{{/str}}</label>
47             <div class="controls">
48                 <input type="text" id="search" class="search-query" data-field="search"/>
49             </div>
50         </div>
51     </form>
52     <hr/>
53     {{> tool_templatelibrary/search_results }}
55     <hr/>
56     {{> tool_templatelibrary/display_template }}
58 </div>
59 {{#js}}
60     require(['tool_templatelibrary/search', 'tool_templatelibrary/display']);
61 {{/js}}