@@ -16,7 +16,6 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
1616 </ ion-label >
1717 </ ion-item >
1818
19-
2019 < ion-card class ="wholecourse ">
2120 < ion-card-header >
2221 < ion-card-title >
@@ -57,7 +56,7 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
5756
5857
5958< ng-template #sectionCard let-section ="section ">
60- < ion-card class ="section " *ngIf ="section.modules .length > 0 " [id] ="'addons-course-storage-'+section.id ">
59+ < ion-card class ="section " *ngIf ="section.contents .length > 0 " [id] ="'addons-course-storage-'+section.id ">
6160 < ion-accordion [value] ="section.id " toggleIconSlot ="start ">
6261 < ion-item [detail] ="false " slot ="header " class ="card-header ">
6362 < ion-label >
@@ -102,45 +101,46 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
102101 </ ion-item >
103102 < ion-card-content slot ="content ">
104103 < ng-container *ngIf ="section.expanded ">
105- < ng-container *ngFor ="let module of section.modules ">
106- @if (module.subSection ) {
107- < ng-container *ngTemplateOutlet ="sectionCard; context: { section: module.subSection } " />
104+ < ng-container *ngFor ="let modOrSubsection of section.contents ">
105+ @if (!isModule(modOrSubsection) ) {
106+ < ng-container *ngTemplateOutlet ="sectionCard; context: { section: modOrSubsection } " />
108107 } @else {
109108 < ion-item class ="core-course-storage-activity "
110- *ngIf ="downloadEnabled || (!module.calculatingSize && module.totalSize > 0) ">
111- < core-mod-icon slot ="start " *ngIf ="module.handlerData.icon " [modicon] ="module.handlerData.icon "
112- [modname] ="module.modname " [componentId] ="module.instance " [fallbackTranslation] ="module.modplural "
113- [isBranded] ="module.branded " />
109+ *ngIf ="downloadEnabled || (!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0) ">
110+ < core-mod-icon slot ="start " *ngIf ="modOrSubsection.handlerData.icon "
111+ [modicon] ="modOrSubsection.handlerData.icon " [modname] ="modOrSubsection.modname "
112+ [componentId] ="modOrSubsection.instance " [fallbackTranslation] ="modOrSubsection.modplural "
113+ [isBranded] ="modOrSubsection.branded " />
114114 < ion-label class ="ion-text-wrap ">
115- < p class ="item-heading {{module .handlerData!.class}} addon-storagemanager-module-size ">
116- < core-format-text [text] ="module .handlerData.title " [courseId] ="module .course" contextLevel =" module "
117- [contextInstanceId] ="module .id " [adaptImg] ="false " />
115+ < p class ="item-heading {{modOrSubsection .handlerData!.class}} addon-storagemanager-module-size ">
116+ < core-format-text [text] ="modOrSubsection .handlerData.title " [courseId] ="modOrSubsection .course "
117+ contextLevel =" module " [contextInstanceId] ="modOrSubsection .id " [adaptImg] ="false " />
118118 </ p >
119- < ion-badge [color] ="module .downloadStatus === statusDownloaded ? 'success' : 'light' "
120- *ngIf ="!module .calculatingSize && module .totalSize > 0 ">
121- < ion-icon name ="fam-cloud-done " *ngIf ="module .downloadStatus === statusDownloaded "
122- [attr.aria-label] ="'core.downloaded' | translate " /> {{ module .totalSize |
119+ < ion-badge [color] ="modOrSubsection .downloadStatus === statusDownloaded ? 'success' : 'light' "
120+ *ngIf ="!modOrSubsection .calculatingSize && modOrSubsection .totalSize > 0 ">
121+ < ion-icon name ="fam-cloud-done " *ngIf ="modOrSubsection .downloadStatus === statusDownloaded "
122+ [attr.aria-label] ="'core.downloaded' | translate " /> {{ modOrSubsection .totalSize |
123123 coreBytesToSize }}
124124 </ ion-badge >
125- < ion-badge color ="light " *ngIf ="module .calculatingSize ||
126- (section.isDownloading && module .downloadStatus === statusDownloaded) ">
125+ < ion-badge color ="light " *ngIf ="modOrSubsection .calculatingSize ||
126+ (section.isDownloading && modOrSubsection .downloadStatus === statusDownloaded) ">
127127 {{ 'core.calculating' | translate }}
128128 </ ion-badge >
129129 </ ion-label >
130130
131131 < div class ="storage-buttons " slot ="end ">
132- < core-download-refresh *ngIf ="downloadEnabled && module .handlerData?.showDownloadButton &&
133- module .downloadStatus !== statusDownloaded " [status] ="module .downloadStatus " [enabled] ="true "
134- [canTrustDownload] ="true " [loading] ="module .spinner || module .handlerData.spinner "
135- (action) ="prefetchModule(module ) "
132+ < core-download-refresh *ngIf ="downloadEnabled && modOrSubsection .handlerData?.showDownloadButton &&
133+ modOrSubsection .downloadStatus !== statusDownloaded " [status] ="modOrSubsection .downloadStatus " [enabled] ="true "
134+ [canTrustDownload] ="true " [loading] ="modOrSubsection .spinner || modOrSubsection .handlerData.spinner "
135+ (action) ="prefetchModule(modOrSubsection ) "
136136 [statusesTranslatable] ="{notdownloaded: 'addon.storagemanager.downloaddatafrom' } "
137- [statusSubject] ="module .name " />
138- < ion-button fill ="clear " (click) ="deleteForModule($event, module ) "
139- *ngIf ="!module .calculatingSize && module .totalSize > 0 " color ="danger ">
137+ [statusSubject] ="modOrSubsection .name " />
138+ < ion-button fill ="clear " (click) ="deleteForModule($event, modOrSubsection ) "
139+ *ngIf ="!modOrSubsection .calculatingSize && modOrSubsection .totalSize > 0 " color ="danger ">
140140 < ion-icon name ="fas-trash " slot ="icon-only " [attr.aria-label] ="
141- 'addon.storagemanager.deletedatafrom' | translate: { name: module .name } " />
141+ 'addon.storagemanager.deletedatafrom' | translate: { name: modOrSubsection .name } " />
142142 </ ion-button >
143- < p *ngIf ="!downloadEnabled || !module .handlerData?.showDownloadButton " class ="sr-only ">
143+ < p *ngIf ="!downloadEnabled || !modOrSubsection .handlerData?.showDownloadButton " class ="sr-only ">
144144 {{ 'core.notdownloadable' | translate }}
145145 </ p >
146146 </ div >
0 commit comments