MDL-60061 mod_scorm: add support for drag/drop events
[moodle.git] / lib / form / templates / element-template.mustache
blobcc1195ad53c176923fbd85b9c79b039d4ec978dd
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_form/element-template
20     Moodle form element wrapper template.
22     The purpose of this template is to wrap a form element.
24     Classes required for JS:
25     * none
27     Data attributes required for JS:
28     * none
30     Context variables required for this template:
31     * label
32     * helpbutton
33     * error
34     * element
35         * id
36         * name
38     Example context (json):
39     {
40         "label": "Password",
41         "error": "No password set",
42         "element": {
43             "id": "example_password_unmask",
44             "name": "example"
45         }
46     }
49 <div id="fitem_{{ element.id }}" class="fitem fitem_{{ element.type }}" {{#element.groupname}}data-groupname="{{.}}"{{/element.groupname}}>
50     <div class="fitemtitle">
51       <label for="{{element.id}}">{{{ label }}}</label>
52         {{{ helpbutton }}}
53     </div>
54     <div class="felement {{# error }} error{{/ error }} f{{ element.type }}">
55         {{# error }}
56         <span class="error" tabindex="0" id="id_error_{{ element.name }}">
57             {{{ error }}}
58         </span>
59         {{/ error }}
60         {{$ element }}
61             <!-- Element goes here -->
62         {{/ element }}
63     </div>
64 </div>