Merge branch 'MDL-55609-master' of git://github.com/andrewnicols/moodle
[moodle.git] / admin / templates / setting.mustache
blobed172466eba8b79fd733fb34bf77a2ec1f22e754
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_admin/setting
20     Admin setting template.
22     Context variables required for this template:
23     * labelfor - id of the form element
24     * title - Setting title
25     * override - Overridden message
26     * warning - Warning message
27     * name - Setting name
28     * error - Error message
29     * element - The Element HTML
30     * forceltr - Force this element to be displayed LTR
31     * default - Default value
33     Example context (json):
34     {
35         "title": "Setting title",
36         "labelfor": "id0",
37         "override": "Overidden",
38         "warning": "Warning",
39         "name": "Name",
40         "error": "Error",
41         "element": "Raw HTML",
42         "forceltr": false,
43         "default": "Default value"
44     }
46 <div class="form-item clearfix" id="{{id}}">
47     <div class="form-label">
48         <label {{#labelfor}}for="{{labelfor}}"{{/labelfor}}>
49             {{{title}}}
50             {{#override}}
51                 <div class="form-overridden">{{override}}</div>
52             {{/override}}
53             {{#warning}}
54                 <div class="form-warning">{{warning}}</div>
55             {{/warning}}
56         </label>
57         <span class="form-shortname">{{{name}}}</span>
58     </div>
59     <div class="form-setting">
60         {{#error}}
61             <div><span class="error">{{error}}</span></div>
62         {{/error}}
63         {{{element}}}
64         {{#default}}
65             <div class="form-defaultinfo {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
66         {{/default}}
67     </div>
68     <div class="form-description">{{{description}}}</div>
69 </div>