MOBILE-2613 myoverview: Add All option to my overview
parent
ccb35ec784
commit
b015770835
|
@ -10,6 +10,7 @@
|
|||
"addon.badges.issuername": "badges",
|
||||
"addon.badges.nobadges": "badges",
|
||||
"addon.badges.recipientdetails": "badges",
|
||||
"addon.block_myoverview.all": "block_myoverview",
|
||||
"addon.block_myoverview.future": "block_myoverview",
|
||||
"addon.block_myoverview.inprogress": "block_myoverview",
|
||||
"addon.block_myoverview.morecourses": "block_myoverview",
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
<!-- "Time" selector. -->
|
||||
<div padding class="clearfix" [hidden]="showFilter" ion-row justify-content-end>
|
||||
<ion-select [hidden]="!showSelectorFilter" [title]="'core.show' | translate" [(ngModel)]="selectedFilter" ion-col (ngModelChange)="selectedChanged()" interface="popover" class="core-button-select">
|
||||
<ion-option value="inprogress">{{ 'addon.block_myoverview.inprogress' | translate }}</ion-option>
|
||||
<ion-option value="future">{{ 'addon.block_myoverview.future' | translate }}</ion-option>
|
||||
<ion-option value="past">{{ 'addon.block_myoverview.past' | translate }}</ion-option>
|
||||
<ion-option value="all">{{ 'addon.block_myoverview.all' | translate }}</ion-option>∫
|
||||
<ion-option value="inprogress" *ngIf="courses.inprogress.length > 0">{{ 'addon.block_myoverview.inprogress' | translate }}</ion-option>
|
||||
<ion-option value="future" *ngIf="courses.future.length > 0">{{ 'addon.block_myoverview.future' | translate }}</ion-option>
|
||||
<ion-option value="past" *ngIf="courses.past.length > 0">{{ 'addon.block_myoverview.past' | translate }}</ion-option>
|
||||
</ion-select>
|
||||
<!-- Download all courses. -->
|
||||
<div *ngIf="downloadAllCoursesEnabled && courses[selectedFilter] && courses[selectedFilter].length > 1" class="core-button-spinner" ion-col text-end col-1>
|
||||
|
@ -22,9 +23,11 @@
|
|||
<ion-spinner *ngIf="!prefetchCoursesData[selectedFilter].icon || prefetchCoursesData[selectedFilter].icon == 'spinner'"></ion-spinner>
|
||||
</div>
|
||||
</div>
|
||||
<core-empty-box *ngIf="courses[selectedFilter].length == 0 && selectedFilter == 'inprogress'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursesinprogress' | translate"></core-empty-box>
|
||||
<core-empty-box *ngIf="courses[selectedFilter].length == 0 && selectedFilter == 'future'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursesfuture' | translate"></core-empty-box>
|
||||
<core-empty-box *ngIf="courses[selectedFilter].length == 0 && selectedFilter == 'past'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursespast' | translate"></core-empty-box>
|
||||
<ng-container *ngIf="courses[selectedFilter].length == 0">
|
||||
<core-empty-box *ngIf="selectedFilter == 'inprogress'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursesinprogress' | translate"></core-empty-box>
|
||||
<core-empty-box *ngIf="selectedFilter == 'future'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursesfuture' | translate"></core-empty-box>
|
||||
<core-empty-box *ngIf="selectedFilter == 'past'" image="assets/img/icons/courses.svg" [message]="'addon.block_myoverview.nocoursespast' | translate"></core-empty-box>
|
||||
</ng-container>
|
||||
|
||||
<!-- Filter courses. -->
|
||||
<ion-searchbar #searchbar *ngIf="showFilter" [(ngModel)]="courses.filter" (ionInput)="filterChanged($event)" (ionCancel)="filterChanged()" [placeholder]="'core.courses.filtermycourses' | translate">
|
||||
|
|
|
@ -36,6 +36,7 @@ export class AddonBlockMyOverviewComponent extends AddonBlockComponent implement
|
|||
|
||||
courses = {
|
||||
filter: '',
|
||||
all: [],
|
||||
past: [],
|
||||
inprogress: [],
|
||||
future: []
|
||||
|
@ -44,6 +45,7 @@ export class AddonBlockMyOverviewComponent extends AddonBlockComponent implement
|
|||
downloadAllCoursesEnabled: boolean;
|
||||
filteredCourses: any[];
|
||||
prefetchCoursesData = {
|
||||
all: {},
|
||||
inprogress: {},
|
||||
past: {},
|
||||
future: {}
|
||||
|
@ -139,6 +141,7 @@ export class AddonBlockMyOverviewComponent extends AddonBlockComponent implement
|
|||
}).then((courses) => {
|
||||
const today = moment().unix();
|
||||
|
||||
this.courses.all = courses;
|
||||
this.courses.past = [];
|
||||
this.courses.inprogress = [];
|
||||
this.courses.future = [];
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"all": "All",
|
||||
"future": "Future",
|
||||
"inprogress": "In progress",
|
||||
"past": "Past",
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"addon.badges.issuername": "Issuer name",
|
||||
"addon.badges.nobadges": "There are no badges available.",
|
||||
"addon.badges.recipientdetails": "Recipient details",
|
||||
"addon.block_myoverview.all": "All",
|
||||
"addon.block_myoverview.future": "Future",
|
||||
"addon.block_myoverview.inprogress": "In progress",
|
||||
"addon.block_myoverview.morecourses": "More courses",
|
||||
|
|
|
@ -17,6 +17,7 @@ ion-app.app-root core-send-message-form {
|
|||
@include appearance(none);
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 28px;
|
||||
border: 0;
|
||||
font-family: inherit;
|
||||
align-self: self-start;
|
||||
|
|
Loading…
Reference in New Issue