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
2 changes: 1 addition & 1 deletion www/addons/messages/templates/contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>{{ 'mma.messages.type_' + contactType | translate }}</h2>
</ion-item>

<a ng-repeat="contact in contacts[contactType] | orderBy:'fullname' track by $index" ng-if="contact.profileimageurl || contact.profileimageurlsmall" class="item item-avatar" mm-split-view-link="{{userStateName}}({userid: contact.id})" title="{{contact.fullname}}"> <!-- Don't show deleted users -->
<img ng-src="{{ contact.profileimageurl || contact.profileimageurlsmall }}" alt="" role="presentation" mm-external-content >
<img ng-src="{{ contact.profileimageurl || contact.profileimageurlsmall }}" alt="{{ 'mm.core.pictureof' | translate:{$a: contact.fullname} }}" role="presentation" mm-external-content >
<p class="item-heading">{{ contact.fullname }}</p>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions www/addons/messages/templates/discussions.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<li>
<a class="item item-avatar" ng-repeat="disc in discussions | orderBy:'message.timecreated':true track by $index" mm-split-view-link="site.messages-discussion({userId: disc.message.user, userFullname: disc.fullname})" title="{{disc.fullname}}">

<img ng-src="{{disc.profileimageurl}}" alt="" role="presentation" mm-external-content ng-if="disc.profileimageurl">
<img src="img/user-avatar.png" alt="" role="presentation" ng-if="!disc.profileimageurl">
<img ng-src="{{disc.profileimageurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: disc.fullname} }}" role="presentation" mm-external-content ng-if="disc.profileimageurl">
<img src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: disc.fullname} }}" role="presentation" ng-if="!disc.profileimageurl">

<span class="item-note" ng-if="disc.message.timecreated > 0">{{disc.message.timecreated | mmDateDayOrTime}}</span>
<p class="item-heading">{{disc.fullname}}</p>
Expand Down
2 changes: 1 addition & 1 deletion www/addons/mod_assign/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>{{ 'mma.mod_assign.cutoffdate' | translate }}</h2>
<div class="item item-divider" ng-if="$index > 0"></div>

<a class="item item-avatar" mm-user-link userid="{{submission.userid}}" courseid="{{courseid}}" title="{{submission.userfullname}}">
<img ng-src="{{submission.userprofileimageurl}}" mm-external-content alt="" role="presentation">
<img ng-src="{{submission.userprofileimageurl}}" mm-external-content alt="{{ 'mm.core.pictureof' | translate:{$a: submission.userfullname} }}" role="presentation">
<p>{{submission.userfullname}}</p>
<div class="item-note">{{submission.status}}</div>
<p>{{ submission.timemodified * 1000 | mmFormatDate:"dfmediumdate" }}</p>
Expand Down
4 changes: 2 additions & 2 deletions www/addons/mod_chat/templates/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
</p>

<article ng-if="!message.system && message.message.substr(0, 4) != 'beep'" class="item item-avatar item-text-wrap" href="#">
<img ng-if="message.userprofileimageurl" ng-src="{{message.userprofileimageurl}}" mm-external-content>
<img ng-if="!message.userprofileimageurl" src="img/user-avatar.png" alt="">
<img ng-if="message.userprofileimageurl" ng-src="{{message.userprofileimageurl}}" mm-external-content alt="{{ 'mm.core.pictureof' | translate:{$a: message.userfullname} }}" role="presentation">
<img ng-if="!message.userprofileimageurl" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: message.userfullname} }}" role="presentation">
<h2>{{ message.userfullname }}</h2>

<mm-format-text after-render="scrollAfterRender" watch="true">{{ message.message }}</mm-format-text>
Expand Down
2 changes: 1 addition & 1 deletion www/addons/mod_chat/templates/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1 class="title">{{ 'mma.mod_chat.currentusers' | translate }}</h1>
<ul class="list">
<li ng-repeat="user in chatUsers" class="card">
<div class="item item-avatar">
<img ng-src="{{user.profileimageurl}}" alt="" mm-external-content>
<img ng-src="{{user.profileimageurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: user.fullname} }}" mm-external-content>
<mm-format-text>{{user.fullname}}</mm-format-text>
</div>
<div class="item tabs tabs-secondary tabs-icon-left" ng-if="currentUserId != user.id && !isAppOffline()">
Expand Down
4 changes: 2 additions & 2 deletions www/addons/mod_forum/templates/discussionpost.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="item item-divider" ng-if="showdivider"></div>
<div class="item item-avatar">
<img ng-if="post.userpictureurl" ng-src="{{post.userpictureurl}}" mm-external-content mm-user-link courseid="{{courseid}}" userid="{{post.userid}}" alt="" role="presentation">
<img ng-if="!post.userpictureurl" src="img/user-avatar.png" alt="" role="presentation">
<img ng-if="post.userpictureurl" ng-src="{{post.userpictureurl}}" mm-external-content mm-user-link courseid="{{courseid}}" userid="{{post.userid}}" alt="{{ 'mm.core.pictureof' | translate:{$a: post.userfullname} }}" role="presentation">
<img ng-if="!post.userpictureurl" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: post.userfullname} }}" role="presentation">
<h2 ng-if="titleimportant">{{title}}</h2>
<p ng-if="!titleimportant">{{title}}</p>
<div class="item-note">{{post.modified | mmDateDayOrTime}}</div>
Expand Down
4 changes: 2 additions & 2 deletions www/addons/mod_forum/templates/discussions.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<a class="mma-forum-discussion-link" mm-split-view-link="site.mod_forum-discussion({cid: courseid, discussionid: discussion.discussion})">
<article>
<div class="item item-avatar item-text-wrap">
<img ng-if="discussion.userpictureurl" ng-src="{{discussion.userpictureurl}}" mm-external-content mm-split-view-link="{{userStateName}}({courseid: courseid, userid: discussion.userid})" alt="" role="presentation">
<img ng-if="!discussion.userpictureurl" src="img/user-avatar.png" alt="" role="presentation">
<img ng-if="discussion.userpictureurl" ng-src="{{discussion.userpictureurl}}" mm-external-content mm-split-view-link="{{userStateName}}({courseid: courseid, userid: discussion.userid})" alt="{{ 'mm.core.pictureof' | translate:{$a: discussion.userfullname} }}" role="presentation">
<img ng-if="!discussion.userpictureurl" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: discussion.userfullname} }}" role="presentation">
<h2><summary>{{discussion.subject}}</summary></h2>
<div class="item-note">{{discussion.created | mmDateDayOrTime}}</div>
<p>{{discussion.userfullname}}</p>
Expand Down
2 changes: 1 addition & 1 deletion www/addons/mod_glossary/templates/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="card list" ng-if="entry != false">
<a class="item item-avatar" ng-if="showAuthor" ui-sref="{{userStateName}}({courseid: courseid, userid: entry.userid})">
<img ng-src="{{entry.userpictureurl}}" alt="" mm-external-content role="presentation">
<img ng-src="{{entry.userpictureurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: entry.userfullname} }}" mm-external-content role="presentation">
<h2><mm-format-text watch="true">{{ entry.concept }}</mm-format-text></h2>
<p ng-if="showDate" class="item-note">{{ entry.timemodified | mmDateDayOrTime }}</p>
<p><mm-format-text watch="true" clean="true">{{ entry.userfullname }}</mm-format-text></p>
Expand Down
4 changes: 2 additions & 2 deletions www/addons/notes/templates/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<div class="list">
<article class="card" ng-repeat="note in notes">
<div class="item item-avatar">
<img ng-if="note.userprofileimageurl" ng-src="{{note.userprofileimageurl}}" mm-external-content mm-user-link courseid="{{courseid}}" userid="{{note.userid}}">
<img ng-if="!note.userprofileimageurl" src="img/user-avatar.png" alt="" role="presentation">
<img ng-if="note.userprofileimageurl" ng-src="{{note.userprofileimageurl}}" mm-external-content mm-user-link courseid="{{courseid}}" userid="{{note.userid}}" alt="{{ 'mm.core.pictureof' | translate:{$a: note.userfullname} }}" role="presentation">
<img ng-if="!note.userprofileimageurl" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: note.userfullname} }}" role="presentation">
<div class="item-note">{{note.lastmodified | mmDateDayOrTime}}</div>
<p>{{note.userfullname}}</p>
</div>
Expand Down
4 changes: 3 additions & 1 deletion www/addons/notifications/controllers/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ angular.module('mm.addons.notifications')
* @ngdoc controller
* @name mmaNotificationsListCtrl
*/
.controller('mmaNotificationsListCtrl', function($scope, $mmUtil, $mmaNotifications, mmaNotificationsListLimit) {
.controller('mmaNotificationsListCtrl', function($scope, $mmUtil, $mmaNotifications, mmaNotificationsListLimit,
mmUserProfileState) {

var readCount = 0,
unreadCount = 0;

$scope.notifications = [];
$scope.userStateName = mmUserProfileState;

// Convenience function to get notifications. Get unread notifications first.
function fetchNotifications(refresh) {
Expand Down
9 changes: 7 additions & 2 deletions www/addons/notifications/services/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ angular.module('mm.addons.notifications')
* @ngdoc service
* @name $mmaNotifications
*/
.factory('$mmaNotifications', function($q, $log, $mmSite, $mmSitesManager, mmaNotificationsListLimit) {
.factory('$mmaNotifications', function($q, $log, $mmSite, $mmSitesManager, $mmUser, mmaNotificationsListLimit) {

$log = $log.getInstance('$mmaNotifications');

Expand All @@ -42,6 +42,11 @@ angular.module('mm.addons.notifications')
if (cid && cid[1]) {
notification.courseid = cid[1];
}

// Try to get the profile picture of the user.
$mmUser.getProfile(notification.useridfrom, notification.courseid, true).then(function(user) {
notification.profileimageurlfrom = user.profileimageurl;
});
});
}

Expand All @@ -52,7 +57,7 @@ angular.module('mm.addons.notifications')
*/
function getNotificationsCacheKey() {
return 'mmaNotifications:list';
};
}

/**
* Get notifications from site.
Expand Down
4 changes: 3 additions & 1 deletion www/addons/notifications/templates/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
</ion-refresher>
<mm-loading hide-until="notificationsLoaded">
<article class="card" ng-repeat="notification in notifications track by $index">
<div class="item">
<div class="item item-avatar item-text-wrap">
<img ng-if="notification.profileimageurlfrom" ng-src="{{notification.profileimageurlfrom}}" mm-external-content ui-sref="{{userStateName}}({courseid: notification.courseid, userid: notification.useridfrom})" alt="{{ 'mm.core.pictureof' | translate:{$a: notification.userfromfullname} }}" role="presentation">
<img ng-if="!notification.profileimageurlfrom" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: notification.userfromfullname} }}" role="presentation">
<h2>{{notification.userfromfullname}}</h2>
<p>{{notification.timecreated | mmDateDayOrTime}}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion www/addons/participants/templates/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ul class="list" ng-if="participants && participants.length > 0">
<li ng-repeat="participant in participants">
<a class="item item-avatar" mm-split-view-link="{{userStateName}}({courseid: courseid, userid: participant.id})" title="{{participant.fullname}}">
<img ng-src="{{participant.profileimageurl}}" alt="" mm-external-content>
<img ng-src="{{participant.profileimageurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: participant.fullname} }}" mm-external-content>
<mm-format-text>{{participant.fullname}}</mm-format-text>
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion www/core/components/login/templates/sites.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ion-list ng-repeat="site in sites track by $index" show-delete='data.showDelete'>
<ion-item class="item item-thumbnail-left item-remove-animate" ng-click="login(site.id)">
<ion-delete-button class="ion-minus-circled" ng-click='onItemDelete($event, $index)'></ion-delete-button>
<img ng-src="{{site.avatar}}" mm-external-content siteid="site.id">
<img ng-src="{{site.avatar}}" mm-external-content siteid="site.id" alt="{{ 'mm.core.pictureof' | translate:{$a: site.fullname} }}" role="presentation">
<h2>{{site.fullname}}</h2>
<p><mm-format-text clean="true" watch="true">{{site.sitename}}</mm-format-text></p>
<p>{{site.siteurl}}</p>
Expand Down
2 changes: 1 addition & 1 deletion www/core/components/sidemenu/templates/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<header>
<div class="bar bar-header bar-side-menu">
<div class="item item-avatar">
<img ng-src="{{siteinfo.userpictureurl}}" alt="" mm-external-content>
<img ng-src="{{siteinfo.userpictureurl}}" alt="{{ 'mm.core.pictureof' | translate:{$a: siteinfo.fullname} }}" role="presentation" mm-external-content>
<h2>{{siteinfo.fullname}}</h2>
<p><mm-format-text watch="true">{{siteinfo.sitename}}</mm-format-text></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions www/core/components/user/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<mm-loading hide-until="userLoaded">
<div class="list" ng-if="user && !isDeleted">
<div class="item item-avatar">
<img ng-if="user.profileimageurl" ng-src="{{user.profileimageurl}}" mm-external-content alt="" role="presentation">
<img ng-if="!user.profileimageurl" src="img/user-avatar.png" alt="" role="presentation">
<img ng-if="user.profileimageurl" ng-src="{{user.profileimageurl}}" mm-external-content alt="{{ 'mm.core.pictureof' | translate:{$a: user.fullname} }}" role="presentation">
<img ng-if="!user.profileimageurl" src="img/user-avatar.png" alt="{{ 'mm.core.pictureof' | translate:{$a: user.fullname} }}" role="presentation">
<h2><mm-format-text watch="true" clean="true">{{user.fullname}}</mm-format-text></h2>
</div>
<div class="item item-divider" ng-if="hasContact">
Expand Down
1 change: 1 addition & 0 deletions www/core/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"openinbrowser": "Open in browser",
"percentagenumber": "{{$a}}%",
"phone": "Phone",
"pictureof": "Picture of {{$a}}",
"previous": "Previous",
"pulltorefresh": "Pull to refresh",
"refresh": "Refresh",
Expand Down