mirror of https://github.com/Squidex/squidex.git
48 changed files with 315 additions and 209 deletions
@ -1,36 +1,36 @@ |
|||||
<div [formGroup]="actionForm" class="form-horizontal"> |
<div [formGroup]="actionForm" class="form-horizontal"> |
||||
<div class="form-group row" *ngFor="let property of definition.properties"> |
<div class="form-group row" *ngFor="let property of definition.properties"> |
||||
<label class="col-3 col-form-label" [for]="property.name"> |
<label class="col-3 col-form-label" [for]="property.name"> |
||||
<span *ngIf="property.editor !== 'Checkbox'">{{property.display}}</span> |
<ng-container *ngIf="property.editor !== 'Checkbox'">{{property.display}}</ng-container> <small class="hint" *ngIf="property.isRequired"> *</small> |
||||
</label> |
</label> |
||||
|
|
||||
<div class="col-9"> |
<div class="col-9"> |
||||
<sqx-control-errors [for]="property.name" [submitted]="actionFormSubmitted"></sqx-control-errors> |
<sqx-control-errors [for]="property.name" [submitted]="actionFormSubmitted"></sqx-control-errors> |
||||
|
|
||||
<div [ngSwitch]="property.editor"> |
<ng-container [ngSwitch]="property.editor"> |
||||
<div *ngSwitchCase="'TextArea'"> |
<ng-container *ngSwitchCase="'TextArea'"> |
||||
<textarea class="form-control" id="{{property.name}}" [formControlName]="property.name"></textarea> |
<textarea class="form-control" id="{{property.name}}" [formControlName]="property.name"></textarea> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Checkbox'"> |
<ng-container *ngSwitchCase="'Checkbox'"> |
||||
<div class="form-check"> |
<div class="form-check"> |
||||
<input class="form-check-input" type="checkbox" [formControlName]="property.name" /> |
<input class="form-check-input" type="checkbox" [formControlName]="property.name" /> |
||||
<label class="form-check-label" [for]="property.name"> |
<label class="form-check-label" [for]="property.name"> |
||||
{{property.display}} |
{{property.display}} |
||||
</label> |
</label> |
||||
</div> |
</div> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchDefault> |
<ng-container *ngSwitchDefault> |
||||
<input type="{{property.editor | lowercase}}" class="form-control" id="{{property.name}}" [formControlName]="property.name" /> |
<input type="{{property.editor | lowercase}}" class="form-control" id="{{property.name}}" [formControlName]="property.name" /> |
||||
</div> |
</ng-container> |
||||
</div> |
</ng-container> |
||||
|
|
||||
<small class="form-text text-muted"> |
<sqx-form-hint> |
||||
{{property.description}} |
{{property.description}} |
||||
|
|
||||
<ng-container *ngIf="property.isFormattable"> |
<ng-container *ngIf="property.isFormattable"> |
||||
You can use advanced formatting: <a href="https://docs.squidex.io/concepts/rules#3-formatting" sqxExternalLink>Documentation</a> |
You can use advanced formatting: <a href="https://docs.squidex.io/concepts/rules#3-formatting" sqxExternalLink>Documentation</a> |
||||
</ng-container> |
</ng-container> |
||||
</small> |
</sqx-form-hint> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
@ -1,29 +1,29 @@ |
|||||
<div [ngSwitch]="field.properties.fieldType"> |
<ng-container [ngSwitch]="field.properties.fieldType"> |
||||
<div *ngSwitchCase="'Number'"> |
<ng-container *ngSwitchCase="'Number'"> |
||||
<sqx-number-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-number-ui> |
<sqx-number-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-number-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'String'"> |
<ng-container *ngSwitchCase="'String'"> |
||||
<sqx-string-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-string-ui> |
<sqx-string-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-string-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Boolean'"> |
<ng-container *ngSwitchCase="'Boolean'"> |
||||
<sqx-boolean-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-boolean-ui> |
<sqx-boolean-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-boolean-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'DateTime'"> |
<ng-container *ngSwitchCase="'DateTime'"> |
||||
<sqx-date-time-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-date-time-ui> |
<sqx-date-time-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-date-time-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Geolocation'"> |
<ng-container *ngSwitchCase="'Geolocation'"> |
||||
<sqx-geolocation-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-geolocation-ui> |
<sqx-geolocation-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-geolocation-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Json'"> |
<ng-container *ngSwitchCase="'Json'"> |
||||
<sqx-json-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-json-ui> |
<sqx-json-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-json-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Assets'"> |
<ng-container *ngSwitchCase="'Assets'"> |
||||
<sqx-assets-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-assets-ui> |
<sqx-assets-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-assets-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'References'"> |
<ng-container *ngSwitchCase="'References'"> |
||||
<sqx-references-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-references-ui> |
<sqx-references-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-references-ui> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Tags'"> |
<ng-container *ngSwitchCase="'Tags'"> |
||||
<sqx-tags-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-tags-ui> |
<sqx-tags-ui [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-tags-ui> |
||||
</div> |
</ng-container> |
||||
</div> |
</ng-container> |
||||
@ -1,29 +1,29 @@ |
|||||
<div [ngSwitch]="field.properties.fieldType"> |
<ng-container [ngSwitch]="field.properties.fieldType"> |
||||
<div *ngSwitchCase="'Number'"> |
<ng-container *ngSwitchCase="'Number'"> |
||||
<sqx-number-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-number-validation> |
<sqx-number-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-number-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'String'"> |
<ng-container *ngSwitchCase="'String'"> |
||||
<sqx-string-validation [editForm]="editForm" [field]="field" [properties]="field.properties" [patterns]="patterns"></sqx-string-validation> |
<sqx-string-validation [editForm]="editForm" [field]="field" [properties]="field.properties" [patterns]="patterns"></sqx-string-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Boolean'"> |
<ng-container *ngSwitchCase="'Boolean'"> |
||||
<sqx-boolean-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-boolean-validation> |
<sqx-boolean-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-boolean-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'DateTime'"> |
<ng-container *ngSwitchCase="'DateTime'"> |
||||
<sqx-date-time-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-date-time-validation> |
<sqx-date-time-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-date-time-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Geolocation'"> |
<ng-container *ngSwitchCase="'Geolocation'"> |
||||
<sqx-geolocation-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-geolocation-validation> |
<sqx-geolocation-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-geolocation-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Json'"> |
<ng-container *ngSwitchCase="'Json'"> |
||||
<sqx-json-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-json-validation> |
<sqx-json-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-json-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Assets'"> |
<ng-container *ngSwitchCase="'Assets'"> |
||||
<sqx-assets-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-assets-validation> |
<sqx-assets-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-assets-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'References'"> |
<ng-container *ngSwitchCase="'References'"> |
||||
<sqx-references-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-references-validation> |
<sqx-references-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-references-validation> |
||||
</div> |
</ng-container> |
||||
<div *ngSwitchCase="'Tags'"> |
<ng-container *ngSwitchCase="'Tags'"> |
||||
<sqx-tags-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-tags-validation> |
<sqx-tags-validation [editForm]="editForm" [field]="field" [properties]="field.properties"></sqx-tags-validation> |
||||
</div> |
</ng-container> |
||||
</div> |
</ng-container> |
||||
@ -1,7 +1,7 @@ |
|||||
<div class="errors-container" *ngIf="snapshot.errorMessages.length > 0" @fade> |
<div class="errors-container" *ngIf="snapshot.errorMessages.length > 0" @fade> |
||||
<div class="errors"> |
<div class="errors"> |
||||
<span *ngFor="let message of snapshot.errorMessages"> |
<ng-container *ngFor="let message of snapshot.errorMessages"> |
||||
{{message}} |
{{message}} |
||||
</span> |
</ng-container> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
@ -0,0 +1,21 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
||||
|
*/ |
||||
|
|
||||
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'sqx-form-alert', |
||||
|
template: ` |
||||
|
<div class="alert alert-info mt-2 {{class}}"> |
||||
|
<i class="icon-info-outline"></i> <ng-content></ng-content> |
||||
|
</div>`,
|
||||
|
changeDetection: ChangeDetectionStrategy.OnPush |
||||
|
}) |
||||
|
export class FormAlertComponent { |
||||
|
@Input() |
||||
|
public class: string; |
||||
|
} |
||||
@ -1,3 +0,0 @@ |
|||||
<ng-container *ngIf="error"> |
|
||||
<div class="form-alert form-alert-error" [innerHTML]="error" @fade></div> |
|
||||
</ng-container> |
|
||||
@ -1,2 +0,0 @@ |
|||||
@import '_mixins'; |
|
||||
@import '_vars'; |
|
||||
@ -0,0 +1,18 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
||||
|
*/ |
||||
|
|
||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'sqx-form-hint', |
||||
|
template: ` |
||||
|
<small class="text-muted form-text"> |
||||
|
<ng-content></ng-content> |
||||
|
</small>`,
|
||||
|
changeDetection: ChangeDetectionStrategy.OnPush |
||||
|
}) |
||||
|
export class FormHintComponent {} |
||||
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue