Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion www/addons/messages/services/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion www/addons/mod/quiz/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions www/addons/notifications/services/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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.
Expand Down
12 changes: 7 additions & 5 deletions www/addons/pushnotifications/services/pushnotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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',
Expand Down
15 changes: 10 additions & 5 deletions www/core/components/courses/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions www/core/components/login/controllers/reconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
17 changes: 13 additions & 4 deletions www/core/components/login/templates/reconnect.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
<ion-content mm-state-class padding="true" class="mm-center-view">
<div class="mm-view-content">
<div class="box">
<div class="item item-text-wrap item-avatar-center item-borderless">
<img ng-src="{{site.avatar}}" class="avatar" mm-external-content siteid="site.id" alt="{{ 'mm.core.pictureof' | translate:{$a: site.fullname} }}" role="presentation">
<h2 class="padding">{{siteurl}}</h2>
<p ng-if="!isLoggedOut"><i class="icon ion-alert-circled padding"></i> {{ 'mm.login.reconnectdescription' | translate }}</p>
<div class="item item-text-wrap item-avatar-center item-borderless" ng-class="{'item-avatar-center': site.avatar, 'text-center': !site.avatar}">
<img ng-if="site.avatar" ng-src="{{site.avatar}}" class="avatar" mm-external-content siteid="site.id" alt="{{ 'mm.core.pictureof' | translate:{$a: site.fullname} }}" role="presentation">
<!-- Show site logo or a default image. -->
<img ng-if="!site.avatar && logourl" ng-src="{{logourl}}" class="avatar-full" mm-external-content role="presentation">
<img ng-if="!site.avatar && !logourl" ng-src="img/moodle.png" class="avatar-full moodle-logo" role="presentation">

<!-- If no sitename show big siteurl. -->
<p ng-if="!sitename" class="item-heading padding">{{siteurl}}</p>
<!-- If sitename, show big sitename and small siteurl. -->
<p ng-if="sitename" class="item-heading padding">{{sitename}}</p>
<p ng-if="sitename">{{siteurl}}</p>

<p class="padding-top" ng-if="!isLoggedOut"><i class="icon ion-alert-circled padding"></i> {{ 'mm.login.reconnectdescription' | translate }}</p>
</div>
<div class="list item padding">
<h2>{{ 'mm.login.username' | translate }}</h2>
Expand Down