MOBILE-3557 course: Show Not available message on section title visible

main
Pau Ferrer Ocaña 2020-09-22 11:26:18 +02:00
parent d332c7e1d4
commit 06c63eb77e
5 changed files with 7 additions and 2 deletions

View File

@ -1906,6 +1906,7 @@
"core.noresults": "moodle",
"core.noselection": "form",
"core.notapplicable": "local_moodlemobileapp",
"core.notavailable": "moodle",
"core.notenrolledprofile": "moodle",
"core.notice": "moodle",
"core.notingroup": "moodle",

View File

@ -1906,6 +1906,7 @@
"core.noresults": "No results",
"core.noselection": "No selection",
"core.notapplicable": "n/a",
"core.notavailable": "Not available",
"core.notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
"core.notice": "Notice",
"core.notingroup": "Sorry, but you need to be part of a group to see this page.",

View File

@ -73,12 +73,13 @@
<ng-template #sectionTemplate let-section="section">
<section ion-list *ngIf="!section.hiddenbynumsections && section.id != allSectionsId && section.id != stealthModulesSectionId">
<!-- Title is only displayed when viewing all sections. -->
<ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name" [class.core-section-download]="downloadEnabled">
<ion-item-divider text-wrap color="light" *ngIf="selectedSection.id == allSectionsId && section.name" [class.core-section-download]="downloadEnabled" [class.item-dimmed]="section.visible === 0 || section.uservisible === false">
<core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id"></core-format-text>
<!-- Section download. -->
<ng-container *ngTemplateOutlet="sectionDownloadTemplate; context: {section: section}"></ng-container>
<p *ngIf="(section.visible === 0 && section.uservisible !== false) || section.availabilityinfo">
<p *ngIf="section.visible === 0 || section.availabilityinfo">
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge>
<ion-badge color="secondary" *ngIf="section.availabilityinfo" text-wrap><core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge>
</p>
</ion-item-divider>

View File

@ -16,6 +16,7 @@
<h2><core-format-text [text]="section.formattedName || section.name" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></h2>
<core-progress-bar *ngIf="section.progress >= 0" [progress]="section.progress"></core-progress-bar>
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge>
<ion-badge color="secondary" *ngIf="section.availabilityinfo" text-wrap><core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge>
</a>
</ng-container>

View File

@ -189,6 +189,7 @@
"noresults": "No results",
"noselection": "No selection",
"notapplicable": "n/a",
"notavailable": "Not available",
"notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
"notice": "Notice",
"nooptionavailable": "No option available",