Merge pull request #1506 from dpalou/MOBILE-2567

Mobile 2567
main
Juan Leyva 2018-09-07 15:52:34 +02:00 committed by GitHub
commit e24c3c7261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,6 @@
{ {
"errorwhileloadingthecontent": "Error while loading the content.", "errorwhileloadingthecontent": "Error while loading the content.",
"modifieddate": "Modified {{$a}}",
"openthefile": "Open the file", "openthefile": "Open the file",
"uploadeddate": "Uploaded {{$a}}" "uploadeddate": "Uploaded {{$a}}"
} }

View File

@ -156,16 +156,24 @@ export class AddonModResourceModuleHandler implements CoreCourseModuleHandler {
if (options.showtype) { if (options.showtype) {
extra.push(this.mimetypeUtils.getMimetypeDescription(file)); extra.push(this.mimetypeUtils.getMimetypeDescription(file));
} }
if (options.showdate) {
/* Modified date may be up to several minutes later than uploaded date just because
teacher did not submit the form promptly. Give teacher up to 5 minutes to do it. */
if (file.timemodified > file.timecreated + CoreConstants.SECONDS_MINUTE * 5) {
extra.push(this.translate.instant('addon.mod_resource.modifieddate',
{$a: moment(file.timemodified * 1000).format('LLL')}));
} else {
extra.push(this.translate.instant('addon.mod_resource.uploadeddate',
{$a: moment(file.timecreated * 1000).format('LLL')}));
}
}
} }
if (resourceData.icon == '') { if (resourceData.icon == '') {
resourceData.icon = this.courseProvider.getModuleIconSrc(this.modName); resourceData.icon = this.courseProvider.getModuleIconSrc(this.modName);
} }
if (options.showdate) {
extra.push(this.translate.instant('addon.mod_resource.uploadeddate',
{$a: moment(resourceInfo.timemodified * 1000).format('LLL')}));
}
resourceData.extra += extra.join(' '); resourceData.extra += extra.join(' ');
return resourceData; return resourceData;

View File

@ -176,6 +176,7 @@ export class AddonNotificationsListPage {
// Check if mark all notifications as read is enabled and there are some to read. // Check if mark all notifications as read is enabled and there are some to read.
if (this.notificationsProvider.isMarkAllNotificationsAsReadEnabled()) { if (this.notificationsProvider.isMarkAllNotificationsAsReadEnabled()) {
this.loadingMarkAllNotificationsAsRead = true; this.loadingMarkAllNotificationsAsRead = true;
return this.notificationsProvider.getUnreadNotificationsCount().then((unread) => { return this.notificationsProvider.getUnreadNotificationsCount().then((unread) => {
this.canMarkAllNotificationsAsRead = unread > 0; this.canMarkAllNotificationsAsRead = unread > 0;
this.loadingMarkAllNotificationsAsRead = false; this.loadingMarkAllNotificationsAsRead = false;