From efa079072ceda3d16563c4df006e74ae4f0c19ce Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Mon, 8 Aug 2016 03:35:15 +0000 Subject: [PATCH] MDL-54698 message: change preferences to on/off text --- lang/en/message.php | 2 + .../notification_list_processor.php | 2 - .../preferences_notifications_list.mustache | 87 +++++++++++-------- theme/bootstrapbase/less/moodle/message.less | 49 +++++++++-- theme/bootstrapbase/style/moodle.css | 44 ++++++++-- 5 files changed, 135 insertions(+), 49 deletions(-) diff --git a/lang/en/message.php b/lang/en/message.php index 777d1347d54..0a34f337a07 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -119,8 +119,10 @@ $string['notificationwindow'] = 'Notification window'; $string['notificationpreferences'] = 'Notification preferences'; $string['notificationimage'] = 'Notification image'; $string['notifications'] = 'Notifications'; +$string['off'] = 'Off'; $string['offline'] = 'Offline'; $string['offlinecontacts'] = 'Offline contacts ({$a})'; +$string['on'] = 'On'; $string['online'] = 'Online'; $string['onlinecontacts'] = 'Online contacts ({$a})'; $string['onlyfromme'] = 'Only messages from me'; diff --git a/message/classes/output/preferences/notification_list_processor.php b/message/classes/output/preferences/notification_list_processor.php index afca0875e09..de9ed853fa7 100644 --- a/message/classes/output/preferences/notification_list_processor.php +++ b/message/classes/output/preferences/notification_list_processor.php @@ -122,13 +122,11 @@ class notification_list_processor implements templatable, renderable { 'name' => 'loggedin', 'displayname' => get_string('loggedindescription', 'message'), 'checked' => $this->is_preference_enabled($preferencebase.'_loggedin', $processor, $preferences), - 'iconurl' => $output->pix_url('i/marked')->out(), ], 'loggedoff' => [ 'name' => 'loggedoff', 'displayname' => get_string('loggedoffdescription', 'message'), 'checked' => $this->is_preference_enabled($preferencebase.'_loggedoff', $processor, $preferences), - 'iconurl' => $output->pix_url('i/marker')->out(), ], ]; diff --git a/message/templates/preferences_notifications_list.mustache b/message/templates/preferences_notifications_list.mustache index 64dc980a667..d0b2b34eaa5 100644 --- a/message/templates/preferences_notifications_list.mustache +++ b/message/templates/preferences_notifications_list.mustache @@ -102,8 +102,17 @@ {{#components}} - {{displayname}} - {{#processors}}{{/processors}} +

{{displayname}}

+ {{#processors}} + +
+
+
{{#str}} online, message {{/str}}
+
{{#str}} offline, message {{/str}}
+
+
+ + {{/processors}} {{#notifications}} @@ -118,42 +127,52 @@ {{^locked}}
{{#str}} disabled, question {{/str}}
- {{#loggedin}} -