Merge pull request #1702 from crazyserver/MOBILE-2795

Mobile 2795
main
Juan Leyva 2019-01-03 12:13:21 +01:00 committed by GitHub
commit 938e04b836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 7 deletions

View File

@ -45,7 +45,7 @@
<core-format-text [text]=" competency.competency.description "></core-format-text> <core-format-text [text]=" competency.competency.description "></core-format-text>
</div> </div>
<div> <div>
<strong>{{ 'addon.competency.path' | translate }}</strong>: <strong>{{ 'addon.competency.path' | translate }}</strong>
{{ competency.comppath.framework.name }} {{ competency.comppath.framework.name }}
<span *ngFor="let ancestor of competency.comppath.ancestors"> <span *ngFor="let ancestor of competency.comppath.ancestors">
&nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a> &nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a>

View File

@ -20,7 +20,7 @@
<core-format-text [text]="competency.competency.competency.description"></core-format-text> <core-format-text [text]="competency.competency.competency.description"></core-format-text>
</ion-item> </ion-item>
<ion-item text-wrap> <ion-item text-wrap>
<strong>{{ 'addon.competency.path' | translate }}</strong>: <strong>{{ 'addon.competency.path' | translate }}</strong>
{{ competency.competency.comppath.framework.name }} {{ competency.competency.comppath.framework.name }}
<span *ngFor="let ancestor of competency.competency.comppath.ancestors"> <span *ngFor="let ancestor of competency.competency.comppath.ancestors">
&nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a> &nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a>
@ -42,7 +42,7 @@
<span *ngIf="coursemodules.length == 0"> <span *ngIf="coursemodules.length == 0">
{{ 'addon.competency.noactivities' | translate }} {{ 'addon.competency.noactivities' | translate }}
</span> </span>
<a ion-item text-wrap *ngFor="let activity of coursemodules" [href]="activity.url" [title]="activity.name"> <a ion-item text-wrap *ngFor="let activity of coursemodules" [href]="activity.url" [title]="activity.name" core-link capture="true">
<img item-start core-external-content [src]="activity.iconurl" alt="" role="presentation" *ngIf="activity.iconurl" class="core-module-icon"> <img item-start core-external-content [src]="activity.iconurl" alt="" role="presentation" *ngIf="activity.iconurl" class="core-module-icon">
<core-format-text [text]="activity.name"></core-format-text> <core-format-text [text]="activity.name"></core-format-text>
</a> </a>

View File

@ -13,7 +13,7 @@
<core-format-text [text]="competency.competency.description"></core-format-text> <core-format-text [text]="competency.competency.description"></core-format-text>
</ion-item> </ion-item>
<ion-item text-wrap> <ion-item text-wrap>
<strong>{{ 'addon.competency.path' | translate }}</strong>: <strong>{{ 'addon.competency.path' | translate }}</strong>
{{ competency.comppath.framework.name }} {{ competency.comppath.framework.name }}
<span *ngFor="let ancestor of competency.comppath.ancestors"> <span *ngFor="let ancestor of competency.comppath.ancestors">
&nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a> &nbsp;/&nbsp;<a (click)="openCompetencySummary(ancestor.id)">{{ ancestor.name }}</a>

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
import { Component, OnInit, NgZone } from '@angular/core'; 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 { StatusBar } from '@ionic-native/status-bar';
import { CoreAppProvider } from '@providers/app'; import { CoreAppProvider } from '@providers/app';
import { CoreEventsProvider } from '@providers/events'; import { CoreEventsProvider } from '@providers/events';
@ -37,7 +37,7 @@ export class MoodleMobileApp implements OnInit {
constructor(private platform: Platform, statusBar: StatusBar, logger: CoreLoggerProvider, keyboard: Keyboard, constructor(private platform: Platform, statusBar: StatusBar, logger: CoreLoggerProvider, keyboard: Keyboard,
private eventsProvider: CoreEventsProvider, private loginHelper: CoreLoginHelperProvider, private zone: NgZone, private eventsProvider: CoreEventsProvider, private loginHelper: CoreLoginHelperProvider, private zone: NgZone,
private appProvider: CoreAppProvider, private langProvider: CoreLangProvider, private sitesProvider: CoreSitesProvider, private appProvider: CoreAppProvider, private langProvider: CoreLangProvider, private sitesProvider: CoreSitesProvider,
private screenOrientation: ScreenOrientation) { private screenOrientation: ScreenOrientation, app: IonicApp) {
this.logger = logger.getInstance('AppComponent'); this.logger = logger.getInstance('AppComponent');
platform.ready().then(() => { platform.ready().then(() => {
@ -50,6 +50,12 @@ export class MoodleMobileApp implements OnInit {
} }
keyboard.hideFormAccessoryBar(false); 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);
}); });
} }
@ -140,7 +146,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(); loadCustomStrings();
}); });