Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

45 lines
1.8 KiB

<div class="component">
<div *ngIf="formModel.schemaChanges | async; let schema; else noSchema">
<sqx-form-hint>
{{schema.displayName}}
</sqx-form-hint>
<div class="form-group" *ngFor="let section of formModel.fieldSectionsChanges | async">
<sqx-component-section
[canUnset]="canUnset"
[form]="form"
[formContext]="formContext"
[formLevel]="formLevel + 1"
[formSection]="$any(section)"
[language]="language"
[languages]="languages">
</sqx-component-section>
</div>
</div>
<ng-template #noSchema>
<ng-container *ngIf="schemasList.length > 1">
<button type="button" class="btn btn-outline-success dropdown-toggle" (click)="schemasDropdown.show()" #buttonSelect>
{{ 'contents.addComponent' | sqxTranslate}}
</button>
<ng-container *sqxModal="schemasDropdown;closeAlways:true">
<sqx-dropdown-menu [sqxAnchoredTo]="buttonSelect" [scrollY]="true">
<a class="dropdown-item" *ngFor="let schema of schemasList" (click)="setSchema(schema)">
{{schema.displayName}}
</a>
</sqx-dropdown-menu>
</ng-container>
</ng-container>
<ng-container *ngIf="schemasList.length === 1">
<button type="button" class="btn btn-outline-success" (click)="setSchema(schemasList[0])">
{{ 'contents.addComponent' | sqxTranslate}}
</button>
</ng-container>
<ng-container *ngIf="schemasList.length === 0">
<sqx-form-hint>
{{ 'contents.componentNoSchema' | sqxTranslate }}
</sqx-form-hint>
</ng-container>
</ng-template>
</div>