MOBILE-4600 data: Add missing actions
parent
e40426d454
commit
671bb39807
|
@ -2549,6 +2549,7 @@
|
||||||
"core.storingfiles": "local_moodlemobileapp",
|
"core.storingfiles": "local_moodlemobileapp",
|
||||||
"core.strftimedate": "langconfig",
|
"core.strftimedate": "langconfig",
|
||||||
"core.strftimedatefullshort": "langconfig",
|
"core.strftimedatefullshort": "langconfig",
|
||||||
|
"core.strftimedatemonthabbr": "langconfig",
|
||||||
"core.strftimedateshort": "langconfig",
|
"core.strftimedateshort": "langconfig",
|
||||||
"core.strftimedatetime": "langconfig",
|
"core.strftimedatetime": "langconfig",
|
||||||
"core.strftimedatetimeshort": "langconfig",
|
"core.strftimedatetimeshort": "langconfig",
|
||||||
|
|
|
@ -34,8 +34,12 @@
|
||||||
<core-comments *ngIf="action === 'comments' && mode === 'list'" contextLevel="module" [instanceId]="database.coursemodule"
|
<core-comments *ngIf="action === 'comments' && mode === 'list'" contextLevel="module" [instanceId]="database.coursemodule"
|
||||||
component="mod_data" [itemId]="entry.id" area="database_entry" [courseId]="database.course" />
|
component="mod_data" [itemId]="entry.id" area="database_entry" [courseId]="database.course" />
|
||||||
|
|
||||||
<span *ngIf="action === 'timeadded'">{{ entry.timecreated * 1000 | coreFormatDate }}</span>
|
<span *ngIf="action === 'timeadded'" [title]="entry.timecreated * 1000 | coreFormatDate">
|
||||||
<span *ngIf="action === 'timemodified'">{{ entry.timemodified * 1000 | coreFormatDate }}</span>
|
{{ entry.timecreated * 1000 | coreFormatDate: 'strftimedatemonthabbr' }}
|
||||||
|
</span>
|
||||||
|
<span *ngIf="action === 'timemodified'" [title]="entry.timemodified * 1000 | coreFormatDate">
|
||||||
|
{{ entry.timemodified * 1000 | coreFormatDate: 'strftimedatemonthabbr' }}
|
||||||
|
</span>
|
||||||
|
|
||||||
<core-user-avatar *ngIf="action === 'userpicture'" [user]="entry" slot="start" [courseId]="database.course" [userId]="entry.userid"
|
<core-user-avatar *ngIf="action === 'userpicture'" [user]="entry" slot="start" [courseId]="database.course" [userId]="entry.userid"
|
||||||
[profileUrl]="userPicture" />
|
[profileUrl]="userPicture" />
|
||||||
|
|
|
@ -247,7 +247,7 @@ export class AddonModDataHelperProvider {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == AddonModDataAction.MOREURL) {
|
if (action === AddonModDataAction.MOREURL) {
|
||||||
// Render more url directly because it can be part of an HTML attribute.
|
// Render more url directly because it can be part of an HTML attribute.
|
||||||
template = template.replace(
|
template = template.replace(
|
||||||
replaceRegex,
|
replaceRegex,
|
||||||
|
@ -255,10 +255,26 @@ export class AddonModDataHelperProvider {
|
||||||
);
|
);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else if (action == 'approvalstatus') {
|
} else if (action === AddonModDataAction.APPROVALSTATUS) {
|
||||||
template = template.replace(
|
template = template.replace(
|
||||||
replaceRegex,
|
replaceRegex,
|
||||||
Translate.instant('addon.mod_data.' + (entry.approved ? 'approved' : 'notapproved')),
|
entry.approved
|
||||||
|
? ''
|
||||||
|
: `<ion-badge color="warning">${Translate.instant('addon.mod_data.notapproved')}</ion-badge>`,
|
||||||
|
);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
} else if (action === AddonModDataAction.APPROVALSTATUSCLASS) {
|
||||||
|
template = template.replace(
|
||||||
|
replaceRegex,
|
||||||
|
entry.approved ? 'approved' : 'notapproved',
|
||||||
|
);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
} else if (action === AddonModDataAction.ID) {
|
||||||
|
template = template.replace(
|
||||||
|
replaceRegex,
|
||||||
|
entry.id.toString(),
|
||||||
);
|
);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -460,6 +476,7 @@ export class AddonModDataHelperProvider {
|
||||||
timeadded: true,
|
timeadded: true,
|
||||||
timemodified: true,
|
timemodified: true,
|
||||||
tags: true,
|
tags: true,
|
||||||
|
id: true,
|
||||||
|
|
||||||
edit: entry.canmanageentry && !entry.deleted, // This already checks capabilities and readonly period.
|
edit: entry.canmanageentry && !entry.deleted, // This already checks capabilities and readonly period.
|
||||||
delete: entry.canmanageentry,
|
delete: entry.canmanageentry,
|
||||||
|
@ -467,6 +484,7 @@ export class AddonModDataHelperProvider {
|
||||||
disapprove: database.approval && accessInfo.canapprove && entry.approved && !entry.deleted,
|
disapprove: database.approval && accessInfo.canapprove && entry.approved && !entry.deleted,
|
||||||
|
|
||||||
approvalstatus: database.approval,
|
approvalstatus: database.approval,
|
||||||
|
approvalstatusclass: database.approval,
|
||||||
comments: database.comments,
|
comments: database.comments,
|
||||||
|
|
||||||
actionsmenu: entry.canmanageentry
|
actionsmenu: entry.canmanageentry
|
||||||
|
|
|
@ -61,9 +61,11 @@ export enum AddonModDataAction {
|
||||||
TIMEMODIFIED = 'timemodified',
|
TIMEMODIFIED = 'timemodified',
|
||||||
TAGS = 'tags',
|
TAGS = 'tags',
|
||||||
APPROVALSTATUS = 'approvalstatus',
|
APPROVALSTATUS = 'approvalstatus',
|
||||||
|
APPROVALSTATUSCLASS = 'approvalstatusclass',
|
||||||
DELCHECK = 'delcheck', // Unused.
|
DELCHECK = 'delcheck', // Unused.
|
||||||
EXPORT = 'export', // Unused.
|
EXPORT = 'export', // Unused.
|
||||||
ACTIONSMENU = 'actionsmenu',
|
ACTIONSMENU = 'actionsmenu',
|
||||||
|
ID = 'id',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AddonModDataTemplateType {
|
export enum AddonModDataTemplateType {
|
||||||
|
|
|
@ -312,6 +312,7 @@
|
||||||
"startingtime": "Starting time: {{$a}}",
|
"startingtime": "Starting time: {{$a}}",
|
||||||
"storingfiles": "Storing files",
|
"storingfiles": "Storing files",
|
||||||
"strftimedate": "%d %B %Y",
|
"strftimedate": "%d %B %Y",
|
||||||
|
"strftimedatemonthabbr": "%d %b %Y",
|
||||||
"strftimedatefullshort": "%d/%m/%y",
|
"strftimedatefullshort": "%d/%m/%y",
|
||||||
"strftimedateshort": "%d %B",
|
"strftimedateshort": "%d %B",
|
||||||
"strftimedatetime": "%d %B %Y, %I:%M %p",
|
"strftimedatetime": "%d %B %Y, %I:%M %p",
|
||||||
|
|
Loading…
Reference in New Issue