MOBILE-2706 course: Remove course image from course section

main
Pau Ferrer Ocaña 2018-10-30 09:19:09 +01:00
parent f651dc983b
commit 9c9a31f6f7
6 changed files with 9 additions and 26 deletions

View File

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

View File

@ -241,19 +241,6 @@ 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;
} else if (this.coursesProvider.isGetCoursesByFieldAvailable()) {
promises.push(this.coursesProvider.getCoursesByField('id', this.course.id).then((coursesInfo) => {
if (coursesInfo[0] && coursesInfo[0].overviewfiles && coursesInfo[0].overviewfiles[0]) {
this.course.imageThumb = coursesInfo[0].overviewfiles[0].fileurl;
} else {
this.course.imageThumb = false;
}
}));
}
// Load the course handlers.
promises.push(this.courseOptionsDelegate.getHandlersToDisplay(this.injector, this.course, refresh, false)
.then((handlers) => {
@ -330,7 +317,6 @@ export class CoreCourseSectionPage implements OnDestroy {
promises.push(this.courseProvider.invalidateSections(this.course.id));
promises.push(this.coursesProvider.invalidateUserCourses());
promises.push(this.courseFormatDelegate.invalidateData(this.course, this.sections));
promises.push(this.coursesProvider.invalidateCoursesByField('id', this.course.id));
if (this.sections) {
promises.push(this.prefetchDelegate.invalidateCourseUpdates(this.course.id));

View File

@ -1,6 +1,6 @@
<ion-card [attr.course-color]="course.id % 10">
<div (click)="openCourse(course)" class="core-course-thumb" [class.core-course-color-img]="course.imageThumb">
<img *ngIf="course.imageThumb" [src]="course.imageThumb" core-external-content alt=""/>
<div (click)="openCourse(course)" class="core-course-thumb" [class.core-course-color-img]="course.courseImage">
<img *ngIf="course.courseImage" [src]="course.courseImage" core-external-content alt=""/>
<core-icon name="fa-star" *ngIf="course.isfavourite"></core-icon>
</div>
<ion-item tappable text-wrap detail-none (click)="openCourse(course)" [title]="course.displayname || course.fullname" class="core-course-link" [class.item-disabled]="course.visible == 0">

View File

@ -10,8 +10,8 @@
<core-loading [hideUntil]="dataLoaded">
<ion-list *ngIf="course">
<div *ngIf="course.imageThumb" (click)="openCourse()" class="core-course-thumb">
<img [src]="course.imageThumb" core-external-content alt=""/>
<div *ngIf="course.courseImage" (click)="openCourse()" class="core-course-thumb">
<img [src]="course.courseImage" core-external-content alt=""/>
</div>
<a ion-item text-wrap (click)="openCourse()" [title]="course.fullname" [attr.detail-none]=" avoidOpenCourse || !canAccessCourse">
<core-icon name="fa-graduation-cap" fixed-width item-start></core-icon>

View File

@ -101,7 +101,7 @@ export class CoreCoursesCoursePreviewPage implements OnDestroy {
this.courseUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.course.id);
this.paypalReturnUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'enrol/paypal/return.php');
if (this.course.overviewfiles && this.course.overviewfiles.length > 0) {
this.course.imageThumb = this.course.overviewfiles[0].fileurl;
this.course.courseImage = this.course.overviewfiles[0].fileurl;
}
// Initialize the self enrol modal.

View File

@ -36,13 +36,13 @@ export class CoreCoursesHelperProvider {
course.displayname = courseByField.displayname;
if (courseByField.overviewfiles && courseByField.overviewfiles[0]) {
course.imageThumb = courseByField.overviewfiles[0].fileurl;
course.courseImage = courseByField.overviewfiles[0].fileurl;
} else {
course.imageThumb = false;
course.courseImage = false;
}
} else {
delete course.displayname;
course.imageThumb = false;
course.courseImage = false;
}
}