Skip to content

Commit 737e7f5

Browse files
committed
MOBILE-3557 course: Add section restriction info when selected section
1 parent 06c63eb commit 737e7f5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/core/course/components/format/core-course-format.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@
2424

2525
<!-- Course summary. By default we only display the course progress. -->
2626
<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">
2828
<div *ngIf="course.imageThumb" class="core-course-thumb">
2929
<img [src]="course.imageThumb" core-external-content alt=""/>
3030
</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>
3441
</ion-list>
3542
</core-dynamic-component>
3643

0 commit comments

Comments
 (0)