Merge branch 'MDL-80244-main' of https://github.com/roland04/moodle
[moodle.git] / message / templates / preferences_processor.mustache
blobdd77931954c5bb99d26a9b6b0349f9d9ed6228c8
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_message/preferences_processor
20     The message processor configuration block for the preferences page
22     Classes required for JS:
23     * None
25     Data attibutes required for JS:
26     * None
28     Context variables required for this template:
29     * userid The logged in user id
30     * displayname The display name for the processor form
31     * name The name of the processor
32     * formhtml The form HTML
34     Example context (json):
35     {
36         "userid": 1,
37         "displayname": "Email",
38         "name": "email",
39         "formhtml": "<input name='test' type='text' />"
40     }
42 <h4>{{displayname}}</h4>
43 <div class="processor-container"
44     data-user-id="{{userid}}"
45     data-processor-name="{{name}}"
46     data-processor-id="{{uniqid}}">
48     <div class="loading-container">
49         <div class="vertical-align"></div>
50         {{> core/loading }}
51     </div>
52     <form>
53         {{{formhtml}}}
54     </form>
55 </div>
56 {{#js}}
57 require(['jquery', 'core_message/preferences_processor_form'], function($, ProcessorForm) {
58     new ProcessorForm($('[data-processor-id="{{uniqid}}"]'));
59 });
60 {{/js}}