1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-16 11:37:13 +02:00
pigallery2/frontend/app/settings/share/share.settings.component.html
2017-07-17 18:30:16 +02:00

61 lines
2.2 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">Share settings</h3>
<div class="switch-wrapper col-xs-6">
<bSwitch
class="switch"
name="enabled"
[switch-on-color]="'success'"
[switch-inverse]="'inverse'"
[switch-off-text]="'Disabled'"
[switch-on-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="passwordProtected">Password protected</label>
<div class="col-sm-10">
<bSwitch
id="passwordProtected"
class="switch"
name="passwordProtected"
[switch-on-color]="'primary'"
[switch-disabled]="!settings.enabled"
[switch-inverse]="'inverse'"
[switch-off-text]="'Disabled'"
[switch-on-text]="'Enabled'"
[switch-handle-width]="'100'"
[switch-label-width]="'20'"
[(ngModel)]="settings.passwordProtected">
</bSwitch>
<span class="help-block">Enables password protected sharing links</span>
</div>
</div>
</ng-container>
<div class="panel-info" *ngIf="(!settings.enabled && !_settingsService.isSupported())">
Sharing is not supported with these settings
</div>
<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>