47 lines
2.4 KiB
HTML
Raw Normal View History

2017-11-24 12:31:09 +01:00
<ion-header>
<ion-navbar core-back-button>
<ion-title>{{ 'core.login.connecttomoodle' | translate }}</ion-title>
2017-11-24 12:31:09 +01:00
<ion-buttons end>
<button ion-button icon-only (click)="showHelp()" [attr.aria-label]="'core.help' | translate">
2017-11-24 12:31:09 +01:00
<ion-icon name="help-circle"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
2017-12-29 18:05:52 +01:00
<ion-content class="core-center-view">
2017-12-18 10:48:04 +01:00
<div class="box">
<div text-center padding>
<img src="assets/img/login_logo.png" class="avatar-full login-logo" role="presentation">
</div>
<form ion-list no-lines [formGroup]="siteForm" (ngSubmit)="connect(siteForm.value.siteUrl)">
2017-11-24 12:31:09 +01:00
<!-- Form to input the site URL if there are no fixed sites. -->
<div *ngIf="!fixedSites">
<p padding>{{ 'core.login.newsitedescription' | translate }}</p>
2017-11-24 12:31:09 +01:00
<ion-item>
<ion-input type="url" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard"></ion-input>
2017-11-24 12:31:09 +01:00
</ion-item>
</div>
<!-- Pick the site from a list of fixed sites. -->
<div *ngIf="fixedSites" text-wrap>
<!-- Display them using a select. -->
<ion-item *ngIf="!displayAsButtons" margin-vertical>
<ion-label stacked for="siteSelect">{{ 'core.login.selectsite' | translate }}</ion-label>
<ion-select formControlName="siteUrl" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" interface="popover">
2017-11-24 12:31:09 +01:00
<ion-option *ngFor="let site of fixedSites" [value]="site.url">{{site.name}}</ion-option>
</ion-select>
</ion-item>
<!-- Display them using buttons. -->
<div *ngIf="displayAsButtons">
<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>
2017-11-24 12:31:09 +01:00
</div>
</div>
2017-12-18 10:48:04 +01:00
<button *ngIf="!fixedSites || !displayAsButtons" ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button>
</form>
</div>
2017-11-24 12:31:09 +01:00
</ion-content>