MOBILE-2888 login: Make url optional in multi site selector

main
Pau Ferrer Ocaña 2019-02-20 13:37:47 +01:00
parent 019c7ab73f
commit 6663fe0bb4
2 changed files with 3 additions and 3 deletions

View File

@ -36,13 +36,13 @@
<button ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button> <button ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button>
</form> </form>
<!-- Pick the site from a list of fixed sites. --> <!-- Pick the site from a list of fixed sites. -->
<ion-list *ngIf="fixedSites && fixedDisplay == 'list'"> <ion-list *ngIf="fixedSites && (fixedDisplay == 'list' || fixedDisplay == 'listnourl')">
<p class="padding no-padding-bottom">{{ 'core.login.selectsite' | translate }}</p> <p class="padding no-padding-bottom">{{ 'core.login.selectsite' | translate }}</p>
<ion-searchbar *ngIf="fixedSites.length > 4" [(ngModel)]="filter" (ionInput)="filterChanged($event)" (ionCancel)="filterChanged()" [placeholder]="'core.login.findyoursite' | translate"></ion-searchbar> <ion-searchbar *ngIf="fixedSites.length > 4" [(ngModel)]="filter" (ionInput)="filterChanged($event)" (ionCancel)="filterChanged()" [placeholder]="'core.login.findyoursite' | translate"></ion-searchbar>
<ion-item *ngFor="let site of filteredSites" (click)="connect($event, site.url)" [title]="site.name" detail-push text-wrap> <ion-item *ngFor="let site of filteredSites" (click)="connect($event, site.url)" [title]="site.name" detail-push text-wrap>
<h2>{{site.name}}</h2> <h2>{{site.name}}</h2>
<p>{{site.url}}</p> <p *ngIf="fixedDisplay == 'list'">{{site.url}}</p>
</ion-item> </ion-item>
</ion-list> </ion-list>

View File

@ -50,7 +50,7 @@ export class CoreLoginSitePage {
this.fixedSites = <any[]> this.loginHelper.getFixedSites(); this.fixedSites = <any[]> this.loginHelper.getFixedSites();
this.fixedDisplay = CoreConfigConstants.multisitesdisplay; this.fixedDisplay = CoreConfigConstants.multisitesdisplay;
// Autoselect if not defined. // Autoselect if not defined.
if (['list', 'select', 'buttons'].indexOf(this.fixedDisplay) < 0) { if (['list', 'listnourl', 'select', 'buttons'].indexOf(this.fixedDisplay) < 0) {
this.fixedDisplay = this.fixedSites.length > 8 ? 'list' : (this.fixedSites.length > 3 ? 'select' : 'buttons'); this.fixedDisplay = this.fixedSites.length > 8 ? 'list' : (this.fixedSites.length > 3 ? 'select' : 'buttons');
} }
this.filteredSites = this.fixedSites; this.filteredSites = this.fixedSites;