2017-11-24 12:31:09 +01:00
< ion-header >
2018-07-13 13:10:55 +02:00
< ion-navbar core-back-button >
2017-12-08 15:53:27 +01:00
< ion-title > {{ 'core.login.connecttomoodle' | translate }}< / ion-title >
2017-11-24 12:31:09 +01:00
< ion-buttons end >
2020-01-30 09:48:43 +01:00
< button ion-button icon-only navPush = "CoreAppSettingsPage" [ attr . aria-label ] = " ' core . settings . appsettings ' | translate " >
2020-01-28 11:53:32 +01:00
< core-icon name = "fa-cogs" > < / core-icon >
2018-10-03 13:17:26 +02:00
< / button >
2017-11-24 12:31:09 +01:00
< / ion-buttons >
< / ion-navbar >
< / ion-header >
2020-04-16 10:53:41 +02:00
< ion-content padding >
< div >
< div text-center padding margin-bottom [ class . hidden ] = " hasSites " class = "core-login-site-logo" >
2017-12-18 10:48:04 +01:00
< img src = "assets/img/login_logo.png" class = "avatar-full login-logo" role = "presentation" >
< / div >
2020-01-31 14:53:13 +01:00
< form ion-list [ formGroup ] = " siteForm " ( ngSubmit ) = " connect ( $ event , siteForm . value . siteUrl ) " * ngIf = "!fixedSites || fixedDisplay == 'select'" # siteFormEl >
2017-11-24 12:31:09 +01:00
<!-- Form to input the site URL if there are no fixed sites. -->
2018-10-08 14:44:20 +02:00
< ng-container * ngIf = "!fixedSites" >
2017-11-24 12:31:09 +01:00
< ion-item >
2020-03-31 16:22:34 +02:00
< ion-label stacked > < h2 > {{ 'core.login.siteaddress' | translate }}< / h2 > < / ion-label >
2020-04-16 10:53:41 +02:00
< ion-input type = "url" name = "url" placeholder = "https://campus.example.edu" formControlName = "siteUrl" [ core-auto-focus ] = " showKeyboard " ( ionChange ) = " searchSite ( $ event , siteForm . value . siteUrl ) " > < / ion-input >
2017-11-24 12:31:09 +01:00
< / ion-item >
2018-10-08 14:44:20 +02:00
< / ng-container >
2017-11-24 12:31:09 +01:00
2020-04-16 10:53:41 +02:00
< ion-list * ngIf = "!fixedSites" [ class . hidden ] = " ! hasSites " class = "core-login-site-list" [ class . dimmed ] = " loadingSites " >
< div * ngIf = "loadingSites" class = "core-login-site-list-loading" > < ion-spinner > < / ion-spinner > < / div >
< ion-item no-lines class = "core-login-site-list-title" * ngIf = "onlyWrittenSite" > < h2 class = "item-heading" > {{ 'core.login.selectsite' | translate }}< / h2 > < / ion-item >
< ion-item * ngFor = "let site of sites" ( click ) = " connect ( $ event , site . url , site ) " [ title ] = " site . name " detail-push [ class . core-login-entered-site ] = " ! site . fromWS " >
< ion-thumbnail item-start >
< core-icon name = "fa-pencil" * ngIf = "!site.imageurl && !site.fromWS" > < / core-icon >
< img [ src ] = " site . imageurl " * ngIf = "site.imageurl" >
< img src = "assets/icon/icon.png" * ngIf = "!site.imageurl && site.fromWS" class = "core-login-default-icon" >
< / ion-thumbnail >
< h2 text-wrap > {{site.name}}< ng-container * ngIf = "site.alias" > ({{site.alias}})< / ng-container > < / h2 >
< p > {{site.noProtocolUrl}}< / p >
< p * ngIf = "site.country || site.city" text-wrap > < ng-container * ngIf = "site.city" > {{site.city}} - < / ng-container > {{site.country}}< / p >
< / ion-item >
< / ion-list >
< div * ngIf = "!fixedSites && !hasSites && loadingSites" class = "core-login-site-nolist-loading" > < ion-spinner > < / ion-spinner > < / div >
<!-- Pick the site from a list of fixed sites. -->
2018-10-08 14:44:20 +02: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 08:59:13 +01:00
< ion-select formControlName = "siteUrl" name = "url" placeholder = "{{ 'core.login.siteaddress' | translate }}" interface = "action-sheet" >
2018-10-08 14:44:20 +02:00
< ion-option * ngFor = "let site of fixedSites" [ value ] = " site . url " > {{site.name}}< / ion-option >
< / ion-select >
< / ion-item >
2019-10-11 12:44:33 +02:00
2020-04-23 11:28:31 +02:00
< ng-container * ngIf = "!fixedSites && showScanQR && !hasSites" >
< div class = "core-login-site-qrcode-separator" > {{ 'core.login.or' | translate }}< / div >
< ion-item >
< a ion-button block color = "light" margin-top icon-start ( click ) = " scanQR ( ) " >
< core-icon name = "fa-qrcode" aria-hidden = "true" > < / core-icon >
{{ 'core.scanqr' | translate }}
< / a >
< / ion-item >
< / ng-container >
2017-12-18 10:48:04 +01:00
< / form >
2020-04-16 10:53:41 +02:00
2018-10-08 14:44:20 +02:00
<!-- Pick the site from a list of fixed sites. -->
2019-02-20 13:37:47 +01:00
< ion-list * ngIf = "fixedSites && (fixedDisplay == 'list' || fixedDisplay == 'listnourl')" >
2019-02-20 15:25:27 +01:00
< ion-item no-lines > < h2 class = "item-heading" > {{ 'core.login.selectsite' | translate }}< / h2 > < / ion-item >
2018-10-08 14:44:20 +02:00
< ion-searchbar * ngIf = "fixedSites.length > 4" [ ( ngModel ) ] = " filter " ( ionInput ) = " filterChanged ( $ event ) " ( ionCancel ) = " filterChanged ( ) " [ placeholder ] = " ' core . login . findyoursite ' | translate " > < / ion-searchbar >
2018-12-04 10:38:35 +01:00
< ion-item * ngFor = "let site of filteredSites" ( click ) = " connect ( $ event , site . url ) " [ title ] = " site . name " detail-push text-wrap >
2018-10-08 14:44:20 +02:00
< h2 > {{site.name}}< / h2 >
2019-02-20 13:37:47 +01:00
< p * ngIf = "fixedDisplay == 'list'" > {{site.url}}< / p >
2018-10-08 14:44:20 +02:00
< / ion-item >
< / ion-list >
<!-- Display them using buttons. -->
< div * ngIf = "fixedSites && fixedDisplay == 'buttons'" >
< p class = "padding no-padding-bottom" > {{ 'core.login.selectsite' | translate }}< / p >
2018-12-04 10:38:35 +01:00
< a * ngFor = "let site of fixedSites" ion-button block ( click ) = " connect ( $ event , site . url ) " [ title ] = " site . name " margin-bottom > {{site.name}}< / a >
2018-10-08 14:44:20 +02:00
< / div >
2020-03-31 16:22:34 +02:00
<!-- Help. -->
2020-04-16 10:53:41 +02:00
< ion-list no-lines margin-top >
< a ion-item text-center text-wrap class = "core-login-need-help" ( click ) = " showHelp ( ) " detail-none >
2020-03-31 16:22:34 +02:00
{{ 'core.needhelp' | translate }}
< / a >
< / ion-list >
2017-12-18 10:48:04 +01:00
< / div >
2017-11-24 12:31:09 +01:00
< / ion-content >