Merge pull request #1484 from dpalou/MOBILE-2559

Mobile 2559
main
Juan Leyva 2018-08-23 12:55:59 +01:00 committed by GitHub
commit ed9f66d3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 5 deletions

View File

@ -257,14 +257,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].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { if (this.sections[j].uservisible !== false && this.sections[j].hasContent) {
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].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { if (this.sections[j].uservisible !== false && this.sections[j].hasContent) {
break; break;
} }
} }

View File

@ -30,11 +30,12 @@
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="module.visible === 0 || module.availabilityinfo || module.handlerData.extraBadge"> <div *ngIf="module.visible === 0 || module.availabilityinfo || module.handlerData.extraBadge || module.isStealth">
<ion-badge item-end *ngIf="module.handlerData.extraBadge" [color]="module.handlerData.extraBadgeColor" text-wrap text-start> <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> <core-format-text [text]="module.handlerData.extraBadge"></core-format-text>
</ion-badge> </ion-badge>
<ion-badge item-end *ngIf="module.visible === 0">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge> <ion-badge item-end *ngIf="module.visible === 0">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge item-end *ngIf="module.visible !== 0 && module.isStealth">{{ 'core.course.hiddenoncoursepage' | translate }}</ion-badge>
<ion-badge item-end *ngIf="module.availabilityinfo"><core-format-text [text]="module.availabilityinfo"></core-format-text></ion-badge> <ion-badge item-end *ngIf="module.availabilityinfo"><core-format-text [text]="module.availabilityinfo"></core-format-text></ion-badge>
</div> </div>
<core-format-text class="core-module-description" *ngIf="module.description" maxHeight="80" [text]="module.description"></core-format-text> <core-format-text class="core-module-description" *ngIf="module.description" maxHeight="80" [text]="module.description"></core-format-text>

View File

@ -17,6 +17,7 @@
"errordownloadingsection": "Error downloading section.", "errordownloadingsection": "Error downloading section.",
"errorgetmodule": "Error getting activity data.", "errorgetmodule": "Error getting activity data.",
"hiddenfromstudents": "Hidden from students", "hiddenfromstudents": "Hidden from students",
"hiddenoncoursepage": "Available but not shown on course page",
"nocontentavailable": "No content available at the moment.", "nocontentavailable": "No content available at the moment.",
"overriddennotice": "Your final grade from this activity was manually adjusted.", "overriddennotice": "Your final grade from this activity was manually adjusted.",
"refreshcourse": "Refresh course", "refreshcourse": "Refresh course",

View File

@ -13,7 +13,7 @@
<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.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>
<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">{{ 'core.course.nocontentavailable' | translate }}</ion-badge> <ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge color="secondary" *ngIf="section.availabilityinfo"><core-format-text [text]=" section.availabilityinfo"></core-format-text></ion-badge> <ion-badge color="secondary" *ngIf="section.availabilityinfo"><core-format-text [text]=" section.availabilityinfo"></core-format-text></ion-badge>
</a> </a>
</ng-container> </ng-container>

View File

@ -47,7 +47,7 @@ export class CoreCourseSectionSelectorPage {
* @param {any} section Selected section object. * @param {any} section Selected section object.
*/ */
selectSection(section: any): void { selectSection(section: any): void {
if (!(section.visible === 0 || section.uservisible === false)) { if (section.uservisible !== false) {
this.viewCtrl.dismiss(section); this.viewCtrl.dismiss(section);
} }
} }

View File

@ -151,6 +151,9 @@ export class CoreCourseHelperProvider {
module.completionstatus = completionStatus[module.id]; module.completionstatus = completionStatus[module.id];
module.completionstatus.courseId = courseId; module.completionstatus.courseId = courseId;
} }
// Check if the module is stealth.
module.isStealth = !module.visibleoncoursepage || (module.visible && !section.visible);
}); });
}); });