mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-10-30 11:52:24 +03:00
Merge branch 'checkbox-input-plugin' into 'develop'
(plugins) adding checkbox and textarea as possible input types, add links in form label See merge request framasoft/peertube/PeerTube!25
This commit is contained in:
commit
f84dde5e12
@ -7,9 +7,16 @@
|
||||
|
||||
<form *ngIf="hasRegisteredSettings()" role="form" (ngSubmit)="formValidated()" [formGroup]="form">
|
||||
<div class="form-group" *ngFor="let setting of registeredSettings">
|
||||
<label [attr.for]="setting.name">{{ setting.label }}</label>
|
||||
|
||||
<label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label>
|
||||
<input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
|
||||
<textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
|
||||
|
||||
<my-peertube-checkbox
|
||||
*ngIf="setting.type === 'input-checkbox'"
|
||||
[id]="setting.name"
|
||||
[formControlName]="setting.name"
|
||||
[labelInnerHTML]="setting.label"
|
||||
></my-peertube-checkbox>
|
||||
|
||||
<div *ngIf="formErrors[setting.name]" class="form-error">
|
||||
{{ formErrors[setting.name] }}
|
||||
|
@ -5,6 +5,7 @@ h2 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input:not([type=submit]) {
|
||||
@include peertube-input-text(340px);
|
||||
display: block;
|
||||
|
@ -21,7 +21,8 @@
|
||||
}
|
||||
|
||||
.second-row {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
@ -30,6 +31,7 @@
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-left: 10px;
|
||||
> *:not(:last-child) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
<input type="checkbox" [(ngModel)]="checked" (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="disabled" />
|
||||
<span role="checkbox" [attr.aria-checked]="checked"></span>
|
||||
<span *ngIf="labelText">{{ labelText }}</span>
|
||||
<span *ngIf="!labelText && labelInnerHTML" [innerHTML]="labelInnerHTML"></span>
|
||||
|
||||
<span *ngIf="labelTemplate">
|
||||
<ng-container *ngTemplateOutlet="labelTemplate"></ng-container>
|
||||
|
@ -18,6 +18,7 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
|
||||
@Input() checked = false
|
||||
@Input() inputName: string
|
||||
@Input() labelText: string
|
||||
@Input() labelInnerHTML: string
|
||||
@Input() helpPlacement = 'top'
|
||||
@Input() disabled = false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user