MOBILE-4348 resource: Display afterlink on module info box

main
Pau Ferrer Ocaña 2023-10-06 16:27:20 +02:00
parent 13ddbfc4b9
commit 60dad4cc3e
3 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,10 @@
<!-- Activity info. -->
<core-course-module-info [module]="module" [courseId]="courseId" [description]="displayDescription && description"
[component]="component" [componentId]="componentId" (completionChanged)="onCompletionChange()">
<div class="addon-mod_resource-afterlink ion-text-wrap" *ngIf="module.afterlink" description>
<core-format-text [text]="module.afterlink" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text>
</div>
</core-course-module-info>
<ion-card class="core-warning-card" *ngIf="warning">

View File

@ -8,4 +8,8 @@
font-size: 24px;
}
}
.addon-mod_resource-afterlink {
font-size: var(--text-size);
}
}

View File

@ -112,6 +112,8 @@ export class AddonModResourceIndexComponent extends CoreCourseModuleMainResource
throw new CoreError(Translate.instant('core.filenotfound'));
}
this.module.afterlink = await AddonModResourceHelper.getAfterLinkDetails(this.module, this.courseId);
// Get the resource instance to get the latest name/description and to know if it's embedded.
const resource = await AddonModResource.getResourceData(this.courseId, this.module.id);
this.description = resource.intro || '';