diff --git a/src/core/mainmenu/pages/more/more.html b/src/core/mainmenu/pages/more/more.html index fa55b5103..349b956d6 100644 --- a/src/core/mainmenu/pages/more/more.html +++ b/src/core/mainmenu/pages/more/more.html @@ -17,39 +17,39 @@ -

{{ handler.title | translate}}

+

{{ handler.title | translate}}

{{handler.badge}}
-

{{item.label}}

+

{{item.label}}

-

{{item.label}}

+

{{item.label}}

-

{{ 'core.mainmenu.website' | translate }}

+

{{ 'core.mainmenu.website' | translate }}

-

{{ 'core.mainmenu.help' | translate }}

+

{{ 'core.mainmenu.help' | translate }}

-

{{ 'core.settings.sitesettings' | translate }}

+

{{ 'core.settings.sitesettings' | translate }}

-

{{ 'core.settings.appsettings' | translate }}

+

{{ 'core.settings.appsettings' | translate }}

-

{{ logoutLabel | translate }}

+

{{ logoutLabel | translate }}

diff --git a/src/core/settings/pages/app/app.html b/src/core/settings/pages/app/app.html index 90d11ade8..4d79ded29 100644 --- a/src/core/settings/pages/app/app.html +++ b/src/core/settings/pages/app/app.html @@ -10,23 +10,23 @@ -

{{ 'core.settings.general' | translate }}

+

{{ 'core.settings.general' | translate }}

-

{{ 'core.settings.spaceusage' | translate }}

+

{{ 'core.settings.spaceusage' | translate }}

-

{{ 'core.settings.synchronization' | translate }}

+

{{ 'core.settings.synchronization' | translate }}

-

{{ 'core.sharedfiles.sharedfiles' | translate }}

+

{{ 'core.sharedfiles.sharedfiles' | translate }}

-

{{ 'core.settings.about' | translate }}

+

{{ 'core.settings.about' | translate }}

diff --git a/src/core/settings/pages/site/site.html b/src/core/settings/pages/site/site.html index 31965d843..c511caa7b 100644 --- a/src/core/settings/pages/site/site.html +++ b/src/core/settings/pages/site/site.html @@ -12,20 +12,17 @@ - - +

{{siteInfo.fullname}}

{{ siteUrl }}
- +

{{ 'core.settings.spaceusage' | translate }}

-
-

{{ spaceUsage.spaceUsage | coreBytesToSize }}

-

{{ 'core.settings.entriesincache' | translate: { $a: spaceUsage.cacheEntries } }}

-
+

{{ spaceUsage.spaceUsage | coreBytesToSize }}

+

{{ 'core.settings.entriesincache' | translate: { $a: spaceUsage.cacheEntries } }}

@@ -38,14 +35,15 @@
- + -

{{ 'core.sharedfiles.sharedfiles' | translate }}

+

{{ 'core.sharedfiles.sharedfiles' | translate }}

+ {{ iosSharedFiles }}
-

{{ handler.title | translate}}

+

{{ handler.title | translate}}

diff --git a/src/core/settings/pages/site/site.ts b/src/core/settings/pages/site/site.ts index 78a265e6c..96616b2b1 100644 --- a/src/core/settings/pages/site/site.ts +++ b/src/core/settings/pages/site/site.ts @@ -15,11 +15,11 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, NavParams, Platform } from 'ionic-angular'; import { CoreSettingsDelegate, CoreSettingsHandlerData } from '../../providers/delegate'; -import { CoreSite } from '@classes/site'; import { CoreEventsProvider } from '@providers/events'; import { CoreSitesProvider, CoreSiteBasicInfo } from '@providers/sites'; import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreSplitViewComponent } from '@components/split-view/split-view'; +import { CoreSharedFilesProvider } from '@core/sharedfiles/providers/sharedfiles'; import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../providers/helper'; /** @@ -36,7 +36,7 @@ export class CoreSiteSettingsPage { handlers: CoreSettingsHandlerData[]; isIOS: boolean; selectedPage: string; - currentSite: CoreSite; + siteId: string; siteInfo: CoreSiteBasicInfo[] = []; siteName: string; siteUrl: string; @@ -45,7 +45,8 @@ export class CoreSiteSettingsPage { spaceUsage: 0 }; loaded = false; - protected sitesObserver: any; + iosSharedFiles: number; + protected sitesObserver: any; protected isDestroyed = false; constructor(protected settingsDelegate: CoreSettingsDelegate, @@ -53,6 +54,7 @@ export class CoreSiteSettingsPage { protected sitesProvider: CoreSitesProvider, protected domUtils: CoreDomUtilsProvider, protected eventsProvider: CoreEventsProvider, + protected sharedFilesProvider: CoreSharedFilesProvider, platorm: Platform, navParams: NavParams) { @@ -61,7 +63,7 @@ export class CoreSiteSettingsPage { this.selectedPage = navParams.get('page') || false; this.sitesObserver = this.eventsProvider.on(CoreEventsProvider.SITE_UPDATED, (data) => { - if (data.siteId == this.currentSite.id) { + if (data.siteId == this.siteId) { this.refreshData(); } }); @@ -87,15 +89,22 @@ export class CoreSiteSettingsPage { const promises = []; this.handlers = this.settingsDelegate.getHandlers(); - this.currentSite = this.sitesProvider.getCurrentSite(); - this.siteInfo = this.currentSite.getInfo(); - this.siteName = this.currentSite.getSiteName(); - this.siteUrl = this.currentSite.getURL(); + const currentSite = this.sitesProvider.getCurrentSite(); + this.siteId = currentSite.id; + this.siteInfo = currentSite.getInfo(); + this.siteName = currentSite.getSiteName(); + this.siteUrl = currentSite.getURL(); - promises.push(this.settingsHelper.getSiteSpaceUsage(this.sitesProvider.getCurrentSiteId()).then((spaceUsage) => { + promises.push(this.settingsHelper.getSiteSpaceUsage(this.siteId).then((spaceUsage) => { this.spaceUsage = spaceUsage; })); + if (this.isIOS) { + promises.push(this.sharedFilesProvider.getSiteSharedFiles(this.siteId).then((files) => { + this.iosSharedFiles = files.length; + })); + } + return Promise.all(promises); } @@ -104,7 +113,7 @@ export class CoreSiteSettingsPage { */ synchronize(siteId: string): void { // Using syncOnlyOnWifi false to force manual sync. - this.settingsHelper.synchronizeSite(false, this.currentSite.id).catch((error) => { + this.settingsHelper.synchronizeSite(false, this.siteId).catch((error) => { if (this.isDestroyed) { return; } @@ -118,7 +127,7 @@ export class CoreSiteSettingsPage { * @return True if site is beeing synchronized, false otherwise. */ isSynchronizing(): boolean { - return this.currentSite && !!this.settingsHelper.getSiteSyncPromise(this.currentSite.id); + return this.siteId && !!this.settingsHelper.getSiteSyncPromise(this.siteId); } /** @@ -138,7 +147,7 @@ export class CoreSiteSettingsPage { * @param siteData Site object with space usage. */ deleteSiteStorage(): void { - this.settingsHelper.deleteSiteStorage(this.currentSite.getSiteName(), this.currentSite.getId()).then((newInfo) => { + this.settingsHelper.deleteSiteStorage(this.siteName, this.siteId).then((newInfo) => { this.spaceUsage = newInfo; }).catch(() => { // Ignore cancelled confirmation modal. diff --git a/src/core/settings/pages/space-usage/space-usage.html b/src/core/settings/pages/space-usage/space-usage.html index 27c950fb0..e32dc0bc4 100644 --- a/src/core/settings/pages/space-usage/space-usage.html +++ b/src/core/settings/pages/space-usage/space-usage.html @@ -20,7 +20,7 @@ -

{{ 'core.settings.total' | translate }}

+

{{ 'core.settings.total' | translate }}

{{ totals.spaceUsage | coreBytesToSize }}

{{ 'core.settings.entriesincache' | translate: { $a: totals.cacheEntries } }}

diff --git a/src/core/settings/pages/synchronization/synchronization.html b/src/core/settings/pages/synchronization/synchronization.html index 3f7a6a2a1..839172551 100644 --- a/src/core/settings/pages/synchronization/synchronization.html +++ b/src/core/settings/pages/synchronization/synchronization.html @@ -6,7 +6,7 @@ -

{{ 'core.settings.syncsettings' | translate }}

+

{{ 'core.settings.syncsettings' | translate }}

{{ 'core.settings.enablesyncwifi' | translate }} @@ -14,7 +14,7 @@ -

{{ 'core.settings.sites' | translate }}

+

{{ 'core.settings.sites' | translate }}

diff --git a/src/core/sharedfiles/pages/list/list.html b/src/core/sharedfiles/pages/list/list.html index 5f210c99a..06bbf5228 100644 --- a/src/core/sharedfiles/pages/list/list.html +++ b/src/core/sharedfiles/pages/list/list.html @@ -14,7 +14,7 @@ - + diff --git a/src/core/sharedfiles/pages/list/list.ts b/src/core/sharedfiles/pages/list/list.ts index ec408963c..66c8b199c 100644 --- a/src/core/sharedfiles/pages/list/list.ts +++ b/src/core/sharedfiles/pages/list/list.ts @@ -35,6 +35,7 @@ export class CoreSharedFilesListPage implements OnInit, OnDestroy { isModal: boolean; manage: boolean; pick: boolean; // To pick a file you MUST use a modal. + showSitePicker: boolean; path = ''; title: string; filesLoaded: boolean; @@ -52,6 +53,7 @@ export class CoreSharedFilesListPage implements OnInit, OnDestroy { this.manage = !!navParams.get('manage'); this.pick = !!navParams.get('pick'); this.path = navParams.get('path') || ''; + this.showSitePicker = !navParams.get('hideSitePicker'); } /**