2017-11-24 11:31:09 +00:00
|
|
|
<ion-header>
|
2018-07-13 11:10:55 +00:00
|
|
|
<ion-navbar core-back-button>
|
2017-12-08 14:53:27 +00:00
|
|
|
<ion-title>{{ 'core.login.connecttomoodle' | translate }}</ion-title>
|
2017-11-24 11:31:09 +00:00
|
|
|
|
|
|
|
<ion-buttons end>
|
2018-10-03 11:17:26 +00:00
|
|
|
<button ion-button icon-only [navPush]="'CoreSettingsListPage'" [attr.aria-label]="'core.mainmenu.appsettings' | translate">
|
|
|
|
<ion-icon name="cog"></ion-icon>
|
|
|
|
</button>
|
2017-12-08 14:53:27 +00:00
|
|
|
<button ion-button icon-only (click)="showHelp()" [attr.aria-label]="'core.help' | translate">
|
2017-11-24 11:31:09 +00:00
|
|
|
<ion-icon name="help-circle"></ion-icon>
|
|
|
|
</button>
|
|
|
|
</ion-buttons>
|
|
|
|
</ion-navbar>
|
|
|
|
</ion-header>
|
2017-12-29 17:05:52 +00:00
|
|
|
<ion-content class="core-center-view">
|
2017-12-18 09:48:04 +00:00
|
|
|
<div class="box">
|
|
|
|
<div text-center padding>
|
|
|
|
<img src="assets/img/login_logo.png" class="avatar-full login-logo" role="presentation">
|
|
|
|
</div>
|
2018-10-08 12:44:20 +00:00
|
|
|
<form ion-list [formGroup]="siteForm" (ngSubmit)="connect(siteForm.value.siteUrl)" *ngIf="!fixedSites || fixedDisplay == 'select'">
|
2017-11-24 11:31:09 +00:00
|
|
|
<!-- Form to input the site URL if there are no fixed sites. -->
|
2018-10-08 12:44:20 +00:00
|
|
|
<ng-container *ngIf="!fixedSites">
|
2017-12-08 14:53:27 +00:00
|
|
|
<p padding>{{ 'core.login.newsitedescription' | translate }}</p>
|
2017-11-24 11:31:09 +00:00
|
|
|
<ion-item>
|
2018-06-15 08:47:44 +00:00
|
|
|
<ion-input type="url" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard"></ion-input>
|
2017-11-24 11:31:09 +00:00
|
|
|
</ion-item>
|
2018-10-08 12:44:20 +00:00
|
|
|
</ng-container>
|
2017-11-24 11:31:09 +00:00
|
|
|
|
2018-10-08 12:44:20 +00:00
|
|
|
<ion-item *ngIf="fixedSites && fixedDisplay == 'select'" margin-vertical text-wrap>
|
|
|
|
<ion-label stacked for="siteSelect">{{ 'core.login.selectsite' | translate }}</ion-label>
|
2018-11-27 07:59:13 +00:00
|
|
|
<ion-select formControlName="siteUrl" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" interface="action-sheet">
|
2018-10-08 12:44:20 +00:00
|
|
|
<ion-option *ngFor="let site of fixedSites" [value]="site.url">{{site.name}}</ion-option>
|
|
|
|
</ion-select>
|
|
|
|
</ion-item>
|
2017-11-24 11:31:09 +00:00
|
|
|
|
2018-10-08 12:44:20 +00:00
|
|
|
<button ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button>
|
2017-12-18 09:48:04 +00:00
|
|
|
</form>
|
2018-10-08 12:44:20 +00:00
|
|
|
<!-- Pick the site from a list of fixed sites. -->
|
|
|
|
<ion-list *ngIf="fixedSites && fixedDisplay == 'list'">
|
|
|
|
<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-item *ngFor="let site of filteredSites" (click)="connect(site.url)" [title]="site.name" detail-push text-wrap>
|
|
|
|
<h2>{{site.name}}</h2>
|
|
|
|
<p>{{site.url}}</p>
|
|
|
|
</ion-item>
|
|
|
|
</ion-list>
|
|
|
|
|
|
|
|
<!-- Display them using buttons. -->
|
|
|
|
<div *ngIf="fixedSites && fixedDisplay == 'buttons'">
|
|
|
|
<p class="padding no-padding-bottom">{{ 'core.login.selectsite' | translate }}</p>
|
|
|
|
<a *ngFor="let site of fixedSites" ion-button block (click)="connect(site.url)" [title]="site.name" margin-bottom>{{site.name}}</a>
|
|
|
|
</div>
|
2017-12-18 09:48:04 +00:00
|
|
|
</div>
|
2017-11-24 11:31:09 +00:00
|
|
|
</ion-content>
|