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

49 lines
2.6 KiB
HTML

<div class="full-width full-height">
<mat-sidenav-container class="ng-sidebar-container">
<!-- <mat-sidenav mode="push" position="right" [(opened)]="visibleSidebar">
<table-of-content class="toc-container full-height" [model]="datasetProfileDefinitionModel"></table-of-content>
</mat-sidenav> -->
<mat-sidenav-content>
<!-- <button mat-raised-button color="primary" style="margin: 15px;" (click)="toggleSidebar()" icon="fa-arrow-left">Table Of Contents</button> -->
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel.status != 1"
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" type="submit">Save</button>
<button mat-raised-button color="primary" *ngIf="datasetProfileDefinitionModel&&datasetProfileDefinitionModel?.status != 1"
style="margin-top: 15px;margin-bottom: 15px;margin-right: 15px;" (click)="submit();">Save and Finalize</button>
<div>
<div class="alignment-center">
<!-- <ngb-pagination *ngIf="pages" [collectionSize]="pages.length*10" [page]="currentPageIndex" (pageChange)="changePageIndex($event)" aria-label="Default pagination"></ngb-pagination> -->
<progress-bar *ngIf="form" [formGroup]="form"></progress-bar>
</div>
</div>
<div>
<!-- <progress-bar *ngIf="form" [formGroup]="form"></progress-bar> -->
</div>
<div class="col-md-12" id="form-container">
<form *ngIf="form" novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
<mat-vertical-stepper [linear]="false">
<div *ngFor="let page of pages let z=index;">
<div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;">
<div *ngIf="section.page == z">
<mat-step [stepControl]="section">
<df-section [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1" [pathName]="'sections.'+i"></df-section>
<ng-template matStepLabel>{{section.title}}</ng-template>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</mat-step>
</div>
</div>
</div>
</mat-vertical-stepper>
<!-- <div *ngFor="let section of datasetProfileDefinitionModel.sections; let i = index;">
<df-section *ngIf='this.shouldDisplaySection(section)' [section]="section" [form]="form.get('sections').get(''+i)" [path]="i+1"
[pathName]="'sections.'+i"></df-section>
</div> -->
</form>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
</div>
<!-- <p>Form value: {{ form.value | json }}</p> -->