MOBILE-2559 course: Display right badges in stealth section & module

main
Dani Palou 2018-08-23 12:24:06 +02:00
parent 6379f4e9ac
commit a4c98b06b1
4 changed files with 7 additions and 2 deletions

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

@ -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);
}); });
}); });