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/+home | |
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/+home')
-rw-r--r-- | client/src/app/+home/home.component.html | 2 | ||||
-rw-r--r-- | client/src/app/+home/home.component.ts | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/+home/home.component.html b/client/src/app/+home/home.component.html index 645b9dc69..dfce46618 100644 --- a/client/src/app/+home/home.component.html +++ b/client/src/app/+home/home.component.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <div class="root margin-content"> | 1 | <div class="root margin-content"> |
2 | <div #contentWrapper></div> | 2 | <my-custom-markup-container [content]="homepageContent"></my-custom-markup-container> |
3 | </div> | 3 | </div> |
4 | 4 | ||
diff --git a/client/src/app/+home/home.component.ts b/client/src/app/+home/home.component.ts index 16d3a6df7..6e0c96760 100644 --- a/client/src/app/+home/home.component.ts +++ b/client/src/app/+home/home.component.ts | |||
@@ -1,6 +1,4 @@ | |||
1 | |||
2 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
3 | import { CustomMarkupService } from '@app/shared/shared-custom-markup' | ||
4 | import { CustomPageService } from '@app/shared/shared-main/custom-page' | 2 | import { CustomPageService } from '@app/shared/shared-main/custom-page' |
5 | 3 | ||
6 | @Component({ | 4 | @Component({ |
@@ -11,16 +9,14 @@ import { CustomPageService } from '@app/shared/shared-main/custom-page' | |||
11 | export class HomeComponent implements OnInit { | 9 | export class HomeComponent implements OnInit { |
12 | @ViewChild('contentWrapper') contentWrapper: ElementRef<HTMLInputElement> | 10 | @ViewChild('contentWrapper') contentWrapper: ElementRef<HTMLInputElement> |
13 | 11 | ||
12 | homepageContent: string | ||
13 | |||
14 | constructor ( | 14 | constructor ( |
15 | private customMarkupService: CustomMarkupService, | ||
16 | private customPageService: CustomPageService | 15 | private customPageService: CustomPageService |
17 | ) { } | 16 | ) { } |
18 | 17 | ||
19 | async ngOnInit () { | 18 | async ngOnInit () { |
20 | this.customPageService.getInstanceHomepage() | 19 | this.customPageService.getInstanceHomepage() |
21 | .subscribe(async ({ content }) => { | 20 | .subscribe(({ content }) => this.homepageContent = content) |
22 | const element = await this.customMarkupService.buildElement(content) | ||
23 | this.contentWrapper.nativeElement.appendChild(element) | ||
24 | }) | ||
25 | } | 21 | } |
26 | } | 22 | } |