2018-10-02 16:33:58 +02:00
< div [ formGroup ] = " form " >
< div fxLayout = "row" >
< h4 style = "font-weight: bold" > Section Description< / h4 >
< div >
< button mat-button ( click ) = " addSectioninSection ( ) " style = "cursor: pointer" >
Add Nested Section +
< / button >
< / div >
< / div >
< div fxLayout = "row" fxLayoutAlign = "space-between center" >
< div fxFlex >
2018-07-11 15:47:36 +02:00
< mat-form-field class = "full-width" >
< input matInput type = "text" placeholder = "Id" formControlName = "id" >
< / mat-form-field >
2018-10-02 16:33:58 +02:00
< / div >
< div fxFlex >
2018-07-11 15:47:36 +02:00
< mat-form-field class = "full-width" >
2018-10-02 16:33:58 +02:00
< input matInput type = "text" placeholder = "Title" formControlName = "title" >
2018-07-11 15:47:36 +02:00
< / mat-form-field >
2018-02-02 11:57:24 +01:00
< / div >
2018-10-02 16:33:58 +02:00
< div fxFlex >
2018-07-11 15:47:36 +02:00
< mat-form-field class = "full-width" >
2018-10-02 16:33:58 +02:00
< mat-select placeholder = 'Page' formControlName = "page" required >
2018-07-11 15:47:36 +02:00
< 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 >
2018-10-02 16:33:58 +02:00
< / div >
< / div >
< div fxLayout = "row" fxLayoutAlign = "start center" >
< div fxFlex = "10%" >
< mat-form-field class = "full-width" >
< input matInput type = "number" placeholder = "Ordinal" formControlName = "ordinal" >
< / mat-form-field >
< / div >
< div fxFlex = "50%" >
2018-07-11 15:47:36 +02:00
< 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 >
2018-02-02 11:57:24 +01:00
< / div >
2018-07-11 15:47:36 +02:00
< / div >
< div * ngIf = "dataModel.sections.length > 0" >
2018-10-02 16:33:58 +02:00
< mat-expansion-panel * ngFor = "let section of dataModel.sections; let i=index;" # panel >
2018-07-11 15:47:36 +02:00
< mat-expansion-panel-header >
2018-10-02 16:33:58 +02:00
< mat-panel-title * ngIf = "form.get('sections').get(''+i).get('title').value && !panel.expanded" > {{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}< / mat-panel-title >
2018-07-11 15:47:36 +02:00
< 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 >
2018-10-02 16:33:58 +02:00
< div id = "{{indexPath + 's' + i}}" * ngIf = "panel.expanded" >
2018-07-11 15:47:36 +02:00
< section-form [ form ] = " form . get ( ' sections ' ) . get ( ' ' + i ) " [ dataModel ] = " section " [ indexPath ] = " indexPath + ' s ' + i " > < / section-form >
< / div >
< / mat-expansion-panel >
< / div >
2018-02-02 11:57:24 +01:00
2018-07-11 15:47:36 +02:00
<!-- <div *ngFor="let fieldGroup of dataModel.fieldGroups let i=index;">
2018-02-02 11:57:24 +01:00
< 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 >
2018-10-02 16:33:58 +02:00
< div fxLayout = "row" >
< h4 > Field Sets< / h4 >
< div >
< button mat-button ( click ) = " addField ( ) " style = "cursor: pointer" >
Add Field +
< / button >
< / div >
< / div >
< mat-expansion-panel * ngFor = "let field of dataModel.fieldSets let i=index;" class = "panel panel-default" # panel >
2018-07-11 15:47:36 +02:00
< mat-expansion-panel-header >
<!-- <a *ngIf="form.get('compositeFields').get(''+i).get('title').value" data - toggle="collapse" href="#{{'compositeFieldCollapse' + i}}"
2018-02-02 11:57:24 +01:00
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-10-02 16:33:58 +02:00
< mat-panel-title * ngIf = "!panel.expanded" > {{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-10-02 16:33:58 +02:00
< compositefield-form * ngIf = "panel.expanded" [ 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-02-02 11:57:24 +01:00
2018-07-11 15:47:36 +02:00
<!--
2018-02-02 11:57:24 +01: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>
2018-02-02 11:57:24 +01:00
< a ( click ) = " addGroupField ( ) " style = "cursor: pointer" >
Add Group +
< / a >
< / div > -->
2018-10-02 16:33:58 +02:00
2018-07-11 15:47:36 +02:00
< / div >