MOBILE-2795 course: Load course image from course section without showing it

This commit is contained in:
Pau Ferrer Ocaña 2019-01-10 08:59:40 +01:00
parent 167d544949
commit 51b2c94cde
3 changed files with 11 additions and 2 deletions

View File

@ -23,8 +23,11 @@
<!-- Course summary. By default we only display the course progress. --> <!-- Course summary. By default we only display the course progress. -->
<core-dynamic-component [component]="courseSummaryComponent" [data]="data"> <core-dynamic-component [component]="courseSummaryComponent" [data]="data">
<ion-list no-lines *ngIf="selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0" class="core-format-progress-list"> <ion-list no-lines *ngIf="course.imageThumb || (selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0)" class="core-format-progress-list">
<ion-item class="core-course-progress"> <div *ngIf="course.imageThumb" class="core-course-thumb">
<img [src]="course.imageThumb" core-external-content alt=""/>
</div>
<ion-item class="core-course-progress" *ngIf="selectedSection && selectedSection.id == allSectionsId && course.progress != null && course.progress >= 0">
<core-progress-bar [progress]="course.progress"></core-progress-bar> <core-progress-bar [progress]="course.progress"></core-progress-bar>
</ion-item> </ion-item>
</ion-list> </ion-list>

View File

@ -34,6 +34,7 @@ ion-app.app-root core-course-format {
} }
.core-course-thumb { .core-course-thumb {
display: none;
height: 150px; height: 150px;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;

View File

@ -265,6 +265,11 @@ export class CoreCourseSectionPage implements OnDestroy {
}); });
})); }));
// Get the overview files.
if (this.course.overviewfiles) {
this.course.imageThumb = this.course.overviewfiles[0] && this.course.overviewfiles[0].fileurl;
}
// Load the course handlers. // Load the course handlers.
promises.push(this.courseOptionsDelegate.getHandlersToDisplay(this.injector, this.course, refresh, false) promises.push(this.courseOptionsDelegate.getHandlersToDisplay(this.injector, this.course, refresh, false)
.then((handlers) => { .then((handlers) => {