From 1002ebf2bd253d1df3ccdbd052e46cb3a3b20c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 2 Jan 2019 16:23:16 +0100 Subject: [PATCH 1/3] MOBILE-2795 site: Add site version body on login --- src/app/app.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5c1f462b4..c494bb511 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -140,7 +140,18 @@ export class MoodleMobileApp implements OnInit { } }; - this.eventsProvider.on(CoreEventsProvider.LOGIN, () => { + this.eventsProvider.on(CoreEventsProvider.LOGIN, (data) => { + if (data.siteId) { + this.sitesProvider.getSite(data.siteId).then((site) => { + const info = site.getInfo(); + if (info) { + // Add version classes to body. + this.removeVersionClass(); + this.addVersionClass(this.sitesProvider.getReleaseNumber(info.release || '')); + } + }); + } + loadCustomStrings(); }); From 408c665543a65891f0892487936178db590e46d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 2 Jan 2019 16:59:40 +0100 Subject: [PATCH 2/3] MOBILE-2795 competency: Treat activity links --- .../competency/components/course/addon-competency-course.html | 2 +- src/addon/competency/pages/competency/competency.html | 4 ++-- .../competency/pages/competencysummary/competencysummary.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/addon/competency/components/course/addon-competency-course.html b/src/addon/competency/components/course/addon-competency-course.html index dc9954809..c8636ff41 100644 --- a/src/addon/competency/components/course/addon-competency-course.html +++ b/src/addon/competency/components/course/addon-competency-course.html @@ -45,7 +45,7 @@
- {{ 'addon.competency.path' | translate }}: + {{ 'addon.competency.path' | translate }} {{ competency.comppath.framework.name }}  / {{ ancestor.name }} diff --git a/src/addon/competency/pages/competency/competency.html b/src/addon/competency/pages/competency/competency.html index c6980360c..0df736063 100644 --- a/src/addon/competency/pages/competency/competency.html +++ b/src/addon/competency/pages/competency/competency.html @@ -20,7 +20,7 @@ - {{ 'addon.competency.path' | translate }}: + {{ 'addon.competency.path' | translate }} {{ competency.competency.comppath.framework.name }}  / {{ ancestor.name }} @@ -42,7 +42,7 @@ {{ 'addon.competency.noactivities' | translate }} - + diff --git a/src/addon/competency/pages/competencysummary/competencysummary.html b/src/addon/competency/pages/competencysummary/competencysummary.html index f05fed004..8df0e9bcc 100644 --- a/src/addon/competency/pages/competencysummary/competencysummary.html +++ b/src/addon/competency/pages/competencysummary/competencysummary.html @@ -13,7 +13,7 @@ - {{ 'addon.competency.path' | translate }}: + {{ 'addon.competency.path' | translate }} {{ competency.comppath.framework.name }}  / {{ ancestor.name }} From 46fe46ef6eead75d37577ca8bf4c0843e0e503bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 3 Jan 2019 11:20:33 +0100 Subject: [PATCH 3/3] MOBILE-2795 ux: Add desktop platform classes --- src/app/app.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c494bb511..779e8e3c6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, NgZone } from '@angular/core'; -import { Platform } from 'ionic-angular'; +import { Platform, IonicApp } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { CoreAppProvider } from '@providers/app'; import { CoreEventsProvider } from '@providers/events'; @@ -37,7 +37,7 @@ export class MoodleMobileApp implements OnInit { constructor(private platform: Platform, statusBar: StatusBar, logger: CoreLoggerProvider, keyboard: Keyboard, private eventsProvider: CoreEventsProvider, private loginHelper: CoreLoginHelperProvider, private zone: NgZone, private appProvider: CoreAppProvider, private langProvider: CoreLangProvider, private sitesProvider: CoreSitesProvider, - private screenOrientation: ScreenOrientation) { + private screenOrientation: ScreenOrientation, app: IonicApp) { this.logger = logger.getInstance('AppComponent'); platform.ready().then(() => { @@ -50,6 +50,12 @@ export class MoodleMobileApp implements OnInit { } keyboard.hideFormAccessoryBar(false); + + let desktopClass = this.appProvider.isDesktop() ? 'platform-desktop' : ''; + desktopClass += this.appProvider.isMac() ? ' platform-mac' : ''; + desktopClass += this.appProvider.isLinux() ? ' platform-linux' : ''; + desktopClass += this.appProvider.isWindows() ? ' platform-windows' : ''; + app.setElementClass(desktopClass, true); }); }