Files
cbsnexora/src/app/templates/create-template/create-template.component.html
T

154 lines
5.6 KiB
HTML

<div class="container">
<mat-card fxLayout="column" fxLayoutGap="2%">
<form [formGroup]="templateForm">
<mat-card-content>
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Entity' | translate}}</mat-label>
<mat-select required formControlName="entity">
<mat-option *ngFor="let entity of createTemplateData.entities" [value]="entity.id">
{{ entity.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="templateForm.controls.entity.hasError('required')">
{{'labels.inputs.Entity' | translate}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.Type' | translate}}</mat-label>
<mat-select required formControlName="type">
<mat-option *ngFor="let type of createTemplateData.types" [value]="type.id">
{{ type.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="templateForm.controls.type.hasError('required')">
{{'labels.inputs.Type' | translate}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{'labels.inputs.name' | translate}}</mat-label>
<input matInput required formControlName="name">
<mat-error *ngIf="templateForm.controls.name.hasError('required')">
{{'labels.inputs.name' | translate}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
</div>
</mat-card-content>
</form>
<div role="toggle" fxFlex="13%">
<button mat-raised-button color="primary" (click)="showAdvanceOptions = !showAdvanceOptions">
{{'labels.buttons.Advance Options' | translate}}</button>
</div>
<ng-container role="mappers" *ngIf="showAdvanceOptions">
<div *ngFor="let mapper of mappers; index as i" fxLayout="row" fxLayoutGap="2%">
<mat-form-field fxFlex="43%">
<mat-label>{{'labels.inputs.Mapper Key' | translate}}</mat-label>
<input matInput [formControl]="mapper.mapperskey">
</mat-form-field>
<mat-form-field fxFlex="43%">
<mat-label>{{'labels.inputs.Mapper Value' | translate}}</mat-label>
<input matInput [formControl]="mapper.mappersvalue">
</mat-form-field>
<button *ngIf="i === 0" class="mapper-button" fxFlex="8%" mat-raised-button color="primary" (click)="addMapper()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{'labels.buttons.Add' | translate}}
</button>
<button *ngIf="!(i === 0)" class="mapper-button" fxFlex="9%" mat-raised-button color="primary" (click)="removeMapper(i)">
<fa-icon icon="minus" class="m-r-10"></fa-icon>{{'labels.buttons.Remove' | translate}}
</button>
</div>
</ng-container>
<div role="editor">
<ckeditor #ckEditor [editor]="Editor"></ckeditor>
</div>
<div role="template-parameters">
<mat-accordion>
<mat-expansion-panel *ngIf="templateForm.controls.entity.value === 0">
<mat-expansion-panel-header>
<mat-panel-title>
{{'labels.inputs.Client Parameters' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center">
<button mat-stroked-button color="primary" class="parameter"
*ngFor="let label of clientParameterLabels" (click)="addText(label)">
{{ label }}
</button>
</div>
</mat-expansion-panel>
<mat-expansion-panel *ngIf="templateForm.controls.entity.value === 1">
<mat-expansion-panel-header>
<mat-panel-title>
{{'labels.inputs.Loan Parameters' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center">
<button mat-stroked-button color="primary" class="parameter"
*ngFor="let label of loanParameterLabels" (click)="addText(label)">
{{ label }}
</button>
</div>
</mat-expansion-panel>
<mat-expansion-panel *ngIf="templateForm.controls.entity.value === 1">
<mat-expansion-panel-header>
<mat-panel-title>
{{'labels.inputs.Repayment Schedule Parameters' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center">
<button mat-stroked-button color="primary" class="parameter"
*ngFor="let label of repaymentParameterLabels" (click)="addText(label)">
{{ label }}
</button>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
<mat-card-actions class="m-b-20" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
<button mat-raised-button color="primary" (click)="submit()">{{'labels.buttons.Submit' | translate}}</button>
</mat-card-actions>
</mat-card>
</div>