diff --git a/scripts/langindex.json b/scripts/langindex.json index c9e4446ad..0a13d4d3c 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1941,6 +1941,7 @@ "core.settings.navigatoruseragent": "local_moodlemobileapp", "core.settings.networkstatus": "local_moodlemobileapp", "core.settings.opensourcelicenses": "local_moodlemobileapp", + "core.settings.preferences": "moodle", "core.settings.privacypolicy": "local_moodlemobileapp", "core.settings.publisher": "local_moodlemobileapp", "core.settings.pushid": "local_moodlemobileapp", @@ -1950,8 +1951,9 @@ "core.settings.showdownloadoptions": "local_moodlemobileapp", "core.settings.siteinfo": "local_moodlemobileapp", "core.settings.sites": "moodle", - "core.settings.sitesettings": "moodle", "core.settings.spaceusage": "local_moodlemobileapp", + "core.settings.spaceusagehelp": "local_moodlemobileapp", + "core.settings.synchelp": "local_moodlemobileapp", "core.settings.synchronization": "local_moodlemobileapp", "core.settings.synchronizenow": "local_moodlemobileapp", "core.settings.syncsettings": "local_moodlemobileapp", diff --git a/src/addon/messages/pages/settings/settings.html b/src/addon/messages/pages/settings/settings.html index 0172888d9..c955efb2e 100644 --- a/src/addon/messages/pages/settings/settings.html +++ b/src/addon/messages/pages/settings/settings.html @@ -1,6 +1,6 @@ - {{ 'addon.messages.messagepreferences' | translate }} + {{ 'addon.messages.messages' | translate }} diff --git a/src/addon/messages/providers/settings-handler.ts b/src/addon/messages/providers/settings-handler.ts index 6c4d35447..0375ec36b 100644 --- a/src/addon/messages/providers/settings-handler.ts +++ b/src/addon/messages/providers/settings-handler.ts @@ -44,7 +44,7 @@ export class AddonMessagesSettingsHandler implements CoreSettingsHandler { getDisplayData(): CoreSettingsHandlerData { return { icon: 'chatbubbles', - title: 'addon.messages.messagepreferences', + title: 'addon.messages.messages', page: 'AddonMessagesSettingsPage', class: 'addon-messages-settings-handler' }; diff --git a/src/addon/notifications/pages/settings/settings.html b/src/addon/notifications/pages/settings/settings.html index b6502c2c0..66c94edf3 100644 --- a/src/addon/notifications/pages/settings/settings.html +++ b/src/addon/notifications/pages/settings/settings.html @@ -1,6 +1,6 @@ - {{ 'addon.notifications.notificationpreferences' | translate }} + {{ 'addon.notifications.notifications' | translate }} diff --git a/src/addon/notifications/providers/settings-handler.ts b/src/addon/notifications/providers/settings-handler.ts index 95036ef59..b34f5f15f 100644 --- a/src/addon/notifications/providers/settings-handler.ts +++ b/src/addon/notifications/providers/settings-handler.ts @@ -49,7 +49,7 @@ export class AddonNotificationsSettingsHandler implements CoreSettingsHandler { getDisplayData(): CoreSettingsHandlerData { return { icon: 'notifications', - title: 'addon.notifications.notificationpreferences', + title: 'addon.notifications.notifications', page: 'AddonNotificationsSettingsPage', class: 'addon-notifications-settings-handler' }; diff --git a/src/app/app.scss b/src/app/app.scss index fbe62a90c..d7a61db1b 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -106,6 +106,9 @@ ion-app.app-root { .item h2 { text-overflow: inherit; overflow: inherit; + ion-icon, core-icon { + vertical-align: bottom; + } } .core-nav-item-selected, .item.core-nav-item-selected { diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index 5b69400d2..daa597d0d 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -1941,6 +1941,7 @@ "core.settings.navigatoruseragent": "Navigator userAgent", "core.settings.networkstatus": "Internet connection status", "core.settings.opensourcelicenses": "Open Source Licences", + "core.settings.preferences": "Preferences", "core.settings.privacypolicy": "Privacy policy", "core.settings.publisher": "Publisher", "core.settings.pushid": "Push notifications ID", @@ -1950,8 +1951,9 @@ "core.settings.showdownloadoptions": "Show download options", "core.settings.siteinfo": "Site info", "core.settings.sites": "Sites", - "core.settings.sitesettings": "Site settings", "core.settings.spaceusage": "Space usage", + "core.settings.spaceusagehelp": "Deleting the stored information of the site will remove all the site offline data. This information allows you to use the app when offline. ", + "core.settings.synchelp": "Synchronising a site will send pending changes and all offline activity stored in the device and will synchronise some data like messages and notifications.", "core.settings.synchronization": "Synchronisation", "core.settings.synchronizenow": "Synchronise now", "core.settings.syncsettings": "Synchronisation settings", @@ -2079,4 +2081,4 @@ "core.yes": "Yes", "core.youreoffline": "You are offline", "core.youreonline": "You are back online" -} +} \ No newline at end of file diff --git a/src/core/mainmenu/pages/more/more.html b/src/core/mainmenu/pages/more/more.html index 349b956d6..608eb4915 100644 --- a/src/core/mainmenu/pages/more/more.html +++ b/src/core/mainmenu/pages/more/more.html @@ -39,17 +39,20 @@

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

- - -

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

+
+ +

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

+ + +

{{ logoutLabel | translate }}

+
+ +

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

- - -

{{ logoutLabel | translate }}

-
+
diff --git a/src/core/mainmenu/pages/more/more.ts b/src/core/mainmenu/pages/more/more.ts index 8f9bec1c8..864402eef 100644 --- a/src/core/mainmenu/pages/more/more.ts +++ b/src/core/mainmenu/pages/more/more.ts @@ -151,8 +151,8 @@ export class CoreMainMenuMorePage implements OnDestroy { /** * Open site settings page. */ - openSiteSettings(): void { - this.navCtrl.push('CoreSiteSettingsPage'); + openSitePreferences(): void { + this.navCtrl.push('CoreSitePreferencesPage'); } /** diff --git a/src/core/settings/lang/en.json b/src/core/settings/lang/en.json index fbb892251..1713ce651 100644 --- a/src/core/settings/lang/en.json +++ b/src/core/settings/lang/en.json @@ -57,11 +57,13 @@ "entriesincache": "{{$a}} entries in cache", "screen": "Screen information", "settings": "Settings", - "sitesettings": "Site settings", + "preferences": "Preferences", "showdownloadoptions": "Show download options", "siteinfo": "Site info", "sites": "Sites", "spaceusage": "Space usage", + "spaceusagehelp": "Deleting the stored information of the site will remove all the site offline data. This information allows you to use the app when offline. ", + "synchelp": "Synchronising a site will send pending changes and all offline activity stored in the device and will synchronise some data like messages and notifications.", "synchronization": "Synchronisation", "synchronizenow": "Synchronise now", "syncsettings": "Synchronisation settings", diff --git a/src/core/settings/pages/site/site.html b/src/core/settings/pages/site/site.html index c511caa7b..6c932d246 100644 --- a/src/core/settings/pages/site/site.html +++ b/src/core/settings/pages/site/site.html @@ -1,6 +1,6 @@ - {{ 'core.settings.sitesettings' | translate}} + {{ 'core.settings.preferences' | translate}} @@ -18,23 +18,6 @@ {{ siteUrl }} - - -

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

-

{{ spaceUsage.spaceUsage | coreBytesToSize }}

-

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

- -
- - -

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

- - -

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

@@ -45,6 +28,24 @@

{{ handler.title | translate}}

+ + + +

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

+

{{ spaceUsage.spaceUsage | coreBytesToSize }}

+

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

+ +
+ +

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

+ + +
+
diff --git a/src/core/settings/pages/site/site.module.ts b/src/core/settings/pages/site/site.module.ts index 753dcbf37..2ce44ef26 100644 --- a/src/core/settings/pages/site/site.module.ts +++ b/src/core/settings/pages/site/site.module.ts @@ -15,21 +15,21 @@ import { NgModule } from '@angular/core'; import { IonicPageModule } from 'ionic-angular'; import { TranslateModule } from '@ngx-translate/core'; -import { CoreSiteSettingsPage } from './site'; +import { CoreSitePreferencesPage } from './site'; import { CoreComponentsModule } from '@components/components.module'; import { CoreDirectivesModule } from '@directives/directives.module'; import { CorePipesModule } from '@pipes/pipes.module'; @NgModule({ declarations: [ - CoreSiteSettingsPage + CoreSitePreferencesPage ], imports: [ CoreComponentsModule, CoreDirectivesModule, CorePipesModule, - IonicPageModule.forChild(CoreSiteSettingsPage), + IonicPageModule.forChild(CoreSitePreferencesPage), TranslateModule.forChild() ], }) -export class CoreSiteSettingsPageModule {} +export class CoreSitePreferencesPageModule {} diff --git a/src/core/settings/pages/site/site.ts b/src/core/settings/pages/site/site.ts index 96616b2b1..6f484dd44 100644 --- a/src/core/settings/pages/site/site.ts +++ b/src/core/settings/pages/site/site.ts @@ -14,6 +14,7 @@ import { Component, ViewChild } from '@angular/core'; import { IonicPage, NavParams, Platform } from 'ionic-angular'; +import { TranslateService } from '@ngx-translate/core'; import { CoreSettingsDelegate, CoreSettingsHandlerData } from '../../providers/delegate'; import { CoreEventsProvider } from '@providers/events'; import { CoreSitesProvider, CoreSiteBasicInfo } from '@providers/sites'; @@ -25,12 +26,12 @@ import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../providers/helper'; /** * Page that displays the list of site settings pages. */ -@IonicPage({segment: 'core-settings-site'}) +@IonicPage({segment: 'core-site-preferences'}) @Component({ - selector: 'page-core-settings-site', + selector: 'page-core-site-preferences', templateUrl: 'site.html', }) -export class CoreSiteSettingsPage { +export class CoreSitePreferencesPage { @ViewChild(CoreSplitViewComponent) splitviewCtrl: CoreSplitViewComponent; handlers: CoreSettingsHandlerData[]; @@ -55,6 +56,7 @@ export class CoreSiteSettingsPage { protected domUtils: CoreDomUtilsProvider, protected eventsProvider: CoreEventsProvider, protected sharedFilesProvider: CoreSharedFilesProvider, + protected translate: TranslateService, platorm: Platform, navParams: NavParams) { @@ -75,11 +77,17 @@ export class CoreSiteSettingsPage { ionViewDidLoad(): void { this.fetchData().finally(() => { this.loaded = true; - }); - if (this.selectedPage) { - this.openHandler(this.selectedPage); - } + if (this.selectedPage) { + this.openHandler(this.selectedPage); + } else if (this.splitviewCtrl.isOn()) { + if (this.isIOS) { + this.openHandler('CoreSharedFilesListPage', {manage: true, siteId: this.siteId, hideSitePicker: true}); + } else if (this.handlers.length > 0) { + this.openHandler(this.handlers[0].page, this.handlers[0].params); + } + } + }); } /** @@ -165,6 +173,22 @@ export class CoreSiteSettingsPage { this.splitviewCtrl.push(page, params); } + /** + * Show information about space usage actions. + */ + showSpaceInfo(): void { + this.domUtils.showAlert(this.translate.instant('core.help'), + this.translate.instant('core.settings.spaceusagehelp')); + } + + /** + * Show information about sync actions. + */ + showSyncInfo(): void { + this.domUtils.showAlert(this.translate.instant('core.help'), + this.translate.instant('core.settings.synchelp')); + } + /** * Page destroyed. */ diff --git a/src/core/settings/pages/space-usage/space-usage.html b/src/core/settings/pages/space-usage/space-usage.html index e32dc0bc4..29dac4705 100644 --- a/src/core/settings/pages/space-usage/space-usage.html +++ b/src/core/settings/pages/space-usage/space-usage.html @@ -1,8 +1,15 @@ {{ 'core.settings.spaceusage' | translate }} + + + + + diff --git a/src/core/settings/pages/space-usage/space-usage.ts b/src/core/settings/pages/space-usage/space-usage.ts index 3e6a74be2..31b3fd9a9 100644 --- a/src/core/settings/pages/space-usage/space-usage.ts +++ b/src/core/settings/pages/space-usage/space-usage.ts @@ -14,7 +14,9 @@ import { Component, } from '@angular/core'; import { IonicPage } from 'ionic-angular'; +import { TranslateService } from '@ngx-translate/core'; import { CoreSitesProvider, CoreSiteBasicInfo } from '@providers/sites'; +import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../providers/helper'; /** @@ -36,7 +38,9 @@ export class CoreSettingsSpaceUsagePage { }; constructor(protected sitesProvider: CoreSitesProvider, - protected settingsHelper: CoreSettingsHelper) { + protected settingsHelper: CoreSettingsHelper, + protected domUtils: CoreDomUtilsProvider, + protected translate: TranslateService) { this.currentSiteId = this.sitesProvider.getCurrentSiteId(); } @@ -104,6 +108,14 @@ export class CoreSettingsSpaceUsagePage { // Ignore cancelled confirmation modal. }); } + + /** + * Show information about space usage actions. + */ + showInfo(): void { + this.domUtils.showAlert(this.translate.instant('core.help'), + this.translate.instant('core.settings.spaceusagehelp')); + } } /** diff --git a/src/core/settings/pages/synchronization/synchronization.html b/src/core/settings/pages/synchronization/synchronization.html index 839172551..bb5b62e0f 100644 --- a/src/core/settings/pages/synchronization/synchronization.html +++ b/src/core/settings/pages/synchronization/synchronization.html @@ -1,8 +1,15 @@ {{ 'core.settings.synchronization' | translate }} + + + + + diff --git a/src/core/settings/pages/synchronization/synchronization.ts b/src/core/settings/pages/synchronization/synchronization.ts index 97672e93e..1a31b32e1 100644 --- a/src/core/settings/pages/synchronization/synchronization.ts +++ b/src/core/settings/pages/synchronization/synchronization.ts @@ -14,6 +14,7 @@ import { Component, OnDestroy } from '@angular/core'; import { IonicPage } from 'ionic-angular'; +import { TranslateService } from '@ngx-translate/core'; import { CoreConstants } from '@core/constants'; import { CoreEventsProvider } from '@providers/events'; import { CoreSitesProvider, CoreSiteBasicInfo } from '@providers/sites'; @@ -42,7 +43,8 @@ export class CoreSettingsSynchronizationPage implements OnDestroy { protected eventsProvider: CoreEventsProvider, protected sitesProvider: CoreSitesProvider, protected domUtils: CoreDomUtilsProvider, - protected settingsHelper: CoreSettingsHelper) { + protected settingsHelper: CoreSettingsHelper, + protected translate: TranslateService) { this.currentSiteId = this.sitesProvider.getCurrentSiteId(); @@ -106,6 +108,14 @@ export class CoreSettingsSynchronizationPage implements OnDestroy { return !!this.settingsHelper.getSiteSyncPromise(siteId); } + /** + * Show information about sync actions. + */ + showInfo(): void { + this.domUtils.showAlert(this.translate.instant('core.help'), + this.translate.instant('core.settings.synchelp')); + } + /** * Page destroyed. */ diff --git a/src/core/settings/providers/helper.ts b/src/core/settings/providers/helper.ts index 2a0d698ef..14b026588 100644 --- a/src/core/settings/providers/helper.ts +++ b/src/core/settings/providers/helper.ts @@ -28,7 +28,6 @@ import { CoreDomUtilsProvider } from '@providers/utils/dom'; import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreConfigConstants } from '../../../configconstants'; import { TranslateService } from '@ngx-translate/core'; -import { CoreSite } from '@classes/site'; /** * Object with space usage and cache entries that can be erased. @@ -107,7 +106,7 @@ export class CoreSettingsHelper { }).then((site) => { // Clear cache tables. - const cleanSchemas = this.sitesProvider.getSiteTableSchemasToClear(); + const cleanSchemas = this.sitesProvider.getSiteTableSchemasToClear(site); const promises = cleanSchemas.map((name) => { return site.getDb().deleteRecords(name); }); @@ -182,7 +181,7 @@ export class CoreSettingsHelper { * @return If there are rows to delete or not. */ protected async calcSiteClearRows(site: CoreSite): Promise { - const clearTables = this.sitesProvider.getSiteTableSchemasToClear(); + const clearTables = this.sitesProvider.getSiteTableSchemasToClear(site); let totalEntries = 0;