diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-31 11:33:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-31 11:33:49 +0200 |
commit | 8ee25e17b88b970703f4df9e74cb4726bbffd837 (patch) | |
tree | 450d73715c747c82efe6c919ebeda6411c01c5e0 /client/src/app/+admin | |
parent | 15f35256af15b97d2298cc44e76ffcafe73a1c88 (diff) | |
download | PeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.tar.gz PeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.tar.zst PeerTube-8ee25e17b88b970703f4df9e74cb4726bbffd837.zip |
Add ability to set custom markdown in description
Diffstat (limited to 'client/src/app/+admin')
4 files changed, 18 insertions, 7 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html index baaac5fb7..2286a5a1a 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | <my-markdown-textarea | 18 | <my-markdown-textarea |
19 | name="instanceCustomHomepageContent" formControlName="content" textareaMaxWidth="90%" textareaHeight="300px" | 19 | name="instanceCustomHomepageContent" formControlName="content" textareaMaxWidth="90%" textareaHeight="300px" |
20 | [customMarkdownRenderer]="customMarkdownRenderer" | 20 | [customMarkdownRenderer]="getCustomMarkdownRenderer()" |
21 | [classes]="{ 'input-error': formErrors['instanceCustomHomepage.content'] }" | 21 | [classes]="{ 'input-error': formErrors['instanceCustomHomepage.content'] }" |
22 | ></my-markdown-textarea> | 22 | ></my-markdown-textarea> |
23 | 23 | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts index 7decf8f75..1923ede39 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts | |||
@@ -7,7 +7,7 @@ import { CustomMarkupService } from '@app/shared/shared-custom-markup' | |||
7 | templateUrl: './edit-homepage.component.html', | 7 | templateUrl: './edit-homepage.component.html', |
8 | styleUrls: [ './edit-custom-config.component.scss' ] | 8 | styleUrls: [ './edit-custom-config.component.scss' ] |
9 | }) | 9 | }) |
10 | export class EditHomepageComponent implements OnInit { | 10 | export class EditHomepageComponent { |
11 | @Input() form: FormGroup | 11 | @Input() form: FormGroup |
12 | @Input() formErrors: any | 12 | @Input() formErrors: any |
13 | 13 | ||
@@ -17,9 +17,7 @@ export class EditHomepageComponent implements OnInit { | |||
17 | 17 | ||
18 | } | 18 | } |
19 | 19 | ||
20 | ngOnInit () { | 20 | getCustomMarkdownRenderer () { |
21 | this.customMarkdownRenderer = async (text: string) => { | 21 | return this.customMarkup.getCustomMarkdownRenderer() |
22 | return this.customMarkup.buildElement(text) | ||
23 | } | ||
24 | } | 22 | } |
25 | } | 23 | } |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html index cbff26e5a..d806616bd 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html | |||
@@ -32,10 +32,14 @@ | |||
32 | </div> | 32 | </div> |
33 | 33 | ||
34 | <div class="form-group"> | 34 | <div class="form-group"> |
35 | <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help> | 35 | <label i18n for="instanceDescription">Description</label> |
36 | <div class="label-small-info"> | ||
37 | <my-custom-markup-help></my-custom-markup-help> | ||
38 | </div> | ||
36 | 39 | ||
37 | <my-markdown-textarea | 40 | <my-markdown-textarea |
38 | name="instanceDescription" formControlName="description" textareaMaxWidth="500px" | 41 | name="instanceDescription" formControlName="description" textareaMaxWidth="500px" |
42 | [customMarkdownRenderer]="getCustomMarkdownRenderer()" | ||
39 | [classes]="{ 'input-error': formErrors['instance.description'] }" | 43 | [classes]="{ 'input-error': formErrors['instance.description'] }" |
40 | ></my-markdown-textarea> | 44 | ></my-markdown-textarea> |
41 | 45 | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts index 26365e707..4185f121f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { SelectOptionsItem } from 'src/types/select-options-item.model' | 1 | import { SelectOptionsItem } from 'src/types/select-options-item.model' |
2 | import { Component, Input } from '@angular/core' | 2 | import { Component, Input } from '@angular/core' |
3 | import { FormGroup } from '@angular/forms' | 3 | import { FormGroup } from '@angular/forms' |
4 | import { CustomMarkupService } from '@app/shared/shared-custom-markup' | ||
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
6 | selector: 'my-edit-instance-information', | 7 | selector: 'my-edit-instance-information', |
@@ -13,4 +14,12 @@ export class EditInstanceInformationComponent { | |||
13 | 14 | ||
14 | @Input() languageItems: SelectOptionsItem[] = [] | 15 | @Input() languageItems: SelectOptionsItem[] = [] |
15 | @Input() categoryItems: SelectOptionsItem[] = [] | 16 | @Input() categoryItems: SelectOptionsItem[] = [] |
17 | |||
18 | constructor (private customMarkup: CustomMarkupService) { | ||
19 | |||
20 | } | ||
21 | |||
22 | getCustomMarkdownRenderer () { | ||
23 | return this.customMarkup.getCustomMarkdownRenderer() | ||
24 | } | ||
16 | } | 25 | } |