@@ -45,22 +45,21 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
4545 </ ion-card-header >
4646 </ ion-card >
4747
48- < ion-accordion-group [multiple] ="true " (ionChange) ="accordionGroupChange($event.detail) " [value] ="accordionMultipleValue ">
49- < ng-container *ngFor ="let section of sections ">
50- < ng-container *ngTemplateOutlet ="sectionCard; context: { section } " />
51- </ ng-container >
52- </ ion-accordion-group >
48+ < ng-container *ngFor ="let section of sections ">
49+ < ng-container *ngTemplateOutlet ="sectionCard; context: { section } " />
50+ </ ng-container >
5351
5452 </ core-loading >
5553</ ion-content >
5654
5755
5856< ng-template #sectionCard let-section ="section ">
5957 < ion-card class ="section " *ngIf ="section.contents.length > 0 " [id] ="'addons-course-storage-'+section.id ">
60- < ion-accordion [value] =" section.id " toggleIconSlot =" start ">
61- < ion-item [detail] ="false " slot =" header " class =" card-header " >
58+ < div class =" ion-activatable ripple-parent ">
59+ < ion-item [detail] ="false " class =" card- header " (click) =" toggleSection(section) " tappable >
6260 < ion-label >
63- < p class ="item-heading ion-text-wrap ">
61+ < p class ="item-heading ion-text-wrap " [attr.aria-expanded] ="section.expanded "
62+ (ariaButtonClick) ="toggleSection(section) ">
6463 < core-format-text [text] ="section.name " contextLevel ="course " [contextInstanceId] ="section.course "
6564 [adaptImg] ="false " />
6665 </ p >
@@ -78,8 +77,8 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
7877 [progress] ="section.total === undefined || section.total === 0 ? -1 : (section.count / section.total) * 100 " />
7978 </ p >
8079 </ ion-label >
81- < div class =" storage-buttons " slot =" end " *ngIf ="(!section.calculatingSize && section.totalSize > 0) || downloadEnabled ">
82- < div *ngIf ="downloadEnabled " slot =" end " class ="core-button-spinner ">
80+ < div slot =" end " class =" storage-buttons " *ngIf ="(!section.calculatingSize && section.totalSize > 0) || downloadEnabled ">
81+ < div *ngIf ="downloadEnabled " class ="core-button-spinner ">
8382 < core-download-refresh *ngIf ="!section.isDownloading && section.downloadStatus !== statusDownloaded "
8483 [status] ="section.downloadStatus " [enabled] ="true " (action) ="prefetchSection(section) "
8584 [loading] ="section.isDownloading || section.isCalculating " [canTrustDownload] ="true "
@@ -99,57 +98,62 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
9998 [attr.aria-label] ="'addon.storagemanager.deletedatafrom' | translate: { name: section.name } " />
10099 </ ion-button >
101100 </ div >
101+ @if (section.expanded) {
102+ < ion-icon slot ="start " size ="small " name ="fas-chevron-down " aria-hidden ="true " />
103+ } @else {
104+ < ion-icon slot ="start " size ="small " name ="fas-chevron-right " aria-hidden ="true " />
105+ }
102106 </ ion-item >
103- < ion-card-content slot ="content ">
104- < ng-container *ngIf ="section.expanded ">
105- < ng-container *ngFor ="let modOrSubsection of section.contents ">
106- @if (!isModule(modOrSubsection)) {
107- < ng-container *ngTemplateOutlet ="sectionCard; context: { section: modOrSubsection } " />
108- } @else {
109- < ion-item class ="core-course-storage-activity "
110- *ngIf ="downloadEnabled || (!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0) ">
111- < core-mod-icon slot ="start " *ngIf ="modOrSubsection.handlerData.icon "
112- [modicon] ="modOrSubsection.handlerData.icon " [modname] ="modOrSubsection.modname "
113- [componentId] ="modOrSubsection.instance " [fallbackTranslation] ="modOrSubsection.modplural "
114- [isBranded] ="modOrSubsection.branded " />
115- < ion-label class ="ion-text-wrap ">
116- < p class ="item-heading {{modOrSubsection.handlerData!.class}} addon-storagemanager-module-size ">
117- < core-format-text [text] ="modOrSubsection.handlerData.title " [courseId] ="modOrSubsection.course "
118- contextLevel ="module " [contextInstanceId] ="modOrSubsection.id " [adaptImg] ="false " />
119- </ p >
120- < ion-badge [color] ="modOrSubsection.downloadStatus === statusDownloaded ? 'success' : 'light' "
121- *ngIf ="!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0 ">
122- < ion-icon name ="fam-cloud-done " *ngIf ="modOrSubsection.downloadStatus === statusDownloaded "
123- [attr.aria-label] ="'core.downloaded' | translate " /> {{ modOrSubsection.totalSize |
124- coreBytesToSize }}
125- </ ion-badge >
126- < ion-badge color ="light " *ngIf ="modOrSubsection.calculatingSize ||
107+ < ion-ripple-effect />
108+ </ div >
109+ < ion-card-content >
110+ < ng-container *ngIf ="section.expanded ">
111+ < ng-container *ngFor ="let modOrSubsection of section.contents ">
112+ @if (!isModule(modOrSubsection)) {
113+ < ng-container *ngTemplateOutlet ="sectionCard; context: { section: modOrSubsection } " />
114+ } @else {
115+ < ion-item class ="core-course-storage-activity "
116+ *ngIf ="downloadEnabled || (!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0) ">
117+ < core-mod-icon slot ="start " *ngIf ="modOrSubsection.handlerData.icon " [modicon] ="modOrSubsection.handlerData.icon "
118+ [modname] ="modOrSubsection.modname " [componentId] ="modOrSubsection.instance "
119+ [fallbackTranslation] ="modOrSubsection.modplural " [isBranded] ="modOrSubsection.branded " />
120+ < ion-label class ="ion-text-wrap ">
121+ < p class ="item-heading {{modOrSubsection.handlerData!.class}} addon-storagemanager-module-size ">
122+ < core-format-text [text] ="modOrSubsection.handlerData.title " [courseId] ="modOrSubsection.course "
123+ contextLevel ="module " [contextInstanceId] ="modOrSubsection.id " [adaptImg] ="false " />
124+ </ p >
125+ < ion-badge [color] ="modOrSubsection.downloadStatus === statusDownloaded ? 'success' : 'light' "
126+ *ngIf ="!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0 ">
127+ < ion-icon name ="fam-cloud-done " *ngIf ="modOrSubsection.downloadStatus === statusDownloaded "
128+ [attr.aria-label] ="'core.downloaded' | translate " /> {{ modOrSubsection.totalSize |
129+ coreBytesToSize }}
130+ </ ion-badge >
131+ < ion-badge color ="light " *ngIf ="modOrSubsection.calculatingSize ||
127132 (section.isDownloading && modOrSubsection.downloadStatus === statusDownloaded) ">
128- {{ 'core.calculating' | translate }}
129- </ ion-badge >
130- </ ion-label >
133+ {{ 'core.calculating' | translate }}
134+ </ ion-badge >
135+ </ ion-label >
131136
132- < div class ="storage-buttons " slot ="end ">
133- < core-download-refresh *ngIf ="downloadEnabled && modOrSubsection.handlerData?.showDownloadButton &&
137+ < div class ="storage-buttons " slot ="end ">
138+ < core-download-refresh *ngIf ="downloadEnabled && modOrSubsection.handlerData?.showDownloadButton &&
134139 modOrSubsection.downloadStatus !== statusDownloaded " [status] ="modOrSubsection.downloadStatus " [enabled] ="true "
135- [canTrustDownload] ="true " [loading] ="modOrSubsection.spinner || modOrSubsection.handlerData.spinner "
136- (action) ="prefetchModule(modOrSubsection) "
137- [statusesTranslatable] ="{notdownloaded: 'addon.storagemanager.downloaddatafrom' } "
138- [statusSubject] ="modOrSubsection.name " />
139- < ion-button fill ="clear " (click) ="deleteForModule($event, modOrSubsection) "
140- *ngIf ="!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0 " color ="danger ">
141- < ion-icon name ="fas-trash " slot ="icon-only " [attr.aria-label] ="
140+ [canTrustDownload] ="true " [loading] ="modOrSubsection.spinner || modOrSubsection.handlerData.spinner "
141+ (action) ="prefetchModule(modOrSubsection) "
142+ [statusesTranslatable] ="{notdownloaded: 'addon.storagemanager.downloaddatafrom' } "
143+ [statusSubject] ="modOrSubsection.name " />
144+ < ion-button fill ="clear " (click) ="deleteForModule($event, modOrSubsection) "
145+ *ngIf ="!modOrSubsection.calculatingSize && modOrSubsection.totalSize > 0 " color ="danger ">
146+ < ion-icon name ="fas-trash " slot ="icon-only " [attr.aria-label] ="
142147 'addon.storagemanager.deletedatafrom' | translate: { name: modOrSubsection.name } " />
143- </ ion-button >
144- < p *ngIf ="!downloadEnabled || !modOrSubsection.handlerData?.showDownloadButton " class ="sr-only ">
145- {{ 'core.notdownloadable' | translate }}
146- </ p >
147- </ div >
148- </ ion-item >
149- }
150- </ ng-container >
148+ </ ion-button >
149+ < p *ngIf ="!downloadEnabled || !modOrSubsection.handlerData?.showDownloadButton " class ="sr-only ">
150+ {{ 'core.notdownloadable' | translate }}
151+ </ p >
152+ </ div >
153+ </ ion-item >
154+ }
151155 </ ng-container >
152- </ ion-card-content >
153- </ ion-accordion >
156+ </ ng-container >
157+ </ ion-card-content >
154158 </ ion-card >
155159</ ng-template >
0 commit comments