MOBILE-2773 dashboard: Hide progress bar on small course cards

main
Pau Ferrer Ocaña 2018-12-07 13:49:50 +01:00
parent 4782e35fc2
commit bf87987b02
5 changed files with 9 additions and 4 deletions

View File

@ -47,7 +47,7 @@
<ion-grid no-padding>
<ion-row no-padding>
<ion-col *ngFor="let course of filteredCourses" no-padding col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 align-self-stretch>
<core-courses-course-progress [course]="course" class="core-courseoverview"></core-courses-course-progress>
<core-courses-course-progress [course]="course" class="core-courseoverview" showAll="true"></core-courses-course-progress>
</ion-col>
</ion-row>
</ion-grid>

View File

@ -16,4 +16,8 @@ ion-app.app-root core-block {
@include position(initial, initial, null, initial);
height: auto;
}
.item-divider .core-button-spinner {
margin: 0;
}
}

View File

@ -30,7 +30,7 @@
</button>
</div>
</ion-item>
<ion-item *ngIf="course.progress != null && course.progress >= 0">
<ion-item *ngIf="showAll && course.progress != null && course.progress >= 0">
<core-progress-bar [progress]="course.progress"></core-progress-bar>
</ion-item>
<ng-content></ng-content>

View File

@ -38,6 +38,7 @@ import { CoreCoursesCourseOptionsMenuComponent } from '../course-options-menu/co
})
export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy {
@Input() course: any; // The course to render.
@Input() showAll = false; // If true, will show all actions, options, star and progress.
isDownloading: boolean;
prefetchCourseData = {
@ -69,7 +70,7 @@ export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy {
}
// This field is only available from 3.6 onwards.
this.courseOptionMenuEnabled = typeof this.course.isfavourite != 'undefined';
this.courseOptionMenuEnabled = this.showAll && typeof this.course.isfavourite != 'undefined';
// Refresh the enabled flag if site is updated.
this.siteUpdatedObserver = this.eventsProvider.on(CoreEventsProvider.SITE_UPDATED, () => {

View File

@ -24,7 +24,7 @@
<ion-grid no-padding>
<ion-row no-padding>
<ion-col *ngFor="let course of filteredCourses" no-padding col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 align-self-stretch>
<core-courses-course-progress [course]="course" class="core-courseoverview"></core-courses-course-progress>
<core-courses-course-progress [course]="course" class="core-courseoverview" showAll="true"></core-courses-course-progress>
</ion-col>
</ion-row>
</ion-grid>