MOBILE-2661 course: Display empty sections
parent
5a61613eec
commit
3e12557451
|
@ -69,7 +69,7 @@
|
||||||
|
|
||||||
<!-- Template to render a section. -->
|
<!-- Template to render a section. -->
|
||||||
<ng-template #sectionTemplate let-section="section">
|
<ng-template #sectionTemplate let-section="section">
|
||||||
<section ion-list *ngIf="section.hasContent && section.id != allSectionsId">
|
<section ion-list *ngIf="!section.hiddenbynumsections && section.id != allSectionsId">
|
||||||
<!-- Title is only displayed when viewing all sections. -->
|
<!-- Title is only displayed when viewing all sections. -->
|
||||||
<ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name">
|
<ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name">
|
||||||
<core-format-text [text]="section.name"></core-format-text>
|
<core-format-text [text]="section.name"></core-format-text>
|
||||||
|
|
|
@ -262,14 +262,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
|
|
||||||
let j;
|
let j;
|
||||||
for (j = i - 1; j >= 1; j--) {
|
for (j = i - 1; j >= 1; j--) {
|
||||||
if (this.sections[j].uservisible !== false && this.sections[j].hasContent) {
|
if (this.sections[j].uservisible !== false && !this.sections[j].hiddenbynumsections) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.previousSection = j >= 1 ? this.sections[j] : null;
|
this.previousSection = j >= 1 ? this.sections[j] : null;
|
||||||
|
|
||||||
for (j = i + 1; j < this.sections.length; j++) {
|
for (j = i + 1; j < this.sections.length; j++) {
|
||||||
if (this.sections[j].uservisible !== false && this.sections[j].hasContent) {
|
if (this.sections[j].uservisible !== false && !this.sections[j].hiddenbynumsections) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ng-container *ngFor="let section of sections">
|
<ng-container *ngFor="let section of sections">
|
||||||
<a ion-item *ngIf="section.hasContent" text-wrap (click)="selectSection(section)" [class.core-primary-item]="selected.id == section.id" [class.item-dimmed]="section.visible === 0 || section.uservisible === false" detail-none>
|
<a ion-item *ngIf="!section.hiddenbynumsections" text-wrap (click)="selectSection(section)" [class.core-primary-item]="selected.id == section.id" [class.item-dimmed]="section.visible === 0 || section.uservisible === false" detail-none>
|
||||||
<core-icon name="fa-folder" item-start></core-icon>
|
<core-icon name="fa-folder" item-start></core-icon>
|
||||||
<h2><core-format-text [text]="section.formattedName || section.name"></core-format-text></h2>
|
<h2><core-format-text [text]="section.formattedName || section.name"></core-format-text></h2>
|
||||||
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
|
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
|
||||||
|
|
Loading…
Reference in New Issue