commit
e52318e5ef
|
@ -10,7 +10,7 @@
|
|||
</ion-header>
|
||||
<ion-content>
|
||||
<ng-container *ngFor="let section of sections">
|
||||
<a ion-item *ngIf="sectionHasContent(section)" 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.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>
|
||||
<h2><core-format-text [text]="section.formattedName || section.name"></core-format-text></h2>
|
||||
<ion-badge color="secondary" *ngIf="section.visible === 0">{{ 'core.course.nocontentavailable' | translate }}</ion-badge>
|
||||
<ion-badge color="secondary" *ngIf="section.availabilityinfo"><core-format-text [text]=" section.availabilityinfo"></core-format-text></ion-badge>
|
||||
|
|
|
@ -28,13 +28,10 @@ export class CoreCourseSectionSelectorPage {
|
|||
|
||||
sections: any;
|
||||
selected: number;
|
||||
sectionHasContent: any;
|
||||
|
||||
constructor(navParams: NavParams, courseHelper: CoreCourseHelperProvider, private viewCtrl: ViewController) {
|
||||
this.sections = navParams.get('sections');
|
||||
this.selected = navParams.get('selected');
|
||||
|
||||
this.sectionHasContent = courseHelper.sectionHasContent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -194,7 +194,8 @@ export class CoreCourseSectionPage implements OnDestroy {
|
|||
// Add a fake first section (all sections).
|
||||
this.sections.unshift({
|
||||
name: this.translate.instant('core.course.allsections'),
|
||||
id: CoreCourseProvider.ALL_SECTIONS_ID
|
||||
id: CoreCourseProvider.ALL_SECTIONS_ID,
|
||||
hasContent: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1168,7 +1168,7 @@ export class CoreCourseHelperProvider {
|
|||
* @return {boolean} Whether the section has content.
|
||||
*/
|
||||
sectionHasContent(section: any): boolean {
|
||||
if (section.id == CoreCourseProvider.ALL_SECTIONS_ID || section.hiddenbynumsections) {
|
||||
if (section.hiddenbynumsections) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue