From 48d43a16c35db5cff6a5214c03b135ab7ff11565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 23 May 2017 14:01:51 +0200 Subject: [PATCH 1/3] MOBILE-2103 overview: Fix centered course icon --- www/addons/mod/quiz/scss/styles.scss | 2 +- www/core/components/courses/scss/styles.scss | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/www/addons/mod/quiz/scss/styles.scss b/www/addons/mod/quiz/scss/styles.scss index b46df9b646a..197baf0a6b8 100644 --- a/www/addons/mod/quiz/scss/styles.scss +++ b/www/addons/mod/quiz/scss/styles.scss @@ -48,7 +48,7 @@ p.mma-mod-quiz-warning { .mm-timer { min-height: 41px; border: 0; - padding: 2px 0 1px 25px; + padding: 1px 0 1px 25px; .icon { left: 0; diff --git a/www/core/components/courses/scss/styles.scss b/www/core/components/courses/scss/styles.scss index f0f02780920..b6762dc0036 100644 --- a/www/core/components/courses/scss/styles.scss +++ b/www/core/components/courses/scss/styles.scss @@ -97,16 +97,21 @@ $doughnut-text-colour: $gray-darker; .icon { position: absolute; - top: 50%; text-align: center; /*rtl:ignore*/ - left: 50%; + left: -1px; + top: -1px; + right: 0; + bottom: 0; margin: 0; - transform: translate(-42%, -50%); color: $white; - height: ($chart-size / 2) + 10px; - width: ($chart-size / 2) + 10px; + height: $chart-size; + width: $chart-size; + line-height: $chart-size; font-size: ($chart-size / 2) + 10px; + &:before { + width: $chart-size; + } } } } From 7f6cb92bc8d32f64b436897632ad0e350af3b012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 24 May 2017 12:12:03 +0200 Subject: [PATCH 2/3] MOBILE-2103 login: Show logo if avatar not set on reconect --- .../components/login/controllers/reconnect.js | 9 +++++++++ .../components/login/templates/reconnect.html | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/www/core/components/login/controllers/reconnect.js b/www/core/components/login/controllers/reconnect.js index 7276ec594ba..f79b6380be2 100644 --- a/www/core/components/login/controllers/reconnect.js +++ b/www/core/components/login/controllers/reconnect.js @@ -45,6 +45,15 @@ angular.module('mm.core.login') $scope.credentials.username = site.infos.username; $scope.siteurl = site.infos.siteurl; + $scope.sitename = site.infos.sitename; + + // Check logoURL if user avatar is not set. + if ($scope.site.avatar.startsWith(site.infos.siteurl + '/theme/image.php')) { + $scope.site.avatar = false; + return site.getPublicConfig().then(function(config) { + $scope.logourl = config.logourl || config.compactlogourl; + }); + } }); if (siteConfig) { diff --git a/www/core/components/login/templates/reconnect.html b/www/core/components/login/templates/reconnect.html index 2aee6e4f386..d425a8cf33e 100644 --- a/www/core/components/login/templates/reconnect.html +++ b/www/core/components/login/templates/reconnect.html @@ -2,10 +2,19 @@
-
- {{ 'mm.core.pictureof' | translate:{$a: site.fullname} }} -

{{siteurl}}

-

{{ 'mm.login.reconnectdescription' | translate }}

+
+ {{ 'mm.core.pictureof' | translate:{$a: site.fullname} }} + + + + + +

{{siteurl}}

+ +

{{sitename}}

+

{{siteurl}}

+ +

{{ 'mm.login.reconnectdescription' | translate }}

{{ 'mm.login.username' | translate }}

From 3792a64ff113ff4eab7f57dc93546848f43c7790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 24 May 2017 12:21:35 +0200 Subject: [PATCH 3/3] MOBILE-2103 notifications: Fix update counter --- www/addons/messages/services/handlers.js | 3 ++- www/addons/notifications/services/handlers.js | 5 +++-- .../pushnotifications/services/pushnotifications.js | 12 +++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/www/addons/messages/services/handlers.js b/www/addons/messages/services/handlers.js index 7d5a82ef991..412b112500f 100644 --- a/www/addons/messages/services/handlers.js +++ b/www/addons/messages/services/handlers.js @@ -371,7 +371,8 @@ angular.module('mm.addons.messages') } function updateUnreadConversationsCount(siteId) { - return $mmaMessages.getUnreadConversationsCount().then(function(unread) { + siteId = siteId || $mmSite.getId(); + return $mmaMessages.getUnreadConversationsCount(undefined, siteId).then(function(unread) { // Leave badge enter if there is a 0+ or a 0. $scope.badge = parseInt(unread, 10) > 0 ? unread : ''; // Update badge. diff --git a/www/addons/notifications/services/handlers.js b/www/addons/notifications/services/handlers.js index 90eb9a458c5..f832baa8c98 100644 --- a/www/addons/notifications/services/handlers.js +++ b/www/addons/notifications/services/handlers.js @@ -23,7 +23,7 @@ angular.module('mm.addons.notifications') * @ngdoc service * @name $mmaNotificationsHandlers */ -.factory('$mmaNotificationsHandlers', function($log, $mmaNotifications, $mmEvents, $mmSitesManager, $mmUtil, +.factory('$mmaNotificationsHandlers', function($log, $mmaNotifications, $mmEvents, $mmSitesManager, $mmUtil, $mmSite, mmaNotificationsReadChangedEvent, mmaNotificationsReadCronEvent, $mmAddonManager) { $log = $log.getInstance('$mmaNotificationsHandlers'); @@ -106,7 +106,8 @@ angular.module('mm.addons.notifications') } function updateUnreadNotificationsCount(siteId) { - return $mmaNotifications.getUnreadNotificationsCount().then(function(unread) { + siteId = siteId || $mmSite.getId(); + return $mmaNotifications.getUnreadNotificationsCount(undefined, siteId).then(function(unread) { // Leave badge enter if there is a 0+ or a 0. $scope.badge = parseInt(unread, 10) > 0 ? unread : ''; // Update badge. diff --git a/www/addons/pushnotifications/services/pushnotifications.js b/www/addons/pushnotifications/services/pushnotifications.js index 138fcb09b9f..328ccf0bff3 100644 --- a/www/addons/pushnotifications/services/pushnotifications.js +++ b/www/addons/pushnotifications/services/pushnotifications.js @@ -260,10 +260,10 @@ angular.module('mm.addons.pushnotifications') * @module mm.addons.pushnotifications * @ngdoc method * @name $mmaPushNotifications#updateAddonCounter - * @param {String} siteId Site ID. - * @param {String} addon Registered addon name to set the badge number. - * @param {Number} number The number to be stored. - * @return {Promise} Promise resolved with the stored badge counter for the addon on the site. + * @param {String} [siteId] Site ID. If not defined, use current site. + * @param {String} addon Registered addon name to set the badge number. + * @param {Number} number The number to be stored. + * @return {Promise} Promise resolved with the stored badge counter for the addon on the site. */ self.updateAddonCounter = function(siteId, addon, number) { if ($mmPushNotificationsDelegate.isCounterHandlerRegistered(addon)) { @@ -403,12 +403,14 @@ angular.module('mm.addons.pushnotifications') /** * Save the addon/site badgecounter on the database. * - * @param {String} siteId Site ID. + * @param {String} [siteId] Site ID. If not defined, use current site. * @param {Number} number The number to be stored. * @param {String} [addon] Registered addon name. If not defined it will store the site total. * @return {Promise} Promise resolved with the stored badge counter for the addon or site. */ function saveAddonBadge(siteId, number, addon) { + siteId = siteId || $mmSite.getId(); + var entry = { siteid: siteId, addon: addon || 'site',