2017-11-27 11:57:52 +01:00
|
|
|
|
<ion-header>
|
|
|
|
|
<ion-navbar>
|
|
|
|
|
<ion-title>{{ 'mm.login.login' | translate }}</ion-title>
|
|
|
|
|
</ion-navbar>
|
|
|
|
|
</ion-header>
|
|
|
|
|
<ion-content padding class="mm-center-view">
|
|
|
|
|
<core-loading [hideUntil]="pageLoaded" class="mm-view-content">
|
|
|
|
|
<ion-list no-lines class="box">
|
|
|
|
|
<ion-item text-wrap class="text-center">
|
|
|
|
|
<!-- Show site logo or a default image. -->
|
|
|
|
|
<img *ngIf="logoUrl" [src]="logoUrl" role="presentation">
|
|
|
|
|
<img *ngIf="!logoUrl" src="assets/img/logo.png" class="moodle-logo" role="presentation">
|
|
|
|
|
|
|
|
|
|
<!-- If no sitename show big siteurl. -->
|
|
|
|
|
<p *ngIf="!siteName" padding class="item-heading mm-siteurl">{{siteUrl}}</p>
|
|
|
|
|
<!-- If sitename, show big sitename and small siteurl. -->
|
|
|
|
|
<p *ngIf="siteName" padding class="item-heading mm-sitename">{{siteName}}</p>
|
|
|
|
|
<p *ngIf="siteName" class="mm-siteurl">{{siteUrl}}</p>
|
|
|
|
|
</ion-item>
|
|
|
|
|
<form [formGroup]="credForm" (ngSubmit)="login()">
|
|
|
|
|
<ion-item *ngIf="siteChecked && !isBrowserSSO">
|
|
|
|
|
<ion-input type="text" name="username" placeholder="{{ 'mm.login.username' | translate }}" formControlName="username" autocapitalize="none" autocorrect="off"></ion-input>
|
|
|
|
|
</ion-item>
|
|
|
|
|
<ion-item *ngIf="siteChecked && !isBrowserSSO">
|
2017-11-29 16:03:47 +01:00
|
|
|
|
<core-show-password item-content [name]="'password'">
|
|
|
|
|
<ion-input class="mm-ioninput-password" name="password" type="password" placeholder="{{ 'mm.login.password' | translate }}" formControlName="password" mm-show-password></ion-input>
|
|
|
|
|
</core-show-password>
|
2017-11-27 11:57:52 +01:00
|
|
|
|
</ion-item>
|
|
|
|
|
<button ion-button block color="primary" [disabled]="siteChecked && !isBrowserSSO && !credForm.valid">{{ 'mm.login.loginbutton' | translate }}</button>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<!-- Forgotten password button. -->
|
|
|
|
|
<div padding-top>
|
2017-11-29 16:03:47 +01:00
|
|
|
|
<button ion-button block text-wrap (click)="forgottenPassword()">{{ 'mm.login.forgotten' | translate }}</button>
|
2017-11-27 11:57:52 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="identityProviders && identityProviders.length" padding-top>
|
|
|
|
|
<p>{{ 'mm.login.potentialidps' | translate }}</p>
|
|
|
|
|
<ion-item *ngFor="let provider of identityProviders" text-wrap class="mm-oauth-icon" (click)="oauthClicked(provider)" title="{{provider.name}}">
|
|
|
|
|
<img [src]="provider.iconurl" alt="{{provider.name}}">
|
|
|
|
|
<span>{{provider.name}}</span>
|
|
|
|
|
<ion-icon class="icon-accessory" name="arrow-forward" md="ios-arrow-forward" item-end></ion-icon>
|
|
|
|
|
</ion-item>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="canSignup">
|
|
|
|
|
<ion-item text-wrap>
|
|
|
|
|
<p class="item-heading">{{ 'mm.login.firsttime' | translate }}</p>
|
2017-11-29 16:03:47 +01:00
|
|
|
|
<p *ngIf="authInstructions"><core-format-text [text]="authInstructions"></core-format-text></p>
|
2017-11-27 11:57:52 +01:00
|
|
|
|
</ion-item>
|
|
|
|
|
<button ion-button block (click)="signup()">{{ 'mm.login.startsignup' | translate }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
</ion-list>
|
|
|
|
|
</core-loading>
|
|
|
|
|
</ion-content>
|