commit
ccafdd32cd
|
@ -1153,7 +1153,7 @@
|
||||||
"core.course.couldnotloadsectioncontent": "local_moodlemobileapp",
|
"core.course.couldnotloadsectioncontent": "local_moodlemobileapp",
|
||||||
"core.course.couldnotloadsections": "local_moodlemobileapp",
|
"core.course.couldnotloadsections": "local_moodlemobileapp",
|
||||||
"core.course.coursesummary": "moodle",
|
"core.course.coursesummary": "moodle",
|
||||||
"core.course.downloadcourse": "local_moodlemobileapp",
|
"core.course.downloadcourse": "tool_mobile",
|
||||||
"core.course.errordownloadingcourse": "local_moodlemobileapp",
|
"core.course.errordownloadingcourse": "local_moodlemobileapp",
|
||||||
"core.course.errordownloadingsection": "local_moodlemobileapp",
|
"core.course.errordownloadingsection": "local_moodlemobileapp",
|
||||||
"core.course.errorgetmodule": "local_moodlemobileapp",
|
"core.course.errorgetmodule": "local_moodlemobileapp",
|
||||||
|
@ -1269,6 +1269,7 @@
|
||||||
"core.fileuploader.uploading": "local_moodlemobileapp",
|
"core.fileuploader.uploading": "local_moodlemobileapp",
|
||||||
"core.fileuploader.uploadingperc": "local_moodlemobileapp",
|
"core.fileuploader.uploadingperc": "local_moodlemobileapp",
|
||||||
"core.fileuploader.video": "local_moodlemobileapp",
|
"core.fileuploader.video": "local_moodlemobileapp",
|
||||||
|
"core.login.findyoursite": "local_moodlemobileapp",
|
||||||
"core.folder": "moodle",
|
"core.folder": "moodle",
|
||||||
"core.forcepasswordchangenotice": "moodle",
|
"core.forcepasswordchangenotice": "moodle",
|
||||||
"core.fulllistofcourses": "moodle",
|
"core.fulllistofcourses": "moodle",
|
||||||
|
|
|
@ -53,8 +53,8 @@
|
||||||
"switchphase50": "Close workshop",
|
"switchphase50": "Close workshop",
|
||||||
"userplan": "Workshop planner",
|
"userplan": "Workshop planner",
|
||||||
"userplancurrentphase": "Current phase",
|
"userplancurrentphase": "Current phase",
|
||||||
"warningassessmentmodified": "The submission was modified on the site.",
|
"warningassessmentmodified": "The assessment was modified on the site.",
|
||||||
"warningsubmissionmodified": "The assessment was modified on the site.",
|
"warningsubmissionmodified": "The submission was modified on the site.",
|
||||||
"weightinfo": "Weight: {{$a}}",
|
"weightinfo": "Weight: {{$a}}",
|
||||||
"yourassessment": "Your assessment",
|
"yourassessment": "Your assessment",
|
||||||
"yourassessmentfor": "Your assessment for {{$a}}",
|
"yourassessmentfor": "Your assessment for {{$a}}",
|
||||||
|
|
|
@ -752,8 +752,8 @@
|
||||||
"addon.mod_workshop.switchphase50": "Close workshop",
|
"addon.mod_workshop.switchphase50": "Close workshop",
|
||||||
"addon.mod_workshop.userplan": "Workshop planner",
|
"addon.mod_workshop.userplan": "Workshop planner",
|
||||||
"addon.mod_workshop.userplancurrentphase": "Current phase",
|
"addon.mod_workshop.userplancurrentphase": "Current phase",
|
||||||
"addon.mod_workshop.warningassessmentmodified": "The submission was modified on the site.",
|
"addon.mod_workshop.warningassessmentmodified": "The assessment was modified on the site.",
|
||||||
"addon.mod_workshop.warningsubmissionmodified": "The assessment was modified on the site.",
|
"addon.mod_workshop.warningsubmissionmodified": "The submission was modified on the site.",
|
||||||
"addon.mod_workshop.weightinfo": "Weight: {{$a}}",
|
"addon.mod_workshop.weightinfo": "Weight: {{$a}}",
|
||||||
"addon.mod_workshop.yourassessment": "Your assessment",
|
"addon.mod_workshop.yourassessment": "Your assessment",
|
||||||
"addon.mod_workshop.yourassessmentfor": "Your assessment for {{$a}}",
|
"addon.mod_workshop.yourassessmentfor": "Your assessment for {{$a}}",
|
||||||
|
@ -1328,6 +1328,7 @@
|
||||||
"core.login.erroraccesscontrolalloworigin": "The cross-origin call you're trying to perform has been rejected. Please check https://docs.moodle.org/dev/Moodle_Mobile_development_using_Chrome_or_Chromium",
|
"core.login.erroraccesscontrolalloworigin": "The cross-origin call you're trying to perform has been rejected. Please check https://docs.moodle.org/dev/Moodle_Mobile_development_using_Chrome_or_Chromium",
|
||||||
"core.login.errordeletesite": "An error occurred while deleting this site. Please try again.",
|
"core.login.errordeletesite": "An error occurred while deleting this site. Please try again.",
|
||||||
"core.login.errorupdatesite": "An error occurred while updating the site's token.",
|
"core.login.errorupdatesite": "An error occurred while updating the site's token.",
|
||||||
|
"core.login.findyoursite": "Find your site",
|
||||||
"core.login.firsttime": "Is this your first time here?",
|
"core.login.firsttime": "Is this your first time here?",
|
||||||
"core.login.forgotten": "Forgotten your username or password?",
|
"core.login.forgotten": "Forgotten your username or password?",
|
||||||
"core.login.getanothercaptcha": "Get another CAPTCHA",
|
"core.login.getanothercaptcha": "Get another CAPTCHA",
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"erroraccesscontrolalloworigin": "The cross-origin call you're trying to perform has been rejected. Please check https://docs.moodle.org/dev/Moodle_Mobile_development_using_Chrome_or_Chromium",
|
"erroraccesscontrolalloworigin": "The cross-origin call you're trying to perform has been rejected. Please check https://docs.moodle.org/dev/Moodle_Mobile_development_using_Chrome_or_Chromium",
|
||||||
"errordeletesite": "An error occurred while deleting this site. Please try again.",
|
"errordeletesite": "An error occurred while deleting this site. Please try again.",
|
||||||
"errorupdatesite": "An error occurred while updating the site's token.",
|
"errorupdatesite": "An error occurred while updating the site's token.",
|
||||||
|
"findyoursite": "Find your site",
|
||||||
"firsttime": "Is this your first time here?",
|
"firsttime": "Is this your first time here?",
|
||||||
"forgotten": "Forgotten your username or password?",
|
"forgotten": "Forgotten your username or password?",
|
||||||
"getanothercaptcha": "Get another CAPTCHA",
|
"getanothercaptcha": "Get another CAPTCHA",
|
||||||
|
|
|
@ -17,33 +17,39 @@
|
||||||
<div text-center padding>
|
<div text-center padding>
|
||||||
<img src="assets/img/login_logo.png" class="avatar-full login-logo" role="presentation">
|
<img src="assets/img/login_logo.png" class="avatar-full login-logo" role="presentation">
|
||||||
</div>
|
</div>
|
||||||
<form ion-list [formGroup]="siteForm" (ngSubmit)="connect(siteForm.value.siteUrl)">
|
<form ion-list [formGroup]="siteForm" (ngSubmit)="connect(siteForm.value.siteUrl)" *ngIf="!fixedSites || fixedDisplay == 'select'">
|
||||||
<!-- Form to input the site URL if there are no fixed sites. -->
|
<!-- Form to input the site URL if there are no fixed sites. -->
|
||||||
<div *ngIf="!fixedSites">
|
<ng-container *ngIf="!fixedSites">
|
||||||
<p padding>{{ 'core.login.newsitedescription' | translate }}</p>
|
<p padding>{{ 'core.login.newsitedescription' | translate }}</p>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-input type="url" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard"></ion-input>
|
<ion-input type="url" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard"></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Pick the site from a list of fixed sites. -->
|
<ion-item *ngIf="fixedSites && fixedDisplay == 'select'" margin-vertical text-wrap>
|
||||||
<div *ngIf="fixedSites" text-wrap>
|
<ion-label stacked for="siteSelect">{{ 'core.login.selectsite' | translate }}</ion-label>
|
||||||
<!-- Display them using a select. -->
|
<ion-select formControlName="siteUrl" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" interface="popover">
|
||||||
<ion-item *ngIf="!displayAsButtons" margin-vertical>
|
<ion-option *ngFor="let site of fixedSites" [value]="site.url">{{site.name}}</ion-option>
|
||||||
<ion-label stacked for="siteSelect">{{ 'core.login.selectsite' | translate }}</ion-label>
|
</ion-select>
|
||||||
<ion-select formControlName="siteUrl" name="url" placeholder="{{ 'core.login.siteaddress' | translate }}" interface="popover">
|
</ion-item>
|
||||||
<ion-option *ngFor="let site of fixedSites" [value]="site.url">{{site.name}}</ion-option>
|
|
||||||
</ion-select>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<!-- Display them using buttons. -->
|
<button ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button>
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button *ngIf="!fixedSites || !displayAsButtons" ion-button block [disabled]="!siteForm.valid">{{ 'core.login.connect' | translate }}</button>
|
|
||||||
</form>
|
</form>
|
||||||
|
<!-- 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>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
@ -36,4 +36,12 @@ ion-app.app-root page-core-login-site {
|
||||||
.item-input:last-child {
|
.item-input:last-child {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.searchbar-ios {
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
.searchbar-input {
|
||||||
|
background-color: $searchbar-ios-toolbar-input-background
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -32,8 +32,10 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
export class CoreLoginSitePage {
|
export class CoreLoginSitePage {
|
||||||
siteForm: FormGroup;
|
siteForm: FormGroup;
|
||||||
fixedSites: any[];
|
fixedSites: any[];
|
||||||
displayAsButtons = false;
|
filteredSites: any[];
|
||||||
|
fixedDisplay = 'buttons';
|
||||||
showKeyboard = false;
|
showKeyboard = false;
|
||||||
|
filter = '';
|
||||||
|
|
||||||
constructor(navParams: NavParams, private navCtrl: NavController, fb: FormBuilder, private appProvider: CoreAppProvider,
|
constructor(navParams: NavParams, private navCtrl: NavController, fb: FormBuilder, private appProvider: CoreAppProvider,
|
||||||
private sitesProvider: CoreSitesProvider, private loginHelper: CoreLoginHelperProvider,
|
private sitesProvider: CoreSitesProvider, private loginHelper: CoreLoginHelperProvider,
|
||||||
|
@ -46,7 +48,12 @@ export class CoreLoginSitePage {
|
||||||
// Load fixed sites if they're set.
|
// Load fixed sites if they're set.
|
||||||
if (this.loginHelper.hasSeveralFixedSites()) {
|
if (this.loginHelper.hasSeveralFixedSites()) {
|
||||||
this.fixedSites = <any[]> this.loginHelper.getFixedSites();
|
this.fixedSites = <any[]> this.loginHelper.getFixedSites();
|
||||||
this.displayAsButtons = CoreConfigConstants.multisitesdisplay == 'buttons';
|
this.fixedDisplay = CoreConfigConstants.multisitesdisplay;
|
||||||
|
// Autoselect if not defined.
|
||||||
|
if (['list', 'select', 'buttons'].indexOf(this.fixedDisplay) < 0) {
|
||||||
|
this.fixedDisplay = this.fixedSites.length > 8 ? 'list' : (this.fixedSites.length > 3 ? 'select' : 'buttons');
|
||||||
|
}
|
||||||
|
this.filteredSites = this.fixedSites;
|
||||||
url = this.fixedSites[0].url;
|
url = this.fixedSites[0].url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +120,22 @@ export class CoreLoginSitePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The filter has changed.
|
||||||
|
*
|
||||||
|
* @param {any} Received Event.
|
||||||
|
*/
|
||||||
|
filterChanged(event: any): void {
|
||||||
|
const newValue = event.target.value && event.target.value.trim().toLowerCase();
|
||||||
|
if (!newValue || !this.fixedSites) {
|
||||||
|
this.filteredSites = this.fixedSites;
|
||||||
|
} else {
|
||||||
|
this.filteredSites = this.fixedSites.filter((site) => {
|
||||||
|
return site.name.toLowerCase().indexOf(newValue) > -1 || site.url.toLowerCase().indexOf(newValue) > -1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a help modal.
|
* Show a help modal.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue