|
|
|
@ -5,112 +5,106 @@ |
|
|
|
|
|
|
|
<span class="field-disabled" *ngIf="field.isDisabled">Disabled</span> |
|
|
|
|
|
|
|
<div [formGroup]="fieldForm"> |
|
|
|
<div *ngIf="field.isLocalizable && languages.length > 1"> |
|
|
|
<div class="languages-buttons" #buttonLanguages> |
|
|
|
<sqx-language-selector size="sm" (selectedLanguageChanged)="selectLanguage($event)" [languages]="languages"></sqx-language-selector> |
|
|
|
</div> |
|
|
|
|
|
|
|
<sqx-onboarding-tooltip id="languages" [for]="buttonLanguages" position="topRight" after="120000"> |
|
|
|
Please remember to check all languages when you see validation errors. |
|
|
|
</sqx-onboarding-tooltip> |
|
|
|
<div *ngIf="field.isLocalizable && languages.length > 1"> |
|
|
|
<div class="languages-buttons" #buttonLanguages> |
|
|
|
<sqx-language-selector size="sm" (selectedLanguageChanged)="selectLanguage($event)" [languages]="languages"></sqx-language-selector> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div *ngFor="let partition of fieldPartitions"> |
|
|
|
<div *ngIf="partition == fieldPartition"> |
|
|
|
<sqx-control-errors [for]="partition" fieldName="{{field.displayName}}" [submitted]="contentFormSubmitted"></sqx-control-errors> |
|
|
|
<sqx-onboarding-tooltip id="languages" [for]="buttonLanguages" position="topRight" after="120000"> |
|
|
|
Please remember to check all languages when you see validation errors. |
|
|
|
</sqx-onboarding-tooltip> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div [ngSwitch]="field.properties.fieldType"> |
|
|
|
<div *ngSwitchCase="'Number'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="number" [formControlName]="partition" [placeholder]="field.displayPlaceholder" /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Stars'"> |
|
|
|
<sqx-stars [formControlName]="partition" [maximumStars]="field.properties.maxValue"></sqx-stars> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-control" [formControlName]="partition"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.properties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check form-check-inline" *ngFor="let value of field.properties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControlName]="partition" /> |
|
|
|
<label class="form-check-label"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'String'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="text" [formControlName]="partition" [placeholder]="field.displayPlaceholder" /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Slug'"> |
|
|
|
<input class="form-control" type="text" [formControlName]="partition" [placeholder]="field.displayPlaceholder" sqxSlugifyInput /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'TextArea'"> |
|
|
|
<textarea class="form-control" [formControlName]="partition" rows="5" [placeholder]="field.displayPlaceholder"></textarea> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'RichText'"> |
|
|
|
<sqx-rich-editor [formControlName]="partition" (assetPluginClicked)="assetPluginClicked()"></sqx-rich-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Markdown'"> |
|
|
|
<sqx-markdown-editor [formControlName]="partition" (assetPluginClicked)="assetPluginClicked()"></sqx-markdown-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-control" [formControlName]="partition"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.properties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check form-check-inline" *ngFor="let value of field.properties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" value="{{value}}" [formControlName]="partition" /> |
|
|
|
<label class="form-check-label"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Boolean'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Toggle'"> |
|
|
|
<sqx-toggle [formControlName]="partition"></sqx-toggle> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Checkbox'"> |
|
|
|
<div class="form-check form-check-inline"> |
|
|
|
<input class="form-check-input" type="checkbox" [formControlName]="partition" sqxIndeterminateValue /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'DateTime'"> |
|
|
|
<sqx-date-time-editor enforceTime="true" [mode]="field.properties.editor" [formControlName]="partition"></sqx-date-time-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Geolocation'"> |
|
|
|
<sqx-geolocation-editor [formControlName]="partition"></sqx-geolocation-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Json'"> |
|
|
|
<sqx-json-editor [formControlName]="partition"></sqx-json-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Assets'"> |
|
|
|
<sqx-assets-editor [formControlName]="partition"></sqx-assets-editor> |
|
|
|
<sqx-control-errors [for]="selectedFormControl" [fieldName]="field.displayName" [submitted]="contentFormSubmitted"></sqx-control-errors> |
|
|
|
|
|
|
|
<div [ngSwitch]="field.properties.fieldType"> |
|
|
|
<div *ngSwitchCase="'Number'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="number" [formControl]="selectedFormControl" [placeholder]="field.displayPlaceholder" /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Stars'"> |
|
|
|
<sqx-stars [formControl]="selectedFormControl" [maximumStars]="field.properties.maxValue"></sqx-stars> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-control" [formControl]="selectedFormControl"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.properties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check form-check-inline" *ngFor="let value of field.properties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControl]="selectedFormControl" /> |
|
|
|
<label class="form-check-label"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Tags'"> |
|
|
|
<sqx-tag-editor [formControlName]="partition"></sqx-tag-editor> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'String'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="text" [formControl]="selectedFormControl" [placeholder]="field.displayPlaceholder" /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Slug'"> |
|
|
|
<input class="form-control" type="text" [formControl]="selectedFormControl" [placeholder]="field.displayPlaceholder" sqxSlugifyInput /> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'TextArea'"> |
|
|
|
<textarea class="form-control" [id]="selectedFormName"[formControl]="selectedFormControl" rows="5" [placeholder]="field.displayPlaceholder"></textarea> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'RichText'"> |
|
|
|
<sqx-rich-editor [formControl]="selectedFormControl" (assetPluginClicked)="assetPluginClicked()"></sqx-rich-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Markdown'"> |
|
|
|
<sqx-markdown-editor [formControl]="selectedFormControl" (assetPluginClicked)="assetPluginClicked()"></sqx-markdown-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-control" [formControl]="selectedFormControl"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.properties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check form-check-inline" *ngFor="let value of field.properties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" value="{{value}}" [formControl]="selectedFormControl" /> |
|
|
|
<label class="form-check-label"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'References'"> |
|
|
|
<sqx-references-editor [formControlName]="partition" [language]="selectedLanguage" [schemaId]="field.properties.schemaId"></sqx-references-editor> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Boolean'"> |
|
|
|
<div [ngSwitch]="field.properties.editor"> |
|
|
|
<div *ngSwitchCase="'Toggle'"> |
|
|
|
<sqx-toggle [formControl]="selectedFormControl"></sqx-toggle> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Checkbox'"> |
|
|
|
<div class="form-check form-check-inline"> |
|
|
|
<input class="form-check-input" type="checkbox" [formControl]="selectedFormControl" sqxIndeterminateValue /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'DateTime'"> |
|
|
|
<sqx-date-time-editor enforceTime="true" [mode]="field.properties.editor" [formControl]="selectedFormControl"></sqx-date-time-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Geolocation'"> |
|
|
|
<sqx-geolocation-editor [formControl]="selectedFormControl"></sqx-geolocation-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Json'"> |
|
|
|
<sqx-json-editor [formControl]="selectedFormControl"></sqx-json-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Assets'"> |
|
|
|
<sqx-assets-editor [formControl]="selectedFormControl"></sqx-assets-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'Tags'"> |
|
|
|
<sqx-tag-editor [formControl]="selectedFormControl"></sqx-tag-editor> |
|
|
|
</div> |
|
|
|
<div *ngSwitchCase="'References'"> |
|
|
|
<sqx-references-editor [formControl]="selectedFormControl" [language]="selectedLanguage" [schemaId]="field.properties.schemaId"></sqx-references-editor> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<small class="form-text text-muted" *ngIf="field.properties.hints && field.properties.hints.length > 0"> |
|
|
|
|