|
8 | 8 | <core-loading [hideUntil]="loaded"> |
9 | 9 |
|
10 | 10 | <!-- Single section. --> |
11 | | - <div *ngIf="selectedSection && selectedSection.id !== allSectionsId" class="single-section list-item-limited-width"> |
| 11 | + <div *ngIf="selectedSection && selectedSection.id !== allSectionsId" class="list-item-limited-width"> |
12 | 12 | <core-dynamic-component [component]="singleSectionComponent" [data]="data"> |
13 | | - <ion-accordion-group [readonly]="true" value="single"> |
14 | | - <ng-container *ngTemplateOutlet="sectionTemplate; context: {section: selectedSection, sectionId: 'single'}" /> |
| 13 | + <ion-accordion-group [multiple]="true" (ionChange)="accordionMultipleChange($event.detail)" |
| 14 | + [value]="accordionMultipleValue"> |
| 15 | + <core-course-section *ngIf="!selectedSection.hiddenbynumsections && selectedSection.id !== stealthModulesSectionId && |
| 16 | + !selectedSection.component" [course]="course" [section]="selectedSection" [lastModuleViewed]="lastModuleViewed" |
| 17 | + [viewedModules]="viewedModules" [collapsible]="false" [subSections]="subSections" /> |
15 | 18 | </ion-accordion-group> |
16 | 19 | <core-empty-box *ngIf="!selectedSection.hasContent" icon="fas-table-cells-large" |
17 | 20 | [message]="'core.course.nocontentavailable' | translate" /> |
18 | 21 | </core-dynamic-component> |
19 | 22 | </div> |
20 | 23 |
|
21 | 24 | <!-- Multiple sections. --> |
22 | | - <div *ngIf="selectedSection && selectedSection.id === allSectionsId" class="multiple-sections list-item-limited-width"> |
| 25 | + <div *ngIf="selectedSection && selectedSection.id === allSectionsId" class="list-item-limited-width"> |
23 | 26 | <core-dynamic-component [component]="allSectionsComponent" [data]="data"> |
24 | | - <ion-accordion-group [multiple]="true" (ionChange)="accordionMultipleChange($event.detail)" [value]="accordionMultipleValue" |
25 | | - #accordionMultiple> |
| 27 | + <ion-accordion-group [multiple]="true" (ionChange)="accordionMultipleChange($event.detail)" |
| 28 | + [value]="accordionMultipleValue"> |
26 | 29 | @for (section of sections; track section.id) { |
27 | | - @if ($index <= lastShownSectionIndex) { |
28 | | - <ng-container *ngTemplateOutlet="sectionTemplate; context: {section: section, sectionId: section.id}" /> |
| 30 | + @if ($index <= lastShownSectionIndex && !section.hiddenbynumsections && section.id !== allSectionsId && |
| 31 | + section.id !== stealthModulesSectionId && !section.component) { |
| 32 | + <core-course-section |
| 33 | + [course]="course" [section]="section" [lastModuleViewed]="lastModuleViewed" [viewedModules]="viewedModules" |
| 34 | + [collapsible]="true" [subSections]="subSections" /> |
29 | 35 | } |
30 | 36 | } |
31 | 37 | </ion-accordion-group> |
|
65 | 71 | <ion-icon name="fas-list-ul" aria-hidden="true" /> |
66 | 72 | </ion-fab-button> |
67 | 73 | </ion-fab> |
68 | | - |
69 | | -<!-- Template to render a section. --> |
70 | | -<ng-template #sectionTemplate let-section="section" let-sectionId="sectionId"> |
71 | | - <ion-accordion *ngIf="!section.hiddenbynumsections && section.id !== allSectionsId && section.id !== stealthModulesSectionId" |
72 | | - class="core-course-module-list-wrapper" [id]="section.id" |
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"> |
76 | | - <h2 *ngIf="section.name" class="big" [id]="'core-section-name-' + section.id"> |
77 | | - <core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id" /> |
78 | | - </h2> |
79 | | - <div *ngIf="section.visible === 0 && section.uservisible !== false"> |
80 | | - <ion-badge color="warning"> |
81 | | - {{ 'core.course.hiddenfromstudents' | translate }} |
82 | | - </ion-badge> |
83 | | - </div> |
84 | | - <div *ngIf="section.visible === 0 && section.uservisible === false"> |
85 | | - <ion-badge color="warning"> |
86 | | - {{ 'core.notavailable' | translate }} |
87 | | - </ion-badge> |
88 | | - </div> |
89 | | - <div *ngIf="section.availabilityinfo"> |
90 | | - <ion-chip class="clickable"> |
91 | | - <ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate" /> |
92 | | - <ion-label> |
93 | | - <core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="course.id" /> |
94 | | - </ion-label> |
95 | | - </ion-chip> |
96 | | - </div> |
97 | | - </ion-label> |
98 | | - <ion-badge *ngIf="section.highlighted && highlighted" slot="end">{{highlighted}}</ion-badge> |
99 | | - </ion-item> |
100 | | - |
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> |
119 | | -</ng-template> |
0 commit comments