mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-67853 message: Remove on/offline settings on message preferences
This commit is contained in:
parent
e8ad1eaa43
commit
d74bd798b6
44 changed files with 696 additions and 682 deletions
150
message/templates/default_notification_preferences.mustache
Normal file
150
message/templates/default_notification_preferences.mustache
Normal file
|
@ -0,0 +1,150 @@
|
|||
{{!
|
||||
This file is part of Moodle - http://moodle.org/
|
||||
|
||||
Moodle is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Moodle is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template core_message/default_notification_preferences
|
||||
|
||||
This template will render the default notification preferences for admin settings.
|
||||
|
||||
Classes required for JS:
|
||||
* none
|
||||
|
||||
Data attributes required for JS:
|
||||
* All data attributes are required
|
||||
|
||||
Context variables required for this template:
|
||||
* providers Message providers
|
||||
* components Provider components
|
||||
* processors Message processors
|
||||
* preferences Saved preferences
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"processors": [
|
||||
{
|
||||
"displayname": "Web",
|
||||
"name": "popup"
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"displayname": "Assignment",
|
||||
"name": "mod_assign",
|
||||
"colspan": 3,
|
||||
"providers": [
|
||||
{
|
||||
"name": "assign_notification",
|
||||
"component": "mod_assign",
|
||||
"displayname": "Assignment notifications",
|
||||
"enabledsetting": "mod_assign_assign_notification_disable",
|
||||
"enabledlabel": "Sending Assignment enabled status",
|
||||
"enabled": 1,
|
||||
"settings": [
|
||||
{
|
||||
"lockedsetting": "mod_assign_assign_notification_locked[popup]",
|
||||
"locked": 1,
|
||||
"lockedlabel": "Sending Assignment via Web locked status",
|
||||
"enabledsetting": "mod_assign_assign_notification_enabled[popup]",
|
||||
"enabled": 1,
|
||||
"enabledlabel": "Sending Assignment via Web enabled status"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
<div class="preferences-page-container">
|
||||
<h2>{{#str}} managemessageoutputs, message {{/str}}</h2>
|
||||
|
||||
<div class="preferences-container">
|
||||
<table class="table table-hover preference-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{{#str}} enabled, core_message {{/str}}</th>
|
||||
{{#processors}}
|
||||
<th data-processor-name="{{name}}">{{{displayname}}}</th>
|
||||
{{/processors}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#components}}
|
||||
<tr class="preference-row"><th colspan="{{{colspan}}}">{{{displayname}}}</th></tr>
|
||||
{{#providers}}
|
||||
<tr class="defaultmessageoutputs">
|
||||
<td>{{{displayname}}}</td>
|
||||
<td>
|
||||
<div data-preference="{{{enabledsetting}}}">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox"
|
||||
id="{{{enabledsetting}}}"
|
||||
name="{{{enabledsetting}}}"
|
||||
class="custom-control-input provider_enabled"
|
||||
{{#enabled}}checked{{/enabled}}
|
||||
>
|
||||
<label for="{{{enabledsetting}}}" class="custom-control-label"
|
||||
title="{{enabledlabel}}">
|
||||
<span class="accesshide">{{enabledlabel}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{{#settings}}
|
||||
<td class="text-left">
|
||||
<div data-preference="{{{enabledsetting}}}">
|
||||
<div class="custom-control custom-switch {{#locked}} dimmed_text{{/locked}} pb-1">
|
||||
<input type="checkbox"
|
||||
id="{{{enabledsetting}}}"
|
||||
name="{{{enabledsetting}}}"
|
||||
class="custom-control-input enabled_message_setting"
|
||||
{{#enabled}}checked{{/enabled}}
|
||||
>
|
||||
<label for="{{{enabledsetting}}}" class="custom-control-label"
|
||||
title="{{enabledlabel}}">
|
||||
{{#str}} enabled, core_message {{/str}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div data-preference="{{{lockedsetting}}}">
|
||||
<div class="custom-control custom-switch pt-1">
|
||||
<input type="checkbox"
|
||||
id="{{{lockedsetting}}}"
|
||||
name="{{{lockedsetting}}}"
|
||||
class="custom-control-input locked_message_setting"
|
||||
{{#locked}}checked{{/locked}}
|
||||
>
|
||||
<label for="{{{lockedsetting}}}" class="custom-control-label"
|
||||
title="{{lockedlabel}}">
|
||||
{{#str}} forced, core_message {{/str}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{{/settings}}
|
||||
</tr>
|
||||
{{/providers}}
|
||||
{{/components}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{#js}}
|
||||
require(['core_message/default_notification_preferences'], function(NotificationPreferences) {
|
||||
NotificationPreferences.init();
|
||||
});
|
||||
{{/js}}
|
|
@ -41,26 +41,13 @@
|
|||
{
|
||||
"displayname": "Notices about minor problems",
|
||||
"preferencekey": "message_provider_moodle_notices",
|
||||
"onlinehelphtml": "<p>some help HTML</p>",
|
||||
"offlinehelphtml": "<p>some help HTML</p>",
|
||||
"processors": [
|
||||
{
|
||||
"displayname": "Popup notification",
|
||||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
}
|
||||
"enabled": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -34,26 +34,13 @@
|
|||
{
|
||||
"displayname": "Notices about minor problems",
|
||||
"preferencekey": "message_provider_moodle_notices",
|
||||
"onlinehelphtml": "<p>some help HTML</p>",
|
||||
"offlinehelphtml": "<p>some help HTML</p>",
|
||||
"processors": [
|
||||
{
|
||||
"displayname": "Popup notification",
|
||||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
}
|
||||
"enabled": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -64,18 +51,7 @@
|
|||
<tr data-preference-key="{{preferencekey}}">
|
||||
<th>{{displayname}}</th>
|
||||
<td class="align-bottom">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="span6 col-6">
|
||||
{{#str}} loggedin, message {{/str}}
|
||||
{{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}}
|
||||
</div>
|
||||
<div class="span6 col-6">
|
||||
{{#str}} loggedoff, message {{/str}}
|
||||
{{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{#str}} enabled, core_message {{/str}}
|
||||
</td>
|
||||
</tr>
|
||||
{{#processors}}
|
||||
|
|
|
@ -40,16 +40,7 @@
|
|||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0
|
||||
}
|
||||
"enabled": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -34,15 +34,19 @@
|
|||
{
|
||||
"userid": 1,
|
||||
"disableall": 0,
|
||||
"processors": [
|
||||
{
|
||||
"displayname": "Popup notification",
|
||||
"name": "popup",
|
||||
"hassettings": 1,
|
||||
"userid": 3,
|
||||
"contextid": 3
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"displayname": "System",
|
||||
"processors": [
|
||||
{
|
||||
"onlinehelphtml": "<p>help button HTML</p>",
|
||||
"offlinehelphtml": "<p>help button HTML</p>"
|
||||
}
|
||||
],
|
||||
"colspan": 2,
|
||||
"notifications": [
|
||||
{
|
||||
"displayname": "Notices about minor problems",
|
||||
|
@ -53,18 +57,8 @@
|
|||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
}
|
||||
"enabled": 1,
|
||||
"enabledlabel": "Sending Assignment enabled status"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -87,7 +81,7 @@
|
|||
<table class="table preference-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{displayname}}</th>
|
||||
<th>{{{displayname}}}</th>
|
||||
{{#processors}}
|
||||
{{> message/notification_preferences_processor }}
|
||||
{{/processors}}
|
||||
|
@ -103,8 +97,8 @@
|
|||
</div>
|
||||
{{#js}}
|
||||
require(['jquery', 'core_message/preferences_notifications_list_controller'],
|
||||
function($, controller) {
|
||||
function($, Controller) {
|
||||
|
||||
new controller($('.preferences-container'));
|
||||
new Controller($('.preferences-container'));
|
||||
});
|
||||
{{/js}}
|
||||
|
|
|
@ -33,12 +33,7 @@
|
|||
Example context (json):
|
||||
{
|
||||
"displayname": "System",
|
||||
"processors": [
|
||||
{
|
||||
"onlinehelphtml": "<p>help button HTML</p>",
|
||||
"offlinehelphtml": "<p>help button HTML</p>"
|
||||
}
|
||||
],
|
||||
"colspan": 2,
|
||||
"notifications": [
|
||||
{
|
||||
"displayname": "Notices about minor problems",
|
||||
|
@ -49,18 +44,8 @@
|
|||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0,
|
||||
"disableall": 0
|
||||
}
|
||||
"enabled": 0,
|
||||
"enabledlabel": "Sending Assignment enabled status"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -68,23 +53,7 @@
|
|||
}
|
||||
}}
|
||||
<tr>
|
||||
<th><h4>{{displayname}}</h4></th>
|
||||
{{#processors}}
|
||||
<td class="align-bottom">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{#str}} loggedin, message {{/str}}
|
||||
{{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{#str}} loggedoff, message {{/str}}
|
||||
{{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{{/processors}}
|
||||
<th colspan="{{{colspan}}}">{{{displayname}}}</th>
|
||||
</tr>
|
||||
{{#notifications}}
|
||||
{{> message/notification_preferences_component_notification }}
|
||||
|
|
|
@ -40,70 +40,33 @@
|
|||
"name": "popup",
|
||||
"locked": 0,
|
||||
"userconfigured": 1,
|
||||
"loggedin": {
|
||||
"name": "loggedin",
|
||||
"displayname": "When I'm logged in",
|
||||
"checked": 0
|
||||
},
|
||||
"loggedoff": {
|
||||
"name": "loggedoff",
|
||||
"displayname": "When I'm offline",
|
||||
"checked": 0
|
||||
}
|
||||
"enabled": 1,
|
||||
"enabledlabel": "Sending Assignment enabled status"
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
<tr class="preference-row" data-region="preference-row" data-preference-key="{{preferencekey}}">
|
||||
<td class="preference-name">{{displayname}}</td>
|
||||
<tr class="preference-row" data-region="preference-row" data-preference-key="{{{preferencekey}}}">
|
||||
<td class="preference-name">{{{displayname}}}</td>
|
||||
{{#processors}}
|
||||
<td {{^userconfigured}}class="disabled"{{/userconfigured}} data-processor-name="{{name}}">
|
||||
<td {{^userconfigured}}class="disabled"{{/userconfigured}} data-processor-name="{{name}}">
|
||||
{{#locked}}
|
||||
<div class="dimmed_text">{{lockedmessage}}</div>
|
||||
<div class="dimmed_text" title="{{lockedlabel}}">{{{lockedmessage}}}</div>
|
||||
{{/locked}}
|
||||
{{^locked}}
|
||||
<div class="disabled-message">{{#str}} disabled, admin {{/str}}</div>
|
||||
<form>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{#loggedin}}
|
||||
{{< core/hover_tooltip }}
|
||||
{{$anchor}}
|
||||
<label class="custom-control custom-switch"
|
||||
title="{{displayname}}"
|
||||
data-state="{{name}}">
|
||||
<span class="accesshide">{{displayname}}</span>
|
||||
<input type="checkbox"
|
||||
class="custom-control-input"
|
||||
{{#checked}}checked{{/checked}}
|
||||
{{#disableall}}disabled{{/disableall}} />
|
||||
<span class="custom-control-label d-block"></span>
|
||||
</label>
|
||||
{{/anchor}}
|
||||
{{$tooltip}}{{displayname}}{{/tooltip}}
|
||||
{{/ core/hover_tooltip }}
|
||||
{{/loggedin}}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{#loggedoff}}
|
||||
{{< core/hover_tooltip }}
|
||||
{{$anchor}}
|
||||
<label class="custom-control custom-switch"
|
||||
title="{{displayname}}"
|
||||
data-state="{{name}}">
|
||||
<span class="accesshide">{{displayname}}</span>
|
||||
<input type="checkbox"
|
||||
class="custom-control-input"
|
||||
{{#checked}}checked{{/checked}}
|
||||
{{#disableall}}disabled{{/disableall}} />
|
||||
<span class="custom-control-label d-block"></span>
|
||||
</label>
|
||||
{{/anchor}}
|
||||
{{$tooltip}}{{displayname}}{{/tooltip}}
|
||||
{{/ core/hover_tooltip }}
|
||||
{{/loggedoff}}
|
||||
</div>
|
||||
<div class="preference-state" data-preference="{{{preferencekey}}}_{{{name}}}">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox"
|
||||
id="{{{preferencekey}}}_{{{name}}}"
|
||||
name="{{{preferencekey}}}_{{{name}}}"
|
||||
class="custom-control-input notification_enabled"
|
||||
{{#enabled}}checked{{/enabled}}
|
||||
>
|
||||
<label for="{{{preferencekey}}}_{{{name}}}" class="custom-control-label"
|
||||
title="{{enabledlabel}}">
|
||||
{{#str}} enabled, core_message {{/str}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue