commit
813f731fa9
|
@ -84,7 +84,7 @@
|
|||
</ion-badge>
|
||||
</div>
|
||||
<div *ngIf="section.availabilityinfo">
|
||||
<ion-chip>
|
||||
<ion-chip class="clickable">
|
||||
<ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate"></ion-icon>
|
||||
<ion-label>
|
||||
<core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="course.id">
|
||||
|
|
|
@ -704,6 +704,7 @@ export class CoreCourseProvider {
|
|||
course: courseId,
|
||||
section: sectionId,
|
||||
completiondata: completionData,
|
||||
availabilityinfo: this.treatAvailablityInfo(module.availabilityinfo),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -998,6 +999,7 @@ export class CoreCourseProvider {
|
|||
// Add course to all modules.
|
||||
return sections.map((section) => ({
|
||||
...section,
|
||||
availabilityinfo: this.treatAvailablityInfo(section.availabilityinfo),
|
||||
modules: section.modules.map((module) => this.addAdditionalModuleData(module, courseId, section.id)),
|
||||
}));
|
||||
}),
|
||||
|
@ -1555,6 +1557,21 @@ export class CoreCourseProvider {
|
|||
}, siteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Treat availability info HTML.
|
||||
*
|
||||
* @param availabilityInfo HTML to treat.
|
||||
* @returns Treated HTML.
|
||||
*/
|
||||
protected treatAvailablityInfo(availabilityInfo?: string): string | undefined {
|
||||
if (!availabilityInfo) {
|
||||
return availabilityInfo;
|
||||
}
|
||||
|
||||
// Remove "Show more" option in 4.2 or older sites.
|
||||
return CoreDomUtils.removeElementFromHtml(availabilityInfo, 'li[data-action="showmore"]');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const CoreCourse = makeSingleton(CoreCourseProvider);
|
||||
|
|
Loading…
Reference in New Issue