Merge branch 'MDL-62983-master' of git://github.com/sarjona/moodle
[moodle.git] / message / templates / message_preferences_notification_processor.mustache
blob43c38eff4e4a2cf5ccb2c998903d69511ace02e3
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/message_preferences_notification_processor
20     The message preferences page
22     Classes required for JS:
23     * None
25     Data attibutes required for JS:
26     * All data attributes are required
28     Context variables required for this template:
29     * displayname   The display name of the processor
30     * name          The name of the processor
31     * locked        Whether the processor is locked
32     * loggedin      The logged in settings
33     * loggedoff     The logged off settings
35     Example context (json):
36     {
37         "displayname": "Notices about minor problems",
38         "preferencekey": "message_provider_moodle_notices",
39         "processors": [
40             {
41                 "displayname": "Popup notification",
42                 "name": "popup",
43                 "locked": 0,
44                 "userconfigured": 1,
45                 "loggedin": {
46                     "name": "loggedin",
47                     "displayname": "When I'm logged in",
48                     "checked": 0,
49                     "disableall": 0
50                 },
51                 "loggedoff": {
52                     "name": "loggedoff",
53                     "displayname": "When I'm offline",
54                     "checked": 0,
55                     "disableall": 0
56                 }
57             }
58         ]
59     }
61 <tr class="preference-row" data-region="preference-row" data-preference-key="{{preferencekey}}">
62     <td class="preference-name">{{displayname}}</td>
63     <td {{^userconfigured}}class="disabled"{{/userconfigured}} data-processor-name="{{name}}">
64         {{#locked}}
65             <div class="dimmed_text">{{lockedmessage}}</div>
66         {{/locked}}
67         {{^locked}}
68             <div class="disabled-message">{{#str}} disabled, question {{/str}}</div>
69             <form>
70                 <div class="container-fluid">
71                     <div class="row-fluid">
72                         <div class="span6 col-xs-6">
73                             {{#loggedin}}
74                                 {{< core/hover_tooltip }}
75                                     {{$anchor}}
76                                         <label class="preference-state"
77                                             title="{{displayname}}"
78                                             data-state="{{name}}">
80                                             <span class="accesshide">{{displayname}}</span>
81                                             <input type="checkbox"
82                                                 tabindex="-1"
83                                                 class="accesshide"
84                                                 {{#checked}}checked{{/checked}}
85                                                 {{#disableall}}disabled{{/disableall}} />
86                                             <div class="preference-state-status-container" tabindex="0">
87                                                 <span class="on-text">{{#str}} on, message {{/str}}</span>
88                                                 <span class="off-text">{{#str}} off, message {{/str}}</span>
89                                                 {{> core/loading }}
90                                             </div>
91                                         </label>
92                                     {{/anchor}}
93                                     {{$tooltip}}{{displayname}}{{/tooltip}}
94                                 {{/ core/hover_tooltip }}
95                             {{/loggedin}}
96                         </div>
97                         <div class="span6 col-xs-6">
98                             {{#loggedoff}}
99                                 {{< core/hover_tooltip }}
100                                     {{$anchor}}
101                                         <label class="preference-state"
102                                             title="{{displayname}}"
103                                             data-state="{{name}}">
105                                             <span class="accesshide">{{displayname}}</span>
106                                             <input type="checkbox"
107                                                 tabindex="-1"
108                                                 class="accesshide"
109                                                 {{#checked}}checked{{/checked}}
110                                                 {{#disableall}}disabled{{/disableall}} />
111                                             <div class="preference-state-status-container" tabindex="0">
112                                                 <span class="on-text">{{#str}} on, message {{/str}}</span>
113                                                 <span class="off-text">{{#str}} off, message {{/str}}</span>
114                                                 {{> core/loading }}
115                                             </div>
116                                         </label>
117                                     {{/anchor}}
118                                     {{$tooltip}}{{displayname}}{{/tooltip}}
119                                 {{/ core/hover_tooltip }}
120                             {{/loggedoff}}
121                         </div>
122                     </div>
123                 </div>
124             </form>
125         {{/locked}}
126     </td>
127 </tr>