diff --git a/config.xml b/config.xml index e6e17803f..a795b022d 100644 --- a/config.xml +++ b/config.xml @@ -1,7 +1,7 @@ - Moodle Mobile - Moodle Mobile official app + Moodle + Moodle official app Moodle Mobile team diff --git a/src/addon/mod/glossary/components/index/index.ts b/src/addon/mod/glossary/components/index/index.ts index 446b6f919..9198e0ac9 100644 --- a/src/addon/mod/glossary/components/index/index.ts +++ b/src/addon/mod/glossary/components/index/index.ts @@ -381,8 +381,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity */ protected eventReceived(data: any): void { if (this.glossary && this.glossary.id === data.glossaryId) { - this.loaded = false; - this.loadContent(); + this.showLoadingAndRefresh(false); // Check completion since it could be configured to complete once the user adds a new discussion or replies. this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus); diff --git a/src/app/app.scss b/src/app/app.scss index 540da822e..dadf2360d 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -795,4 +795,23 @@ ion-alert.core-inapp-notification { margin-bottom: 5px; } } -} \ No newline at end of file +} + +.core-icon-with-badge { + position: relative; + + .icon { + font-size: 32px; + } + + .core-icon-badge { + width: auto; + height: auto; + margin: 0; + position: absolute; + top: -18px; + right: -8px; + color: red; + font-size: 16px; + } +} diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 28bc342bf..9956ac920 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -27,6 +27,7 @@ import { CoreTimeUtilsProvider } from '@providers/utils/time'; import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreCourseOptionsDelegate, CoreCourseOptionsHandlerToDisplay } from './options-delegate'; import { CoreSiteHomeProvider } from '@core/sitehome/providers/sitehome'; +import { CoreCoursesProvider } from '@core/courses/providers/courses'; import { CoreCourseProvider } from './course'; import { CoreCourseModuleDelegate } from './module-delegate'; import { CoreCourseModulePrefetchDelegate } from './module-prefetch-delegate'; @@ -120,7 +121,8 @@ export class CoreCourseHelperProvider { private utils: CoreUtilsProvider, private translate: TranslateService, private loginHelper: CoreLoginHelperProvider, private courseOptionsDelegate: CoreCourseOptionsDelegate, private siteHomeProvider: CoreSiteHomeProvider, private eventsProvider: CoreEventsProvider, private fileHelper: CoreFileHelperProvider, - private appProvider: CoreAppProvider, private fileProvider: CoreFileProvider, private injector: Injector) { } + private appProvider: CoreAppProvider, private fileProvider: CoreFileProvider, private injector: Injector, + private coursesProvider: CoreCoursesProvider) { } /** * This function treats every module on the sections provided to load the handler data, treat completion @@ -1004,6 +1006,10 @@ export class CoreCourseHelperProvider { } }); + // Prefetch other data needed to render the course. + promises.push(this.coursesProvider.getCoursesByField('id', course.id)); + promises.push(this.courseProvider.getActivitiesCompletionStatus(course.id)); + return this.utils.allPromises(promises); }).then(() => { // Download success, mark the course as downloaded. diff --git a/src/core/courses/providers/courses.ts b/src/core/courses/providers/courses.ts index 8f825e8a3..797f0a5ee 100644 --- a/src/core/courses/providers/courses.ts +++ b/src/core/courses/providers/courses.ts @@ -115,6 +115,10 @@ export class CoreCoursesProvider { return courseIds; }); } else { + if (courseIds.length > 1 && courseIds.indexOf(siteHomeId) == -1) { + courseIds.push(siteHomeId); + } + return courseIds; } }); diff --git a/src/providers/utils/dom.ts b/src/providers/utils/dom.ts index 3d2ce47d6..3ab14f2a9 100644 --- a/src/providers/utils/dom.ts +++ b/src/providers/utils/dom.ts @@ -17,6 +17,7 @@ import { LoadingController, Loading, ToastController, Toast, AlertController, Alert, Platform, Content, ModalController } from 'ionic-angular'; +import { DomSanitizer } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { CoreTextUtilsProvider } from './text'; import { CoreAppProvider } from '../app'; @@ -42,7 +43,7 @@ export class CoreDomUtilsProvider { constructor(private translate: TranslateService, private loadingCtrl: LoadingController, private toastCtrl: ToastController, private alertCtrl: AlertController, private textUtils: CoreTextUtilsProvider, private appProvider: CoreAppProvider, private platform: Platform, private configProvider: CoreConfigProvider, private urlUtils: CoreUrlUtilsProvider, - private modalCtrl: ModalController) { } + private modalCtrl: ModalController, private sanitizer: DomSanitizer) { } /** * Equivalent to element.closest(). If the browser doesn't support element.closest, it will @@ -474,13 +475,16 @@ export class CoreDomUtilsProvider { * Given an error message, return a suitable error title. * * @param {string} message The error message. - * @return {string} Title. + * @return {any} Title. */ - private getErrorTitle(message: string): string { + private getErrorTitle(message: string): any { if (message == this.translate.instant('core.networkerrormsg') || message == this.translate.instant('core.fileuploader.errormustbeonlinetoupload')) { - return '\ - '; + return this.sanitizer.bypassSecurityTrustHtml('
' + + '' + + '' + + '
'); + } return this.textUtils.decodeHTML(this.translate.instant('core.error'));