From f35ed90aec9e70d8c5bd261efe1ebfca95ded909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 1 Jul 2020 15:30:40 +0200 Subject: [PATCH] MOBILE-3463 login: Add url and sitefinder options for multisite --- src/core/login/pages/site/site.html | 104 ++++++++++++++++------------ src/core/login/pages/site/site.ts | 8 +-- 2 files changed, 62 insertions(+), 50 deletions(-) diff --git a/src/core/login/pages/site/site.html b/src/core/login/pages/site/site.html index c466aa73a..d67e749e9 100644 --- a/src/core/login/pages/site/site.html +++ b/src/core/login/pages/site/site.html @@ -14,65 +14,77 @@ -
+ - -

{{ 'core.login.siteaddress' | translate }}

- -
+ + +

{{ 'core.login.siteaddress' | translate }}

+ +
+
+ + +

{{ 'core.login.siteaddress' | translate }}

+ +
+ + + + +
- - - - - + {{ 'core.login.selectsite' | translate }} {{site.name}} + + - - -

{{ 'core.login.selectsite' | translate }}

- - -

{{site.name}}

-

{{site.url}}

-
-
+ + + +

{{ 'core.login.selectsite' | translate }}

+ + +

{{site.name}}

+

{{site.url}}

+
+
- -
-

{{ 'core.login.selectsite' | translate }}

- {{site.name}} -
+ +
+

{{ 'core.login.selectsite' | translate }}

+ {{site.name}} +
+
diff --git a/src/core/login/pages/site/site.ts b/src/core/login/pages/site/site.ts index 9845898cc..e9d43091b 100644 --- a/src/core/login/pages/site/site.ts +++ b/src/core/login/pages/site/site.ts @@ -53,7 +53,7 @@ export class CoreLoginSitePage { siteForm: FormGroup; fixedSites: CoreLoginSiteInfo[]; filteredSites: CoreLoginSiteInfo[]; - fixedDisplay = 'buttons'; + siteSelector = 'sitefinder'; showKeyboard = false; filter = ''; sites: CoreLoginSiteInfoExtended[] = []; @@ -82,14 +82,14 @@ export class CoreLoginSitePage { this.showKeyboard = !!navParams.get('showKeyboard'); let url = ''; + this.siteSelector = CoreConfigConstants.multisitesdisplay; // Load fixed sites if they're set. if (this.loginHelper.hasSeveralFixedSites()) { this.fixedSites = this.loginHelper.getFixedSites(); - this.fixedDisplay = CoreConfigConstants.multisitesdisplay; // Autoselect if not defined. - if (['list', 'listnourl', 'select', 'buttons'].indexOf(this.fixedDisplay) < 0) { - this.fixedDisplay = this.fixedSites.length > 8 ? 'list' : (this.fixedSites.length > 3 ? 'select' : 'buttons'); + if (['list', 'listnourl', 'select', 'buttons'].indexOf(this.siteSelector) < 0) { + this.siteSelector = this.fixedSites.length > 8 ? 'list' : (this.fixedSites.length > 3 ? 'select' : 'buttons'); } this.filteredSites = this.fixedSites; url = this.fixedSites[0].url;