88 < core-loading [hideUntil] ="loaded ">
99
1010 <!-- Single section. -->
11- < div *ngIf ="selectedSection && selectedSection.id !== allSectionsId ">
11+ < div *ngIf ="selectedSection && selectedSection.id !== allSectionsId " class =" single-section list-item-limited-width " >
1212 < core-dynamic-component [component] ="singleSectionComponent " [data] ="data ">
13- < ng-container *ngTemplateOutlet ="sectionTemplate; context: {section: selectedSection} " />
13+ < ion-accordion-group [readonly] ="true " value ="single ">
14+ < ng-container *ngTemplateOutlet ="sectionTemplate; context: {section: selectedSection, sectionId: 'single'} " />
15+ </ ion-accordion-group >
1416 < core-empty-box *ngIf ="!selectedSection.hasContent " icon ="fas-table-cells-large "
1517 [message] ="'core.course.nocontentavailable' | translate " />
1618 </ core-dynamic-component >
1719 </ div >
1820
1921 <!-- Multiple sections. -->
20- < div *ngIf ="selectedSection && selectedSection.id === allSectionsId ">
22+ < div *ngIf ="selectedSection && selectedSection.id === allSectionsId " class =" multiple-sections list-item-limited-width " >
2123 < core-dynamic-component [component] ="allSectionsComponent " [data] ="data ">
22- < ng-container *ngFor ="let section of sections; index as i ">
23- < ng-container *ngIf ="i <= lastShownSectionIndex ">
24- < ng-container *ngTemplateOutlet ="sectionTemplate; context: {section: section} " />
25- </ ng-container >
26- </ ng-container >
24+ < ion-accordion-group [multiple] ="true " (ionChange) ="accordionMultipleChange($event.detail) " [value] ="accordionMultipleValue "
25+ #accordionMultiple >
26+ @for (section of sections; track section.id) {
27+ @if ($index < = lastShownSectionIndex) {
28+ < ng-container *ngTemplateOutlet ="sectionTemplate; context: {section: section, sectionId: section.id} " />
29+ }
30+ }
31+ </ ion-accordion-group >
2732 </ core-dynamic-component >
2833
2934 < core-infinite-loading [enabled] ="canLoadMore " (action) ="showMoreActivities($event) " />
6267</ ion-fab >
6368
6469<!-- Template to render a section. -->
65- < ng-template #sectionTemplate let-section ="section ">
66- < section *ngIf ="!section.hiddenbynumsections && section.id !== allSectionsId && section.id !== stealthModulesSectionId "
70+ < ng-template #sectionTemplate let-section ="section " let-sectionId =" sectionId " >
71+ < ion-accordion *ngIf ="!section.hiddenbynumsections && section.id !== allSectionsId && section.id !== stealthModulesSectionId "
6772 class ="core-course-module-list-wrapper " [id] ="section.id "
68- [attr.aria-labelledby] ="section.name ? 'core-section-name-' + section.id : null ">
69- < ion-item-divider class ="course-section ion-text-wrap " [class.item-dimmed] ="section.visible === 0 || section.uservisible === false ">
70- < ion-label >
73+ [attr.aria-labelledby] ="section.name ? 'core-section-name-' + section.id : null " [value] =" ''+sectionId " toggleIconSlot =" start " >
74+ < ion-item class ="course-section divider " [class.item-dimmed] ="section.visible === 0 || section.uservisible === false " slot =" header ">
75+ < ion-label class =" ion-text-wrap " >
7176 < h2 *ngIf ="section.name " class ="big " [id] ="'core-section-name-' + section.id ">
7277 < core-format-text [text] ="section.name " contextLevel ="course " [contextInstanceId] ="course.id " />
7378 </ h2 >
@@ -91,19 +96,24 @@ <h2 *ngIf="section.name" class="big" [id]="'core-section-name-' + section.id">
9196 </ div >
9297 </ ion-label >
9398 < ion-badge *ngIf ="section.highlighted && highlighted " slot ="end "> {{highlighted}}</ ion-badge >
94- </ ion-item-divider >
95-
96- < ion-item class ="ion-text-wrap section-summary " *ngIf ="section.summary ">
97- < ion-label >
98- < core-format-text [text] ="section.summary " contextLevel ="course " [contextInstanceId] ="course.id " />
99- </ ion-label >
10099 </ ion-item >
101100
102- < ng-container *ngFor ="let module of section.modules ">
103- < core-course-module *ngIf ="module.visibleoncoursepage !== 0 " [module] ="module " [section] ="section "
104- [showActivityDates] ="course.showactivitydates " [showCompletionConditions] ="course.showcompletionconditions "
105- [isLastViewed] ="lastModuleViewed && lastModuleViewed.cmId === module.id " [class.core-course-module-not-viewed] ="
106- !viewedModules[module.id] && (!module.completiondata || module.completiondata.state === completionStatusIncomplete) " />
107- </ ng-container >
108- </ section >
101+ < div slot ="content ">
102+ < ng-container *ngIf ="section.expanded ">
103+ < ion-item class ="ion-text-wrap section-summary " *ngIf ="section.summary ">
104+ < ion-label >
105+ < core-format-text [text] ="section.summary " contextLevel ="course " [contextInstanceId] ="course.id " />
106+ </ ion-label >
107+ </ ion-item >
108+
109+ < ng-container *ngFor ="let module of section.modules ">
110+ < core-course-module *ngIf ="module.visibleoncoursepage !== 0 " [module] ="module " [section] ="section "
111+ [showActivityDates] ="course.showactivitydates " [showCompletionConditions] ="course.showcompletionconditions "
112+ [isLastViewed] ="lastModuleViewed && lastModuleViewed.cmId === module.id "
113+ [class.core-course-module-not-viewed] ="
114+ !viewedModules[module.id] && (!module.completiondata || module.completiondata.state === completionStatusIncomplete) " />
115+ </ ng-container >
116+ </ ng-container >
117+ </ div >
118+ </ ion-accordion >
109119</ ng-template >
0 commit comments