Skip to content

Commit

Permalink
MOBILE-4348 resource: Display afterlink on module info box
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Oct 9, 2023
1 parent 13ddbfc commit 60dad4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 4 additions & 0 deletions src/addons/mod/resource/components/index/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
font-size: 24px;
}
}

.addon-mod_resource-afterlink {
font-size: var(--text-size);
}
}
2 changes: 2 additions & 0 deletions src/addons/mod/resource/components/index/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '';
Expand Down

0 comments on commit 60dad4c

Please sign in to comment.