2017-07-15 20:27:12 +08:00
|
|
|
<form #settingsForm="ngForm">
|
2018-05-14 04:59:57 +08:00
|
|
|
<div class="card mb-4"
|
2017-07-15 23:29:40 +08:00
|
|
|
[ngClass]="settings.enabled && !_settingsService.isSupported()?'panel-warning':''">
|
2018-05-14 04:59:57 +08:00
|
|
|
<h5 class="card-header">
|
|
|
|
<ng-container i18n>Search settings</ng-container>
|
|
|
|
<div class="switch-wrapper">
|
2017-07-15 20:27:12 +08:00
|
|
|
<bSwitch
|
|
|
|
class="switch"
|
|
|
|
name="enabled"
|
|
|
|
[switch-on-color]="'success'"
|
|
|
|
[switch-inverse]="'inverse'"
|
2018-03-30 08:30:23 +08:00
|
|
|
[switch-off-text]="text.Disabled"
|
|
|
|
[switch-on-text]="text.Enabled"
|
2017-07-15 23:29:40 +08:00
|
|
|
[switch-disabled]="inProgress || (!settings.enabled && !_settingsService.isSupported())"
|
2017-07-15 20:27:12 +08:00
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 23:29:40 +08:00
|
|
|
[(ngModel)]="settings.enabled">
|
2017-07-15 20:27:12 +08:00
|
|
|
</bSwitch>
|
|
|
|
</div>
|
2018-05-14 04:59:57 +08:00
|
|
|
</h5>
|
|
|
|
<div class="card-body">
|
2017-07-15 20:27:12 +08:00
|
|
|
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
|
|
|
|
|
2017-07-15 23:29:40 +08:00
|
|
|
<ng-container *ngIf="settings.enabled || _settingsService.isSupported()">
|
2017-07-15 21:29:04 +08:00
|
|
|
|
2018-05-14 04:59:57 +08:00
|
|
|
<div class="form-group row">
|
|
|
|
<label class="col-md-2 control-label" for="autocompleteEnabled" i18n>Autocomplete</label>
|
|
|
|
<div class="col-md-10">
|
2017-07-15 21:29:04 +08:00
|
|
|
<bSwitch
|
|
|
|
id="autocompleteEnabled"
|
|
|
|
class="switch"
|
|
|
|
name="autocompleteEnabled"
|
|
|
|
[switch-on-color]="'primary'"
|
2017-07-15 23:29:40 +08:00
|
|
|
[switch-disabled]="!settings.enabled"
|
2017-07-15 21:29:04 +08:00
|
|
|
[switch-inverse]="'inverse'"
|
2018-03-30 08:30:23 +08:00
|
|
|
[switch-off-text]="text.Disabled"
|
|
|
|
[switch-on-text]="text.Enabled"
|
2017-07-15 21:29:04 +08:00
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 23:29:40 +08:00
|
|
|
[(ngModel)]="settings.autocompleteEnabled">
|
2017-07-15 21:29:04 +08:00
|
|
|
</bSwitch>
|
2018-05-14 04:59:57 +08:00
|
|
|
<small class="form-text text-muted" i18n>Show hints while typing search query</small>
|
2017-07-15 21:29:04 +08:00
|
|
|
</div>
|
2017-07-15 20:27:12 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2018-05-14 04:59:57 +08:00
|
|
|
<div class="form-group row">
|
|
|
|
<label class="col-md-2 control-label" for="instantSearchEnabled" i18n>Instant search</label>
|
|
|
|
<div class="col-md-10">
|
2017-07-15 21:29:04 +08:00
|
|
|
<bSwitch
|
|
|
|
id="instantSearchEnabled"
|
|
|
|
class="switch"
|
|
|
|
name="instantSearchEnabled"
|
|
|
|
[switch-on-color]="'primary'"
|
2017-07-15 23:29:40 +08:00
|
|
|
[switch-disabled]="!settings.enabled"
|
2017-07-15 21:29:04 +08:00
|
|
|
[switch-inverse]="'inverse'"
|
2018-03-30 08:30:23 +08:00
|
|
|
[switch-off-text]="text.Disabled"
|
|
|
|
[switch-on-text]="text.Enabled"
|
2017-07-15 21:29:04 +08:00
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 23:29:40 +08:00
|
|
|
[(ngModel)]="settings.instantSearchEnabled">
|
2017-07-15 21:29:04 +08:00
|
|
|
</bSwitch>
|
2018-05-14 04:59:57 +08:00
|
|
|
<small class="form-text text-muted" i18n>Enables showing search results, while typing search query</small>
|
2017-07-15 21:29:04 +08:00
|
|
|
</div>
|
2017-07-15 20:27:12 +08:00
|
|
|
</div>
|
|
|
|
|
2017-07-15 21:29:04 +08:00
|
|
|
</ng-container>
|
2017-12-25 07:42:25 +08:00
|
|
|
<div class="panel-info" *ngIf="(!settings.enabled && !_settingsService.isSupported())" i18n>
|
2017-07-15 21:29:04 +08:00
|
|
|
Search is not supported with these settings
|
|
|
|
</div>
|
2018-05-14 04:59:57 +08:00
|
|
|
<button class="btn btn-success float-right"
|
2017-07-15 20:27:12 +08:00
|
|
|
[disabled]="!settingsForm.form.valid || !changed || inProgress"
|
2017-12-25 07:42:25 +08:00
|
|
|
(click)="save()" i18n>Save
|
2017-07-15 20:27:12 +08:00
|
|
|
</button>
|
2018-05-14 04:59:57 +08:00
|
|
|
<button class="btn btn-default float-right"
|
2017-12-25 07:42:25 +08:00
|
|
|
(click)="reset()" i18n>Reset
|
2017-07-15 20:27:12 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|