|
24 | 24 |
|
25 | 25 | <!-- Course summary. By default we only display the course progress. --> |
26 | 26 | <core-dynamic-component [component]="courseSummaryComponent" [data]="data"> |
27 | | - <ion-list no-lines *ngIf="course.imageThumb || (selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0)" class="core-format-progress-list"> |
| 27 | + <ion-list no-lines *ngIf="course.imageThumb || (selectedSection && (selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0) || (selectedSection.id != allSectionsId && (selectedSection.availabilityinfo || selectedSection.visible === 0)))" class="core-format-progress-list"> |
28 | 28 | <div *ngIf="course.imageThumb" class="core-course-thumb"> |
29 | 29 | <img [src]="course.imageThumb" core-external-content alt=""/> |
30 | 30 | </div> |
31 | | - <ion-item class="core-course-progress" *ngIf="selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0 && course.completionusertracked !== false"> |
32 | | - <core-progress-bar [progress]="course.progress"></core-progress-bar> |
33 | | - </ion-item> |
| 31 | + <ng-container *ngIf="selectedSection"> |
| 32 | + <ion-item class="core-course-progress" *ngIf="selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0 && course.completionusertracked !== false"> |
| 33 | + <core-progress-bar [progress]="course.progress"></core-progress-bar> |
| 34 | + </ion-item> |
| 35 | + <ion-item *ngIf="selectedSection.id != allSectionsId && (selectedSection.availabilityinfo || selectedSection.visible === 0)" > |
| 36 | + <ion-badge color="secondary" *ngIf="selectedSection.visible === 0 && selectedSection.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge> |
| 37 | + <ion-badge color="secondary" *ngIf="selectedSection.visible === 0 && selectedSection.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge> |
| 38 | + <ion-badge color="secondary" *ngIf="selectedSection.availabilityinfo" text-wrap><core-format-text [text]=" selectedSection.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge> |
| 39 | + </ion-item> |
| 40 | + </ng-container> |
34 | 41 | </ion-list> |
35 | 42 | </core-dynamic-component> |
36 | 43 |
|
|
73 | 80 | <ng-template #sectionTemplate let-section="section"> |
74 | 81 | <section ion-list *ngIf="!section.hiddenbynumsections && section.id != allSectionsId && section.id != stealthModulesSectionId"> |
75 | 82 | <!-- Title is only displayed when viewing all sections. --> |
76 | | - <ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name" [class.core-section-download]="downloadEnabled"> |
| 83 | + <ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name" [class.core-section-download]="downloadEnabled" [class.item-dimmed]="section.visible === 0 || section.uservisible === false"> |
77 | 84 | <core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id"></core-format-text> |
78 | 85 | <!-- Section download. --> |
79 | 86 | <ng-container *ngTemplateOutlet="sectionDownloadTemplate; context: {section: section}"></ng-container> |
80 | | - <p *ngIf="(section.visible === 0 && section.uservisible !== false) || section.availabilityinfo"> |
| 87 | + <p *ngIf="section.visible === 0 || section.availabilityinfo"> |
81 | 88 | <ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge> |
| 89 | + <ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge> |
82 | 90 | <ion-badge color="secondary" *ngIf="section.availabilityinfo" text-wrap><core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge> |
83 | 91 | </p> |
84 | 92 | </ion-item-divider> |
|
0 commit comments