mirror of https://github.com/Squidex/squidex.git
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.
105 lines
5.0 KiB
105 lines
5.0 KiB
<form [formGroup]="createForm.form" (ngSubmit)="createSchema()">
|
|
<sqx-modal-dialog (close)="cancel.emit()">
|
|
<ng-container title>
|
|
<ng-container *ngIf="import; else noImport">
|
|
{{ 'schemas.clone' | sqxTranslate }}
|
|
</ng-container>
|
|
|
|
<ng-template #noImport>
|
|
{{ 'schemas.create' | sqxTranslate }}
|
|
</ng-template>
|
|
</ng-container>
|
|
|
|
<ng-container content>
|
|
<sqx-form-error [error]="createForm.error | async"></sqx-form-error>
|
|
|
|
<div class="form-group">
|
|
<label for="name">{{ 'common.name' | sqxTranslate }} <small class="hint">({{ 'common.requiredHint' | sqxTranslate }})</small></label>
|
|
|
|
<sqx-control-errors for="name"></sqx-control-errors>
|
|
|
|
<input type="text" class="form-control" id="name" formControlName="name" autocomplete="off" sqxTransformInput="LowerCase" sqxFocusOnInit>
|
|
|
|
<sqx-form-hint>
|
|
{{ 'schemas.schemaNameHint' | sqxTranslate }}
|
|
</sqx-form-hint>
|
|
</div>
|
|
|
|
<div class="form-group mt-4">
|
|
<div class="row">
|
|
<div class="col-6 type">
|
|
<label>
|
|
<input type="radio" class="radio-input" name="isSingleton" formControlName="isSingleton" [value]="false">
|
|
|
|
<div class="row no-gutters">
|
|
<div class="col-auto">
|
|
<div class="btn-radio" [class.active]="createForm.form.controls['isSingleton'].value !== true">
|
|
<i class="icon-multiple-content"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="type-title">{{ 'schemas.modeMultiple' | sqxTranslate }}</div>
|
|
<div class="type-text text-muted">{{ 'schemas.modeMultipleDescription' | sqxTranslate }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
</label>
|
|
</div>
|
|
<div class="col-6 type">
|
|
<label>
|
|
<input type="radio" class="radio-input" name="isSingleton" formControlName="isSingleton" [value]="true">
|
|
|
|
<div class="row no-gutters">
|
|
<div class="col-auto">
|
|
<div class="btn-radio" [class.active]="createForm.form.controls['isSingleton'].value === true">
|
|
<i class="icon-single-content"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="type-title">{{ 'schemas.modeSingle' | sqxTranslate }}</div>
|
|
<div class="type-text text-muted">{{ 'schemas.modeSingleDescription' | sqxTranslate }}</div>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<sqx-form-alert>
|
|
{{ 'schemas.nameWarning' | sqxTranslate }}
|
|
</sqx-form-alert>
|
|
|
|
<ng-container *ngIf="schemasState.categories | async; let categories">
|
|
<div class="form-group" *ngIf="categories.length > 1">
|
|
<label for="category">{{ 'common.category' | sqxTranslate }}</label>
|
|
|
|
<select class="custom-select" id="category" formControlName="initialCategory">
|
|
<option></option>
|
|
<option *ngFor="let category of categories | slice:1" [ngValue]="category.name">{{category.name}}</option>
|
|
</select>
|
|
</div>
|
|
</ng-container>
|
|
|
|
<div class="form-group">
|
|
<button type="button" class="btn btn-sm btn-text" (click)="toggleImport()" [class.hidden]="showImport">
|
|
{{ 'schemas.import' | sqxTranslate }}
|
|
</button>
|
|
<button type="button" class="btn btn-sm btn-text force" (click)="toggleImport()" [class.hidden]="!showImport">
|
|
{{ 'common.hide' | sqxTranslate }}
|
|
</button>
|
|
|
|
<sqx-json-editor height="250" *ngIf="showImport" formControlName="importing"></sqx-json-editor>
|
|
</div>
|
|
</ng-container>
|
|
|
|
<ng-container footer>
|
|
<button type="button" class="btn btn-text-secondary2" (click)="cancel.emit()">
|
|
{{ 'common.cancel' | sqxTranslate }}
|
|
</button>
|
|
|
|
<button type="submit" class="btn btn-success">
|
|
{{ 'common.create' | sqxTranslate }}
|
|
</button>
|
|
</ng-container>
|
|
</sqx-modal-dialog>
|
|
</form>
|