(plugins) adding checkbox and textarea as possible input types, add links in form...
authorRigel Kent <sendmemail@rigelk.eu>
Mon, 25 Nov 2019 10:19:45 +0000 (11:19 +0100)
committerChocobozzz <chocobozzz@framasoft.org>
Mon, 25 Nov 2019 10:19:45 +0000 (11:19 +0100)
client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
client/src/app/+admin/plugins/shared/plugin-list.component.scss
client/src/app/shared/forms/peertube-checkbox.component.html
client/src/app/shared/forms/peertube-checkbox.component.ts

index aae08b94d9c12f1b69791733cdcdf510ceb28091..95dd74d31cd1a21a84d949de7810f187fe1a31cc 100644 (file)
@@ -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] }}
index 42fc1b634b90a83e8cf8a9fd2ec8d3cc12efec8a..21c180a701ed6b4ccf13e95b8c058d761a542643 100644 (file)
@@ -5,6 +5,7 @@ h2 {
   margin-bottom: 20px;
 }
 
+textarea,
 input:not([type=submit]) {
   @include peertube-input-text(340px);
   display: block;
index 3663d3fddf2fc3f9e3bc0e03e157996a3431972b..87a709b00b6911a75fa5ba984ab2363d3f8a28d7 100644 (file)
@@ -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;
     }
index f1e3bf0bf586ea4a9222fc8da0911b5d0794e848..1c0114d970e757f85a025867825c4c7d142d7acc 100644 (file)
@@ -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>
index 3b8f39ed080110a9dd0a8c458962f3942f620e39..0303b7e2a4c4540b8b1f8326ffefe41931334773 100644 (file)
@@ -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