aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <chocobozzz@framasoft.org>2019-11-25 11:19:45 +0100
committerChocobozzz <chocobozzz@framasoft.org>2019-11-25 11:19:45 +0100
commitf84dde5e12b18e8a36a837c195118cf9b1df5b20 (patch)
tree1a495031f008565b6fa5e13a5676841b0fc3b8c9 /client
parentf92bb405d48af737636fec1025e19f27d7044158 (diff)
parent2dbbf86086bd6bc29343e6c4fbd0d664ec877ac7 (diff)
downloadPeerTube-f84dde5e12b18e8a36a837c195118cf9b1df5b20.tar.gz
PeerTube-f84dde5e12b18e8a36a837c195118cf9b1df5b20.tar.zst
PeerTube-f84dde5e12b18e8a36a837c195118cf9b1df5b20.zip
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
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html11
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss1
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-list.component.scss4
-rw-r--r--client/src/app/shared/forms/peertube-checkbox.component.html1
-rw-r--r--client/src/app/shared/forms/peertube-checkbox.component.ts1
5 files changed, 15 insertions, 3 deletions
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
index aae08b94d..95dd74d31 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
@@ -7,9 +7,16 @@
7 7
8 <form *ngIf="hasRegisteredSettings()" role="form" (ngSubmit)="formValidated()" [formGroup]="form"> 8 <form *ngIf="hasRegisteredSettings()" role="form" (ngSubmit)="formValidated()" [formGroup]="form">
9 <div class="form-group" *ngFor="let setting of registeredSettings"> 9 <div class="form-group" *ngFor="let setting of registeredSettings">
10 <label [attr.for]="setting.name">{{ setting.label }}</label> 10 <label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label>
11
12 <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" /> 11 <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
12 <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
13
14 <my-peertube-checkbox
15 *ngIf="setting.type === 'input-checkbox'"
16 [id]="setting.name"
17 [formControlName]="setting.name"
18 [labelInnerHTML]="setting.label"
19 ></my-peertube-checkbox>
13 20
14 <div *ngIf="formErrors[setting.name]" class="form-error"> 21 <div *ngIf="formErrors[setting.name]" class="form-error">
15 {{ formErrors[setting.name] }} 22 {{ formErrors[setting.name] }}
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
index 42fc1b634..21c180a70 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
@@ -5,6 +5,7 @@ h2 {
5 margin-bottom: 20px; 5 margin-bottom: 20px;
6} 6}
7 7
8textarea,
8input:not([type=submit]) { 9input:not([type=submit]) {
9 @include peertube-input-text(340px); 10 @include peertube-input-text(340px);
10 display: block; 11 display: block;
diff --git a/client/src/app/+admin/plugins/shared/plugin-list.component.scss b/client/src/app/+admin/plugins/shared/plugin-list.component.scss
index 3663d3fdd..87a709b00 100644
--- a/client/src/app/+admin/plugins/shared/plugin-list.component.scss
+++ b/client/src/app/+admin/plugins/shared/plugin-list.component.scss
@@ -21,7 +21,8 @@
21} 21}
22 22
23.second-row { 23.second-row {
24 display: flex; 24 display: grid;
25 grid-template-columns: 1fr auto;
25 align-items: center; 26 align-items: center;
26 justify-content: space-between; 27 justify-content: space-between;
27 28
@@ -30,6 +31,7 @@
30 } 31 }
31 32
32 .buttons { 33 .buttons {
34 margin-left: 10px;
33 > *:not(:last-child) { 35 > *:not(:last-child) {
34 margin-right: 10px; 36 margin-right: 10px;
35 } 37 }
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.html b/client/src/app/shared/forms/peertube-checkbox.component.html
index f1e3bf0bf..1c0114d97 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.html
+++ b/client/src/app/shared/forms/peertube-checkbox.component.html
@@ -3,6 +3,7 @@
3 <input type="checkbox" [(ngModel)]="checked" (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="disabled" /> 3 <input type="checkbox" [(ngModel)]="checked" (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="disabled" />
4 <span role="checkbox" [attr.aria-checked]="checked"></span> 4 <span role="checkbox" [attr.aria-checked]="checked"></span>
5 <span *ngIf="labelText">{{ labelText }}</span> 5 <span *ngIf="labelText">{{ labelText }}</span>
6 <span *ngIf="!labelText && labelInnerHTML" [innerHTML]="labelInnerHTML"></span>
6 7
7 <span *ngIf="labelTemplate"> 8 <span *ngIf="labelTemplate">
8 <ng-container *ngTemplateOutlet="labelTemplate"></ng-container> 9 <ng-container *ngTemplateOutlet="labelTemplate"></ng-container>
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.ts b/client/src/app/shared/forms/peertube-checkbox.component.ts
index 3b8f39ed0..0303b7e2a 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.ts
+++ b/client/src/app/shared/forms/peertube-checkbox.component.ts
@@ -18,6 +18,7 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
18 @Input() checked = false 18 @Input() checked = false
19 @Input() inputName: string 19 @Input() inputName: string
20 @Input() labelText: string 20 @Input() labelText: string
21 @Input() labelInnerHTML: string
21 @Input() helpPlacement = 'top' 22 @Input() helpPlacement = 'top'
22 @Input() disabled = false 23 @Input() disabled = false
23 24