mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
3 changed files with 157 additions and 136 deletions
@ -1,138 +1,144 @@ |
|||||
<div mat-dialog-title>{{ data.categoryName }} › {{ data.rule.name }}</div> |
<div mat-dialog-title>{{ data.categoryName }} › {{ data.rule.name }}</div> |
||||
|
|
||||
<div class="py-3" mat-dialog-content> |
<form class="d-flex flex-column h-100" [formGroup]="form" (ngSubmit)="onSave()"> |
||||
@if ( |
<div class="py-3" mat-dialog-content> |
||||
data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax |
@if ( |
||||
) { |
data.rule.configuration.thresholdMin && |
||||
<div class="w-100"> |
data.rule.configuration.thresholdMax |
||||
<h6 class="d-flex mb-0"> |
) { |
||||
<ng-container i18n>Threshold range</ng-container>: |
<div class="w-100"> |
||||
<gf-value |
<h6 class="d-flex mb-0"> |
||||
class="ml-1" |
<ng-container i18n>Threshold range</ng-container>: |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
<gf-value |
||||
[locale]="data.locale" |
class="ml-1" |
||||
[precision]="2" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[value]="data.settings.thresholdMin" |
[locale]="data.locale" |
||||
/> |
[precision]="2" |
||||
<span class="mx-1">-</span> |
[value]="form.value.thresholdMin" |
||||
<gf-value |
/> |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
<span class="mx-1">-</span> |
||||
[locale]="data.locale" |
<gf-value |
||||
[precision]="2" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[value]="data.settings.thresholdMax" |
[locale]="data.locale" |
||||
/> |
[precision]="2" |
||||
</h6> |
[value]="form.value.thresholdMax" |
||||
<div class="align-items-center d-flex w-100"> |
/> |
||||
<gf-value |
</h6> |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
<div class="align-items-center d-flex w-100"> |
||||
[locale]="data.locale" |
<gf-value |
||||
[precision]="2" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[value]="data.rule.configuration.threshold.min" |
[locale]="data.locale" |
||||
/> |
[precision]="2" |
||||
<mat-slider |
[value]="data.rule.configuration.threshold.min" |
||||
class="flex-grow-1" |
/> |
||||
[max]="data.rule.configuration.threshold.max" |
<mat-slider |
||||
[min]="data.rule.configuration.threshold.min" |
class="flex-grow-1" |
||||
[step]="data.rule.configuration.threshold.step" |
[max]="data.rule.configuration.threshold.max" |
||||
> |
[min]="data.rule.configuration.threshold.min" |
||||
<input matSliderStartThumb [(ngModel)]="data.settings.thresholdMin" /> |
[step]="data.rule.configuration.threshold.step" |
||||
<input matSliderEndThumb [(ngModel)]="data.settings.thresholdMax" /> |
> |
||||
</mat-slider> |
<input formControlName="thresholdMin" matSliderStartThumb /> |
||||
<gf-value |
<input formControlName="thresholdMax" matSliderEndThumb /> |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
</mat-slider> |
||||
[locale]="data.locale" |
<gf-value |
||||
[precision]="2" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[value]="data.rule.configuration.threshold.max" |
[locale]="data.locale" |
||||
/> |
[precision]="2" |
||||
|
[value]="data.rule.configuration.threshold.max" |
||||
|
/> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</div> |
} @else { |
||||
} @else { |
<div |
||||
<div |
class="w-100" |
||||
class="w-100" |
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }" |
||||
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }" |
> |
||||
> |
<h6 class="d-flex mb-0"> |
||||
<h6 class="d-flex mb-0"> |
<ng-container i18n>Threshold Min</ng-container>: |
||||
<ng-container i18n>Threshold Min</ng-container>: |
<gf-value |
||||
<gf-value |
class="ml-1" |
||||
class="ml-1" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="form.value.thresholdMin" |
||||
[value]="data.settings.thresholdMin" |
/> |
||||
/> |
</h6> |
||||
</h6> |
<div class="align-items-center d-flex w-100"> |
||||
<div class="align-items-center d-flex w-100"> |
<gf-value |
||||
<gf-value |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="data.rule.configuration.threshold.min" |
||||
[value]="data.rule.configuration.threshold.min" |
/> |
||||
/> |
<mat-slider |
||||
<mat-slider |
class="flex-grow-1" |
||||
class="flex-grow-1" |
name="thresholdMin" |
||||
name="thresholdMin" |
[max]="data.rule.configuration.threshold.max" |
||||
[max]="data.rule.configuration.threshold.max" |
[min]="data.rule.configuration.threshold.min" |
||||
[min]="data.rule.configuration.threshold.min" |
[step]="data.rule.configuration.threshold.step" |
||||
[step]="data.rule.configuration.threshold.step" |
> |
||||
> |
<input formControlName="thresholdMin" matSliderThumb /> |
||||
<input matSliderThumb [(ngModel)]="data.settings.thresholdMin" /> |
</mat-slider> |
||||
</mat-slider> |
<gf-value |
||||
<gf-value |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="data.rule.configuration.threshold.max" |
||||
[value]="data.rule.configuration.threshold.max" |
/> |
||||
/> |
</div> |
||||
</div> |
</div> |
||||
</div> |
<div |
||||
<div |
class="w-100" |
||||
class="w-100" |
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMax }" |
||||
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMax }" |
> |
||||
> |
<h6 class="d-flex mb-0"> |
||||
<h6 class="d-flex mb-0"> |
<ng-container i18n>Threshold Max</ng-container>: |
||||
<ng-container i18n>Threshold Max</ng-container>: |
<gf-value |
||||
<gf-value |
class="ml-1" |
||||
class="ml-1" |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="form.value.thresholdMax" |
||||
[value]="data.settings.thresholdMax" |
/> |
||||
/> |
</h6> |
||||
</h6> |
<div class="align-items-center d-flex w-100"> |
||||
<div class="align-items-center d-flex w-100"> |
<gf-value |
||||
<gf-value |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="data.rule.configuration.threshold.min" |
||||
[value]="data.rule.configuration.threshold.min" |
/> |
||||
/> |
<mat-slider |
||||
<mat-slider |
class="flex-grow-1" |
||||
class="flex-grow-1" |
name="thresholdMax" |
||||
name="thresholdMax" |
[max]="data.rule.configuration.threshold.max" |
||||
[max]="data.rule.configuration.threshold.max" |
[min]="data.rule.configuration.threshold.min" |
||||
[min]="data.rule.configuration.threshold.min" |
[step]="data.rule.configuration.threshold.step" |
||||
[step]="data.rule.configuration.threshold.step" |
> |
||||
> |
<input formControlName="thresholdMax" matSliderThumb /> |
||||
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" /> |
</mat-slider> |
||||
</mat-slider> |
<gf-value |
||||
<gf-value |
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
||||
[isPercent]="data.rule.configuration.threshold.unit === '%'" |
[locale]="data.locale" |
||||
[locale]="data.locale" |
[precision]="2" |
||||
[precision]="2" |
[value]="data.rule.configuration.threshold.max" |
||||
[value]="data.rule.configuration.threshold.max" |
/> |
||||
/> |
</div> |
||||
</div> |
</div> |
||||
</div> |
} |
||||
} |
</div> |
||||
</div> |
|
||||
|
|
||||
<div align="end" mat-dialog-actions> |
<div align="end" mat-dialog-actions> |
||||
<button i18n mat-button (click)="dialogRef.close()">Close</button> |
<button i18n mat-button type="button" (click)="dialogRef.close()"> |
||||
<button |
Close |
||||
color="primary" |
</button> |
||||
mat-flat-button |
<button |
||||
(click)="dialogRef.close(data.settings)" |
color="primary" |
||||
> |
mat-flat-button |
||||
<ng-container i18n>Save</ng-container> |
type="submit" |
||||
</button> |
[disabled]="!(form.dirty && form.valid)" |
||||
</div> |
> |
||||
|
<ng-container i18n>Save</ng-container> |
||||
|
</button> |
||||
|
</div> |
||||
|
</form> |
||||
|
|||||
Loading…
Reference in new issue