2017-07-15 14:27:12 +02:00
|
|
|
<form #settingsForm="ngForm">
|
|
|
|
<div class="panel panel-default"
|
2017-07-15 17:29:40 +02:00
|
|
|
[ngClass]="settings.enabled && !_settingsService.isSupported()?'panel-warning':''">
|
2017-07-15 14:27:12 +02:00
|
|
|
<div class="panel-heading">
|
2017-07-17 18:30:16 +02:00
|
|
|
<h3 class="panel-title col-xs-6">Search settings</h3>
|
|
|
|
<div class="switch-wrapper col-xs-6">
|
2017-07-15 14:27:12 +02:00
|
|
|
<bSwitch
|
|
|
|
class="switch"
|
|
|
|
name="enabled"
|
|
|
|
[switch-on-color]="'success'"
|
|
|
|
[switch-inverse]="'inverse'"
|
|
|
|
[switch-off-text]="'Disabled'"
|
|
|
|
[switch-on-text]="'Enabled'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[switch-disabled]="inProgress || (!settings.enabled && !_settingsService.isSupported())"
|
2017-07-15 14:27:12 +02:00
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[(ngModel)]="settings.enabled">
|
2017-07-15 14:27:12 +02:00
|
|
|
</bSwitch>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
|
|
|
|
|
2017-07-15 17:29:40 +02:00
|
|
|
<ng-container *ngIf="settings.enabled || _settingsService.isSupported()">
|
2017-07-15 15:29:04 +02:00
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label" for="autocompleteEnabled">Autocomplete</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<bSwitch
|
|
|
|
id="autocompleteEnabled"
|
|
|
|
class="switch"
|
|
|
|
name="autocompleteEnabled"
|
|
|
|
[switch-on-color]="'primary'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[switch-disabled]="!settings.enabled"
|
2017-07-15 15:29:04 +02:00
|
|
|
[switch-inverse]="'inverse'"
|
|
|
|
[switch-off-text]="'Disabled'"
|
|
|
|
[switch-on-text]="'Enabled'"
|
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[(ngModel)]="settings.autocompleteEnabled">
|
2017-07-15 15:29:04 +02:00
|
|
|
</bSwitch>
|
2017-07-15 17:42:50 +02:00
|
|
|
<span class="help-block">Show hints while typing search query</span>
|
2017-07-15 15:29:04 +02:00
|
|
|
</div>
|
2017-07-15 14:27:12 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2017-07-15 15:29:04 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-2 control-label" for="instantSearchEnabled">Instant search</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<bSwitch
|
|
|
|
id="instantSearchEnabled"
|
|
|
|
class="switch"
|
|
|
|
name="instantSearchEnabled"
|
|
|
|
[switch-on-color]="'primary'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[switch-disabled]="!settings.enabled"
|
2017-07-15 15:29:04 +02:00
|
|
|
[switch-inverse]="'inverse'"
|
|
|
|
[switch-off-text]="'Disabled'"
|
|
|
|
[switch-on-text]="'Enabled'"
|
|
|
|
[switch-handle-width]="'100'"
|
|
|
|
[switch-label-width]="'20'"
|
2017-07-15 17:29:40 +02:00
|
|
|
[(ngModel)]="settings.instantSearchEnabled">
|
2017-07-15 15:29:04 +02:00
|
|
|
</bSwitch>
|
2017-07-15 17:42:50 +02:00
|
|
|
<span class="help-block">Enables showing search results, while typing search query</span>
|
2017-07-15 15:29:04 +02:00
|
|
|
</div>
|
2017-07-15 14:27:12 +02:00
|
|
|
</div>
|
|
|
|
|
2017-07-15 15:29:04 +02:00
|
|
|
</ng-container>
|
2017-07-15 17:29:40 +02:00
|
|
|
<div class="panel-info" *ngIf="(!settings.enabled && !_settingsService.isSupported())">
|
2017-07-15 15:29:04 +02:00
|
|
|
Search is not supported with these settings
|
|
|
|
</div>
|
2017-07-15 14:27:12 +02:00
|
|
|
<button class="btn btn-success pull-right"
|
|
|
|
[disabled]="!settingsForm.form.valid || !changed || inProgress"
|
|
|
|
(click)="save()">Save
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-default pull-right"
|
|
|
|
(click)="reset()">Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|