diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-28 11:15:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-29 09:32:12 +0200 |
commit | 72c33e716fecd1826dcf645957f8669821f91ff3 (patch) | |
tree | 31d270c2afc2f07303fa491189d6b6b1c0ea8bb1 /client/src/app/+admin | |
parent | 8adf0a767f0816465ac3a8f4a6c63f53dd05fe3d (diff) | |
download | PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.gz PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.zst PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.zip |
Support broadcast messages
Diffstat (limited to 'client/src/app/+admin')
3 files changed, 65 insertions, 2 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 5703d5a2e..4ee573696 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | |||
@@ -276,6 +276,58 @@ | |||
276 | </div> | 276 | </div> |
277 | </div> | 277 | </div> |
278 | 278 | ||
279 | <div class="form-row mt-4"> <!-- broadcast grid --> | ||
280 | <div class="form-group col-12 col-lg-4 col-xl-3"> | ||
281 | <div i18n class="inner-form-title">BROADCAST MESSAGE</div> | ||
282 | <div i18n class="inner-for-description"> | ||
283 | Display a message on your instance | ||
284 | </div> | ||
285 | </div> | ||
286 | |||
287 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> | ||
288 | |||
289 | <ng-container formGroupName="broadcastMessage"> | ||
290 | |||
291 | <div class="form-group"> | ||
292 | <my-peertube-checkbox | ||
293 | inputName="broadcastMessageEnabled" formControlName="enabled" | ||
294 | i18n-labelText labelText="Enable broadcast message" | ||
295 | ></my-peertube-checkbox> | ||
296 | </div> | ||
297 | |||
298 | <div class="form-group"> | ||
299 | <my-peertube-checkbox | ||
300 | inputName="broadcastMessageDismissable" formControlName="dismissable" | ||
301 | i18n-labelText labelText="Allow users to dismiss the broadcast message " | ||
302 | ></my-peertube-checkbox> | ||
303 | </div> | ||
304 | |||
305 | <div class="form-group"> | ||
306 | <label i18n for="broadcastMessageLevel">Broadcast message level</label> | ||
307 | <div class="peertube-select-container"> | ||
308 | <select id="broadcastMessageLevel" formControlName="level" class="form-control"> | ||
309 | <option value="info">info</option> | ||
310 | <option value="warning">warning</option> | ||
311 | <option value="error">error</option> | ||
312 | </select> | ||
313 | </div> | ||
314 | <div *ngIf="formErrors.broadcastMessage.level" class="form-error">{{ formErrors.broadcastMessage.level }}</div> | ||
315 | </div> | ||
316 | |||
317 | <div class="form-group"> | ||
318 | <label i18n for="broadcastMessageMessage">Message</label><my-help helpType="markdownText"></my-help> | ||
319 | <my-markdown-textarea | ||
320 | name="broadcastMessageMessage" formControlName="message" textareaMaxWidth="500px" | ||
321 | [classes]="{ 'input-error': formErrors['broadcastMessage.message'] }" | ||
322 | ></my-markdown-textarea> | ||
323 | <div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div> | ||
324 | </div> | ||
325 | |||
326 | </ng-container> | ||
327 | |||
328 | </div> | ||
329 | </div> | ||
330 | |||
279 | <div class="form-row mt-4"> <!-- new users grid --> | 331 | <div class="form-row mt-4"> <!-- new users grid --> |
280 | <div class="form-group col-12 col-lg-4 col-xl-3"> | 332 | <div class="form-group col-12 col-lg-4 col-xl-3"> |
281 | <div i18n class="inner-form-title">NEW USERS</div> | 333 | <div i18n class="inner-form-title">NEW USERS</div> |
@@ -801,8 +853,9 @@ | |||
801 | <div class="form-row mt-4"> <!-- submit placement block --> | 853 | <div class="form-row mt-4"> <!-- submit placement block --> |
802 | <div class="col-md-7 col-xl-5"></div> | 854 | <div class="col-md-7 col-xl-5"></div> |
803 | <div class="col-md-5 col-xl-5"> | 855 | <div class="col-md-5 col-xl-5"> |
856 | <span class="form-error submit-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span> | ||
857 | |||
804 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> | 858 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> |
805 | <span class="form-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span> | ||
806 | </div> | 859 | </div> |
807 | </div> | 860 | </div> |
808 | </form> | 861 | </form> |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss index 9ee960ad6..2bfa92da4 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss | |||
@@ -76,4 +76,8 @@ ngb-tabset:not(.previews) ::ng-deep { | |||
76 | .nav-link { | 76 | .nav-link { |
77 | font-size: 105%; | 77 | font-size: 105%; |
78 | } | 78 | } |
79 | } \ No newline at end of file | 79 | } |
80 | |||
81 | .submit-error { | ||
82 | margin-bottom: 20px; | ||
83 | } | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index cea314cea..6d59494c8 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -215,6 +215,12 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
215 | indexUrl: this.customConfigValidatorsService.INDEX_URL | 215 | indexUrl: this.customConfigValidatorsService.INDEX_URL |
216 | } | 216 | } |
217 | } | 217 | } |
218 | }, | ||
219 | broadcastMessage: { | ||
220 | enabled: null, | ||
221 | level: null, | ||
222 | dismissable: null, | ||
223 | message: null | ||
218 | } | 224 | } |
219 | } | 225 | } |
220 | 226 | ||