Merge pull request #1588 from crazyserver/MOBILE-2706
MOBILE-2706 course: Remove course image from course sectionmain
commit
53b0473af0
|
@ -9,10 +9,7 @@
|
||||||
<core-dynamic-component [component]="courseFormatComponent" [data]="data">
|
<core-dynamic-component [component]="courseFormatComponent" [data]="data">
|
||||||
<!-- 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="course.imageThumb || (course.progress != null && course.progress >= 0)" class="core-format-progress-list">
|
<ion-list no-lines *ngIf="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-item *ngIf="course.progress != null && course.progress >= 0" class="core-course-progress">
|
<ion-item *ngIf="course.progress != null && course.progress >= 0" class="core-course-progress">
|
||||||
<core-progress-bar [progress]="course.progress"></core-progress-bar>
|
<core-progress-bar [progress]="course.progress"></core-progress-bar>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
|
@ -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.
|
// 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) => {
|
||||||
|
@ -330,7 +317,6 @@ export class CoreCourseSectionPage implements OnDestroy {
|
||||||
promises.push(this.courseProvider.invalidateSections(this.course.id));
|
promises.push(this.courseProvider.invalidateSections(this.course.id));
|
||||||
promises.push(this.coursesProvider.invalidateUserCourses());
|
promises.push(this.coursesProvider.invalidateUserCourses());
|
||||||
promises.push(this.courseFormatDelegate.invalidateData(this.course, this.sections));
|
promises.push(this.courseFormatDelegate.invalidateData(this.course, this.sections));
|
||||||
promises.push(this.coursesProvider.invalidateCoursesByField('id', this.course.id));
|
|
||||||
|
|
||||||
if (this.sections) {
|
if (this.sections) {
|
||||||
promises.push(this.prefetchDelegate.invalidateCourseUpdates(this.course.id));
|
promises.push(this.prefetchDelegate.invalidateCourseUpdates(this.course.id));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<ion-card [attr.course-color]="course.id % 10">
|
<ion-card [attr.course-color]="course.id % 10">
|
||||||
<div (click)="openCourse(course)" class="core-course-thumb" [class.core-course-color-img]="course.imageThumb">
|
<div (click)="openCourse(course)" class="core-course-thumb" [class.core-course-color-img]="course.courseImage">
|
||||||
<img *ngIf="course.imageThumb" [src]="course.imageThumb" core-external-content alt=""/>
|
<img *ngIf="course.courseImage" [src]="course.courseImage" core-external-content alt=""/>
|
||||||
<core-icon name="fa-star" *ngIf="course.isfavourite"></core-icon>
|
<core-icon name="fa-star" *ngIf="course.isfavourite"></core-icon>
|
||||||
</div>
|
</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">
|
<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">
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
<core-loading [hideUntil]="dataLoaded">
|
<core-loading [hideUntil]="dataLoaded">
|
||||||
|
|
||||||
<ion-list *ngIf="course">
|
<ion-list *ngIf="course">
|
||||||
<div *ngIf="course.imageThumb" (click)="openCourse()" class="core-course-thumb">
|
<div *ngIf="course.courseImage" (click)="openCourse()" class="core-course-thumb">
|
||||||
<img [src]="course.imageThumb" core-external-content alt=""/>
|
<img [src]="course.courseImage" core-external-content alt=""/>
|
||||||
</div>
|
</div>
|
||||||
<a ion-item text-wrap (click)="openCourse()" [title]="course.fullname" [attr.detail-none]=" avoidOpenCourse || !canAccessCourse">
|
<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>
|
<core-icon name="fa-graduation-cap" fixed-width item-start></core-icon>
|
||||||
|
|
|
@ -101,7 +101,7 @@ export class CoreCoursesCoursePreviewPage implements OnDestroy {
|
||||||
this.courseUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.course.id);
|
this.courseUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'course/view.php?id=' + this.course.id);
|
||||||
this.paypalReturnUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'enrol/paypal/return.php');
|
this.paypalReturnUrl = this.textUtils.concatenatePaths(currentSiteUrl, 'enrol/paypal/return.php');
|
||||||
if (this.course.overviewfiles && this.course.overviewfiles.length > 0) {
|
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.
|
// Initialize the self enrol modal.
|
||||||
|
|
|
@ -38,13 +38,13 @@ export class CoreCoursesHelperProvider {
|
||||||
course.displayname = courseByField.displayname;
|
course.displayname = courseByField.displayname;
|
||||||
|
|
||||||
if (courseByField.overviewfiles && courseByField.overviewfiles[0]) {
|
if (courseByField.overviewfiles && courseByField.overviewfiles[0]) {
|
||||||
course.imageThumb = courseByField.overviewfiles[0].fileurl;
|
course.courseImage = courseByField.overviewfiles[0].fileurl;
|
||||||
} else {
|
} else {
|
||||||
course.imageThumb = false;
|
course.courseImage = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
delete course.displayname;
|
delete course.displayname;
|
||||||
course.imageThumb = false;
|
course.courseImage = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue