argos/dmp-frontend/src/app/dataset-profile-form/section-form/section-form.component.html

112 lines
5.3 KiB
HTML
Raw Normal View History

2018-03-06 15:58:38 +01:00
<div>
2018-07-11 15:47:36 +02:00
<div class="row" [formGroup]="form">
<div class="col-md-6">
<mat-form-field class="full-width">
<input matInput type="text" placeholder="Title" formControlName="title">
</mat-form-field>
<mat-form-field class="full-width">
<input matInput type="text" placeholder="Id" formControlName="id">
</mat-form-field>
<mat-form-field class="full-width">
<input matInput type="number" placeholder="Ordinal" formControlName="ordinal">
</mat-form-field>
</div>
2018-07-11 15:47:36 +02:00
<div class="col-md-6">
<mat-form-field class="full-width">
<mat-select placeholder='Page' formControlName="page">
<mat-option *ngFor="let pageGroup of form.root.get('pages')['controls'];" [value]="pageGroup.get('id').value">{{pageGroup.get('title').value}}</mat-option>
</mat-select>
<!-- <div *ngIf="form.get('page').invalid && (form.get('page').dirty || form.get('page').touched)" class="alert alert-danger">Page is required</div> -->
</mat-form-field>
<label>Default Visibility</label>
<mat-radio-group formControlName="defaultVisibility" class="full-width">
<mat-radio-button [value]="true">true</mat-radio-button>
<mat-radio-button [value]="false">false</mat-radio-button>
</mat-radio-group>
</div>
2018-07-11 15:47:36 +02:00
</div>
<div *ngIf="dataModel.sections.length > 0">
<mat-expansion-panel *ngFor="let section of dataModel.sections; let i=index;">
<mat-expansion-panel-header>
<mat-panel-title *ngIf="form.get('sections').get(''+i).get('title').value">{{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}</mat-panel-title>
<div class="btn-group pull-right">
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteSectionInSection(i);">
<span class="glyphicon glyphicon-erase"></span>
</button>
</div>
</mat-expansion-panel-header>
<div id="{{indexPath + 's' + i}}">
<section-form [form]="form.get('sections').get(''+i)" [dataModel]="section" [indexPath]="indexPath + 's' + i"></section-form>
</div>
</mat-expansion-panel>
</div>
2018-07-11 15:47:36 +02:00
<!-- <div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;">
<groupfield-form [form]="form.get('fieldGroups').get(''+i)" [dataModel]="fieldGroup" [indexPath]="indexPath + 'g' + i"></groupfield-form>
</div> -->
2018-07-11 15:47:36 +02:00
<div>
<mat-expansion-panel *ngFor="let field of dataModel.fieldSets let i=index;" class="panel panel-default">
<mat-expansion-panel-header>
<!-- <a *ngIf="form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. {{form.get('compositeFields').get(''+i).get('title').value}}</a>
<a *ngIf="!form.get('compositeFields').get(''+i).get('title').value" data-toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
class="panel-title pull-left" style="padding-top: 7.5px;">{{i + 1}}. Field {{i + 1}}</a> -->
2018-07-11 15:47:36 +02:00
<mat-panel-title>{{i + 1}}. Field {{i + 1}}</mat-panel-title>
2018-03-06 15:58:38 +01:00
2018-07-11 15:47:36 +02:00
<div>
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteFieldSet(i);">
<span class="glyphicon glyphicon-erase"></span>
</button>
</div>
</mat-expansion-panel-header>
2018-03-06 15:58:38 +01:00
2018-07-11 15:47:36 +02:00
<compositefield-form [form]="form.get('fieldSets').get(''+i)" [dataModel]="field" [indexPath]="indexPath + 'cf' + i"></compositefield-form>
2018-03-06 15:58:38 +01:00
2018-07-11 15:47:36 +02:00
</mat-expansion-panel>
</div>
2018-07-11 15:47:36 +02:00
<!--
<div *ngIf="dataModel.fieldGroups" class="panel-group" style="margin-top:10px;">
<div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;" class="panel panel-default">
<div class="panel-heading clearfix">
<a *ngIf="form.get('fieldGroups').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'g' + i}}" class="panel-title pull-left"
style="padding-top: 7.5px;">{{i + 1}}. {{form.get('fieldGroups').get(''+i).get('title').value}}</a>
<a *ngIf="!form.get('fieldGroups').get(''+i).get('title').value" data-toggle="collapse" href="#{{indexPath + 'g' + i}}" class="panel-title pull-left"
style="padding-top: 7.5px;">{{i + 1}}. Group {{i + 1}}</a>
<div class="btn-group pull-right">
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteFieldGroup(i);">
<span class="glyphicon glyphicon-erase"></span>
</button>
</div>
</div>
<div id="{{indexPath + 'g' + i}}" class="panel-collapse collapse in">
<div class="panel-body">
<groupfield-form [form]="form.get('fieldGroups').get(''+i)" [dataModel]="fieldGroup" [indexPath]="indexPath + 'g' + i"></groupfield-form>
</div>
</div>
</div>
</div> -->
2018-07-11 15:47:36 +02:00
<!-- <div>
<a (click)="addGroupField()" style="cursor: pointer">
Add Group +
</a>
</div> -->
2018-07-11 15:47:36 +02:00
<div>
<a (click)="addField()" style="cursor: pointer">
Add Field +
</a>
</div>
<div>
<a (click)="addSectioninSection()" style="cursor: pointer">
Add Section +
</a>
</div>
</div>