Skip to content

Commit 0eccc7a

Browse files
authored
Merge pull request #2550 from crazyserver/MOBILE-3557
Mobile 3557
2 parents e72e2ae + 737e7f5 commit 0eccc7a

File tree

7 files changed

+20
-8
lines changed

7 files changed

+20
-8
lines changed

scripts/langindex.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,6 +1910,7 @@
19101910
"core.noresults": "moodle",
19111911
"core.noselection": "form",
19121912
"core.notapplicable": "local_moodlemobileapp",
1913+
"core.notavailable": "moodle",
19131914
"core.notenrolledprofile": "moodle",
19141915
"core.notice": "moodle",
19151916
"core.notingroup": "moodle",

src/assets/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,7 @@
19111911
"core.noresults": "No results",
19121912
"core.noselection": "No selection",
19131913
"core.notapplicable": "n/a",
1914+
"core.notavailable": "Not available",
19141915
"core.notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
19151916
"core.notice": "Notice",
19161917
"core.notingroup": "Sorry, but you need to be part of a group to see this page.",

src/core/course/components/format/core-course-format.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@
2424

2525
<!-- Course summary. By default we only display the course progress. -->
2626
<core-dynamic-component [component]="courseSummaryComponent" [data]="data">
27-
<ion-list no-lines *ngIf="course.imageThumb || (selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0)" class="core-format-progress-list">
27+
<ion-list no-lines *ngIf="course.imageThumb || (selectedSection && (selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0) || (selectedSection.id != allSectionsId && (selectedSection.availabilityinfo || selectedSection.visible === 0)))" class="core-format-progress-list">
2828
<div *ngIf="course.imageThumb" class="core-course-thumb">
2929
<img [src]="course.imageThumb" core-external-content alt=""/>
3030
</div>
31-
<ion-item class="core-course-progress" *ngIf="selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0 && course.completionusertracked !== false">
32-
<core-progress-bar [progress]="course.progress"></core-progress-bar>
33-
</ion-item>
31+
<ng-container *ngIf="selectedSection">
32+
<ion-item class="core-course-progress" *ngIf="selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0 && course.completionusertracked !== false">
33+
<core-progress-bar [progress]="course.progress"></core-progress-bar>
34+
</ion-item>
35+
<ion-item *ngIf="selectedSection.id != allSectionsId && (selectedSection.availabilityinfo || selectedSection.visible === 0)" >
36+
<ion-badge color="secondary" *ngIf="selectedSection.visible === 0 && selectedSection.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
37+
<ion-badge color="secondary" *ngIf="selectedSection.visible === 0 && selectedSection.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge>
38+
<ion-badge color="secondary" *ngIf="selectedSection.availabilityinfo" text-wrap><core-format-text [text]=" selectedSection.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge>
39+
</ion-item>
40+
</ng-container>
3441
</ion-list>
3542
</core-dynamic-component>
3643

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

src/core/course/pages/section-selector/section-selector.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<h2><core-format-text [text]="section.formattedName || section.name" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></h2>
1717
<core-progress-bar *ngIf="section.progress >= 0" [progress]="section.progress"></core-progress-bar>
1818
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false" text-wrap>{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
19+
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible === false" text-wrap>{{ 'core.notavailable' | translate }}</ion-badge>
1920
<ion-badge color="secondary" *ngIf="section.availabilityinfo" text-wrap><core-format-text [text]=" section.availabilityinfo" contextLevel="course" [contextInstanceId]="courseId"></core-format-text></ion-badge>
2021
</a>
2122
</ng-container>

src/core/emulator/providers/local-notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import * as moment from 'moment';
2424
import { Subject, Observable } from 'rxjs';
2525

2626
/**
27-
* Emulates the Cordova Globalization plugin in desktop apps and in browser.
27+
* Emulates the Local Notifications plugin in desktop apps and in browser.
2828
*/
2929
@Injectable()
3030
export class LocalNotificationsMock extends LocalNotifications {

src/core/emulator/providers/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Network } from '@ionic-native/network';
1717
import { Observable, Subject } from 'rxjs';
1818

1919
/**
20-
* Emulates the Cordova Globalization plugin in desktop apps and in browser.
20+
* Emulates the Ionic Network plugin in desktop apps and in browser.
2121
*/
2222
@Injectable()
2323
export class NetworkMock extends Network {

src/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"noresults": "No results",
194194
"noselection": "No selection",
195195
"notapplicable": "n/a",
196+
"notavailable": "Not available",
196197
"notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
197198
"notice": "Notice",
198199
"nooptionavailable": "No option available",

0 commit comments

Comments
 (0)