Merge pull request #1561 from dpalou/MOBILE-2661

Mobile 2661
main
Juan Leyva 2018-10-08 15:43:27 +02:00 committed by GitHub
commit ff08501397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 9 deletions

View File

@ -69,7 +69,7 @@
<!-- Template to render a 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. -->
<ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name">
<core-format-text [text]="section.name"></core-format-text>
@ -82,7 +82,7 @@
</ion-item>
<ng-container *ngFor="let module of section.modules">
<core-course-module *ngIf="module.visibleoncoursepage !== 0" [module]="module" [courseId]="course.id" [downloadEnabled]="downloadEnabled" (completionChanged)="completionChanged.emit()"></core-course-module>
<core-course-module *ngIf="module.visibleoncoursepage !== 0" [module]="module" [courseId]="course.id" [downloadEnabled]="downloadEnabled" [section]="section" (completionChanged)="completionChanged.emit()"></core-course-module>
</ng-container>
</section>
</ng-template>

View File

@ -262,14 +262,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
let 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;
}
}
this.previousSection = j >= 1 ? this.sections[j] : null;
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;
}
}

View File

@ -30,11 +30,11 @@
</div>
</div>
</div>
<div *ngIf="module.visible === 0 || module.availabilityinfo || module.handlerData.extraBadge || module.isStealth || (module.completionstatus && module.completionstatus.offline)">
<div>
<ion-badge item-end *ngIf="module.handlerData.extraBadge" [color]="module.handlerData.extraBadgeColor" text-wrap text-start>
<core-format-text [text]="module.handlerData.extraBadge"></core-format-text>
</ion-badge>
<ion-badge item-end *ngIf="module.visible === 0" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge item-end *ngIf="module.visible === 0 && (!section || section.visible)" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge item-end *ngIf="module.visible !== 0 && module.isStealth" text-wrap>{{ 'core.course.hiddenoncoursepage' | translate }}</ion-badge>
<ion-badge item-end *ngIf="module.availabilityinfo" text-wrap><core-format-text [text]="module.availabilityinfo"></core-format-text></ion-badge>
<ion-badge item-end *ngIf="module.completionstatus && module.completionstatus.offline" color="warning" text-wrap>{{ 'core.course.manualcompletionnotsynced' | translate }}</ion-badge>

View File

@ -36,6 +36,7 @@ import { CoreConstants } from '../../../constants';
export class CoreCourseModuleComponent implements OnInit, OnDestroy {
@Input() module: any; // The module to render.
@Input() courseId: number; // The course the module belongs to.
@Input() section: any; // The section the module belongs to.
@Input('downloadEnabled') set enabled(value: boolean) {
this.downloadEnabled = value;

View File

@ -10,7 +10,7 @@
</ion-header>
<ion-content>
<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>
<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>

View File

@ -7,7 +7,7 @@
<core-format-text [text]="section.summary"></core-format-text>
</ion-item>
<core-course-module *ngFor="let module of section.modules" [module]="module" [courseId]="siteHomeId" [downloadEnabled]="true"></core-course-module>
<core-course-module *ngFor="let module of section.modules" [module]="module" [courseId]="siteHomeId" [downloadEnabled]="true" [section]="section"></core-course-module>
</ng-container>
<!-- Site home items: news, categories, courses, etc. -->
@ -29,7 +29,7 @@
<core-format-text [text]="block.summary"></core-format-text>
</ion-item>
<core-course-module *ngFor="let module of block.modules" [module]="module" [courseId]="siteHomeId" [downloadEnabled]="true"></core-course-module>
<core-course-module *ngFor="let module of block.modules" [module]="module" [courseId]="siteHomeId" [downloadEnabled]="true" [section]="block"></core-course-module>
</ng-container>
</ion-list>