Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
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.
8
 
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.
13
 
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
    @template core_message/default_notification_preferences
19
 
20
    This template will render the default notification preferences for admin settings.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * All data attributes are required
27
 
28
    Context variables required for this template:
29
    * providers Message providers
30
    * components Provider components
31
    * processors Message processors
32
    * preferences Saved preferences
33
 
34
    Example context (json):
35
    {
36
        "processors": [
37
            {
38
                "displayname": "Web",
39
                "name": "popup"
40
            }
41
        ],
42
        "components": [
43
            {
44
                "displayname": "Assignment",
45
                "name": "mod_assign",
46
                "colspan": 3,
47
                "providers": [
48
                    {
49
                        "name": "assign_notification",
50
                        "component": "mod_assign",
51
                        "displayname": "Assignment notifications",
52
                        "enabledsetting": "mod_assign_assign_notification_disable",
53
                        "enabledlabel": "Sending Assignment enabled status",
54
                        "enabled": 1,
55
                        "settings": [
56
                            {
57
                                "lockedsetting": "mod_assign_assign_notification_locked[popup]",
58
                                "locked": 1,
59
                                "lockedlabel": "Sending Assignment via Web locked status",
60
                                "enabledsetting": "mod_assign_assign_notification_enabled[popup]",
61
                                "enabled": 1,
1441 ariadna 62
                                "enabledlabel": "Sending Assignment via Web enabled status",
63
                                "supportsprocessor": true
1 efrain 64
                            }
65
                        ]
66
                    }
67
                ]
68
            }
69
        ]
70
    }
71
}}
72
<div class="preferences-page-container">
73
    <h2>{{#str}} managemessageoutputs, message {{/str}}</h2>
74
 
75
    <div class="preferences-container">
76
        <table class="table table-hover preference-table">
77
            <thead>
78
                <tr>
79
                    <th></th>
80
                    <th>{{#str}} enabled, core_message {{/str}}</th>
81
                    {{#processors}}
82
                        <th data-processor-name="{{name}}">{{{displayname}}}</th>
83
                    {{/processors}}
84
                </tr>
85
            </thead>
86
            <tbody>
87
                {{#components}}
88
                    <tr class="preference-row"><th colspan="{{{colspan}}}">{{{displayname}}}</th></tr>
89
                    {{#providers}}
90
                        <tr class="defaultmessageoutputs">
91
                            <td>{{{displayname}}}</td>
92
                            <td>
93
                                <div data-preference="{{{enabledsetting}}}">
1441 ariadna 94
                                    <div class="form-check form-switch">
1 efrain 95
                                        <input type="checkbox"
96
                                            id="{{{enabledsetting}}}"
97
                                            name="{{{enabledsetting}}}"
1441 ariadna 98
                                            class="form-check-input provider_enabled"
1 efrain 99
                                            {{#enabled}}checked{{/enabled}}
100
                                        >
1441 ariadna 101
                                        <label for="{{{enabledsetting}}}" class="form-check-label"
1 efrain 102
                                            title="{{enabledlabel}}">
103
                                            <span class="accesshide">{{enabledlabel}}</span>
104
                                        </label>
105
                                    </div>
106
                                </div>
107
                            </td>
108
                            {{#settings}}
1441 ariadna 109
                                <td class="text-start">
110
                                    {{#supportsprocessor}}
111
                                        <div data-preference="{{{enabledsetting}}}">
112
                                            <div class="form-check form-switch {{#locked}} dimmed_text{{/locked}} pb-1">
113
                                                <input type="checkbox"
114
                                                       id="{{{enabledsetting}}}"
115
                                                       name="{{{enabledsetting}}}"
116
                                                       class="form-check-input enabled_message_setting"
117
                                                       {{#enabled}}checked{{/enabled}}
118
                                                >
119
                                                <label for="{{{enabledsetting}}}" class="form-check-label"
120
                                                       title="{{enabledlabel}}">
121
                                                    {{#str}} enabled, core_message {{/str}}
122
                                                </label>
123
                                            </div>
1 efrain 124
                                        </div>
1441 ariadna 125
                                        <div data-preference="{{{lockedsetting}}}">
126
                                            <div class="form-check form-switch pt-1">
127
                                                <input type="checkbox"
128
                                                       id="{{{lockedsetting}}}"
129
                                                       name="{{{lockedsetting}}}"
130
                                                       class="form-check-input locked_message_setting"
131
                                                       {{#locked}}checked{{/locked}}
132
                                                >
133
                                                <label for="{{{lockedsetting}}}" class="form-check-label"
134
                                                       title="{{lockedlabel}}">
135
                                                    {{#str}} forced, core_message {{/str}}
136
                                                </label>
137
                                            </div>
1 efrain 138
                                        </div>
1441 ariadna 139
                                    {{/supportsprocessor}}
140
                                    {{^supportsprocessor}}
141
                                        <div class="text-center">
142
                                            {{#str}} notsupported, core_message {{/str}}
143
                                        </div>
144
                                    {{/supportsprocessor}}
1 efrain 145
                                </td>
146
                            {{/settings}}
147
                        </tr>
148
                    {{/providers}}
149
                {{/components}}
150
            </tbody>
151
        </table>
152
    </div>
153
</div>
154
{{#js}}
155
require(['core_message/default_notification_preferences'], function(NotificationPreferences) {
156
        NotificationPreferences.init();
157
    });
158
{{/js}}