diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/dynamic-form-field.component.html')
-rw-r--r-- | client/src/app/shared/shared-forms/dynamic-form-field.component.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.html b/client/src/app/shared/shared-forms/dynamic-form-field.component.html new file mode 100644 index 000000000..c111ea7df --- /dev/null +++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.html | |||
@@ -0,0 +1,35 @@ | |||
1 | <div [formGroup]="form"> | ||
2 | <label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label> | ||
3 | |||
4 | <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" /> | ||
5 | |||
6 | <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea> | ||
7 | |||
8 | <my-help *ngIf="setting.type === 'markdown-text'" helpType="markdownText"></my-help> | ||
9 | |||
10 | <my-help *ngIf="setting.type === 'markdown-enhanced'" helpType="markdownEnhanced"></my-help> | ||
11 | |||
12 | <my-markdown-textarea | ||
13 | *ngIf="setting.type === 'markdown-text'" | ||
14 | markdownType="text" [id]="setting.name" [formControlName]="setting.name" textareaWidth="500px" | ||
15 | [classes]="{ 'input-error': formErrors['settings.name'] }" | ||
16 | ></my-markdown-textarea> | ||
17 | |||
18 | <my-markdown-textarea | ||
19 | *ngIf="setting.type === 'markdown-enhanced'" | ||
20 | markdownType="enhanced" [id]="setting.name" [formControlName]="setting.name" textareaWidth="500px" | ||
21 | [classes]="{ 'input-error': formErrors['settings.name'] }" | ||
22 | ></my-markdown-textarea> | ||
23 | |||
24 | <my-peertube-checkbox | ||
25 | *ngIf="setting.type === 'input-checkbox'" | ||
26 | [id]="setting.name" | ||
27 | [formControlName]="setting.name" | ||
28 | [labelInnerHTML]="setting.label" | ||
29 | ></my-peertube-checkbox> | ||
30 | |||
31 | <div *ngIf="formErrors[setting.name]" class="form-error"> | ||
32 | {{ formErrors[setting.name] }} | ||
33 | </div> | ||
34 | |||
35 | </div> | ||