1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/settings/search/search.settings.component.html
2018-03-29 20:30:23 -04:00

82 lines
3.1 KiB
HTML

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