argos/dmp-frontend/src/app/form/dynamic-form-section/dynamic-form-section.html

43 lines
2.2 KiB
HTML
Raw Normal View History

2018-09-06 14:50:38 +02:00
<div class="panel-group" style="margin-top:10px;">
2017-12-22 17:37:43 +01:00
<mat-accordion>
2017-12-28 17:32:28 +01:00
<mat-expansion-panel expanded=true>
2017-12-22 17:37:43 +01:00
<mat-expansion-panel-header>
<mat-panel-title>
2018-01-11 17:14:23 +01:00
{{path}} {{section.title}}
2017-12-22 17:37:43 +01:00
</mat-panel-title>
<mat-panel-description>
<h3 *ngIf="section.description">{{section.description}}</h3>
2018-09-06 14:50:38 +02:00
<!-- <h4 *ngIf="section.extendedDescription">{{section.extendedDescription}}</h4> -->
2017-12-22 17:37:43 +01:00
</mat-panel-description>
</mat-expansion-panel-header>
2018-09-06 14:50:38 +02:00
<div *ngFor="let compositeField of section.compositeFields; let i = index; trackBy: trackByFn">
<div>
2018-01-03 12:36:28 +01:00
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)">
<a (click)="addMultipleField(i)" style="cursor: pointer">
Add one more fieldset +
</a>
</div>
2018-09-06 14:50:38 +02:00
<df-composite-field [compositeField]="compositeField" [path]="path" [pathName]="pathName+'.compositeFields.'+i"></df-composite-field>
<div *ngFor="let multipleCompositeField of compositeField.multiplicityItems; let j = index; trackBy: trackByFn">
<df-composite-field [compositeField]="multipleCompositeField"
2018-01-05 18:02:26 +01:00
[pathName]="pathName+'.compositeFields.'+i+'.multiplicityItems.'+j"></df-composite-field>
</div>
2018-05-14 08:44:35 +02:00
<div *ngIf="compositeField.hasCommentField" [formGroup]="form.get('compositeFields').get(''+i)">
<mat-form-field>
<input matInput formControlName="commentFieldValue" placeholder="comment">
</mat-form-field>
</div>
2018-01-03 12:36:28 +01:00
</div>
2018-01-11 17:14:23 +01:00
2017-12-22 17:37:43 +01:00
</div>
<div *ngIf="section.sections">
<div *ngFor="let itemsection of section.sections; let j = index;">
2018-09-06 14:50:38 +02:00
<df-section [section]="itemsection" [path]="path+'.'+(j+1)" [pathName]="pathName+'.sections.'+j"></df-section>
2017-12-22 17:37:43 +01:00
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
2018-09-06 14:50:38 +02:00
</div>