From 8ee25e17b88b970703f4df9e74cb4726bbffd837 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 31 May 2021 11:33:49 +0200 Subject: [PATCH] Add ability to set custom markdown in description --- .../about-instance.component.html | 4 +-- .../about-instance.component.ts | 20 +++++++++++--- client/src/app/+about/about.module.ts | 4 ++- .../edit-homepage.component.html | 2 +- .../edit-homepage.component.ts | 8 +++--- .../edit-instance-information.component.html | 6 ++++- .../edit-instance-information.component.ts | 9 +++++++ client/src/app/+home/home.component.html | 2 +- client/src/app/+home/home.component.ts | 10 +++---- .../custom-markup-container.component.html | 1 + .../custom-markup-container.component.ts | 26 +++++++++++++++++++ .../custom-markup.service.ts | 24 ++++++++++++----- .../app/shared/shared-custom-markup/index.ts | 1 + .../button-markup.component.html | 0 .../button-markup.component.scss | 0 .../button-markup.component.ts | 2 +- .../channel-miniature-markup.component.html | 0 .../channel-miniature-markup.component.scss | 0 .../channel-miniature-markup.component.ts | 2 +- .../embed-markup.component.ts | 0 .../peertube-custom-tags/index.ts | 6 +++++ .../playlist-miniature-markup.component.html | 0 .../playlist-miniature-markup.component.scss | 0 .../playlist-miniature-markup.component.ts | 4 +-- .../video-miniature-markup.component.html | 0 .../video-miniature-markup.component.scss | 0 .../video-miniature-markup.component.ts | 4 +-- .../videos-list-markup.component.html | 0 .../videos-list-markup.component.scss | 0 .../videos-list-markup.component.ts | 4 +-- .../shared-custom-markup.module.ts | 21 +++++++++------ .../instance-about-accordion.component.ts | 1 - .../shared-instance/instance.service.ts | 1 - .../shared-instance/shared-instance.module.ts | 4 ++- 34 files changed, 118 insertions(+), 48 deletions(-) create mode 100644 client/src/app/shared/shared-custom-markup/custom-markup-container.component.html create mode 100644 client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/button-markup.component.html (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/button-markup.component.scss (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/button-markup.component.ts (93%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/channel-miniature-markup.component.html (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/channel-miniature-markup.component.scss (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/channel-miniature-markup.component.ts (89%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/embed-markup.component.ts (100%) create mode 100644 client/src/app/shared/shared-custom-markup/peertube-custom-tags/index.ts rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/playlist-miniature-markup.component.html (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/playlist-miniature-markup.component.scss (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/playlist-miniature-markup.component.ts (84%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/video-miniature-markup.component.html (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/video-miniature-markup.component.scss (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/video-miniature-markup.component.ts (87%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/videos-list-markup.component.html (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/videos-list-markup.component.scss (100%) rename client/src/app/shared/shared-custom-markup/{ => peertube-custom-tags}/videos-list-markup.component.ts (91%) diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html index 1f372090e..29dfd89fb 100644 --- a/client/src/app/+about/about-instance/about-instance.component.html +++ b/client/src/app/+about/about-instance/about-instance.component.html @@ -91,7 +91,7 @@
Description -
+
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts index 7eb382a46..2e0996429 100644 --- a/client/src/app/+about/about-instance/about-instance.component.ts +++ b/client/src/app/+about/about-instance/about-instance.component.ts @@ -1,11 +1,12 @@ import { ViewportScroller } from '@angular/common' -import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' +import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' import { Notifier } from '@app/core' -import { copyToClipboard } from '../../../root-helpers/utils' +import { CustomMarkupService } from '@app/shared/shared-custom-markup' import { InstanceService } from '@app/shared/shared-instance' -import { ServerConfig } from '@shared/models' +import { About, ServerConfig } from '@shared/models' +import { copyToClipboard } from '../../../root-helpers/utils' import { ResolverData } from './about-instance.resolver' @Component({ @@ -14,12 +15,13 @@ import { ResolverData } from './about-instance.resolver' styleUrls: [ './about-instance.component.scss' ] }) export class AboutInstanceComponent implements OnInit, AfterViewChecked { + @ViewChild('descriptionWrapper') descriptionWrapper: ElementRef @ViewChild('contactAdminModal', { static: true }) contactAdminModal: ContactAdminModalComponent shortDescription = '' + descriptionContent: string html = { - description: '', terms: '', codeOfConduct: '', moderationInformation: '', @@ -40,6 +42,7 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked { private lastScrollHash: string constructor ( + private customMarkupService: CustomMarkupService, private viewportScroller: ViewportScroller, private route: ActivatedRoute, private notifier: Notifier, @@ -67,9 +70,12 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked { this.categories = categories this.shortDescription = about.instance.shortDescription + this.descriptionContent = about.instance.description this.html = await this.instanceService.buildHtml(about) + await this.injectDescription(about) + this.initialized = true } @@ -90,4 +96,10 @@ export class AboutInstanceComponent implements OnInit, AfterViewChecked { copyToClipboard(link) this.notifier.success(link, $localize `Link copied`) } + + private async injectDescription (about: About) { + const element = await this.customMarkupService.buildElement(about.instance.description) + + this.descriptionWrapper.nativeElement.appendChild(element) + } } diff --git a/client/src/app/+about/about.module.ts b/client/src/app/+about/about.module.ts index 1aca14033..dfea52fb8 100644 --- a/client/src/app/+about/about.module.ts +++ b/client/src/app/+about/about.module.ts @@ -5,6 +5,7 @@ import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component' import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' +import { SharedCustomMarkupModule } from '@app/shared/shared-custom-markup' import { SharedFormModule } from '@app/shared/shared-forms' import { SharedGlobalIconModule } from '@app/shared/shared-icons' import { SharedInstanceModule } from '@app/shared/shared-instance' @@ -19,7 +20,8 @@ import { AboutComponent } from './about.component' SharedMainModule, SharedFormModule, SharedInstanceModule, - SharedGlobalIconModule + SharedGlobalIconModule, + SharedCustomMarkupModule ], declarations: [ 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 @@ 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' templateUrl: './edit-homepage.component.html', styleUrls: [ './edit-custom-config.component.scss' ] }) -export class EditHomepageComponent implements OnInit { +export class EditHomepageComponent { @Input() form: FormGroup @Input() formErrors: any @@ -17,9 +17,7 @@ export class EditHomepageComponent implements OnInit { } - ngOnInit () { - this.customMarkdownRenderer = async (text: string) => { - return this.customMarkup.buildElement(text) - } + getCustomMarkdownRenderer () { + return this.customMarkup.getCustomMarkdownRenderer() } } 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 @@
- + +
+ +
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 @@ import { SelectOptionsItem } from 'src/types/select-options-item.model' import { Component, Input } from '@angular/core' import { FormGroup } from '@angular/forms' +import { CustomMarkupService } from '@app/shared/shared-custom-markup' @Component({ selector: 'my-edit-instance-information', @@ -13,4 +14,12 @@ export class EditInstanceInformationComponent { @Input() languageItems: SelectOptionsItem[] = [] @Input() categoryItems: SelectOptionsItem[] = [] + + constructor (private customMarkup: CustomMarkupService) { + + } + + getCustomMarkdownRenderer () { + return this.customMarkup.getCustomMarkdownRenderer() + } } 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 @@
-
+
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 @@ - import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' -import { CustomMarkupService } from '@app/shared/shared-custom-markup' import { CustomPageService } from '@app/shared/shared-main/custom-page' @Component({ @@ -11,16 +9,14 @@ import { CustomPageService } from '@app/shared/shared-main/custom-page' export class HomeComponent implements OnInit { @ViewChild('contentWrapper') contentWrapper: ElementRef + homepageContent: string + constructor ( - private customMarkupService: CustomMarkupService, private customPageService: CustomPageService ) { } async ngOnInit () { this.customPageService.getInstanceHomepage() - .subscribe(async ({ content }) => { - const element = await this.customMarkupService.buildElement(content) - this.contentWrapper.nativeElement.appendChild(element) - }) + .subscribe(({ content }) => this.homepageContent = content) } } diff --git a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.html b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.html new file mode 100644 index 000000000..3ad88645d --- /dev/null +++ b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.html @@ -0,0 +1 @@ +
diff --git a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts new file mode 100644 index 000000000..3d49c6768 --- /dev/null +++ b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts @@ -0,0 +1,26 @@ +import { Component, ElementRef, Input, OnChanges, ViewChild } from '@angular/core' +import { CustomMarkupService } from './custom-markup.service' + +@Component({ + selector: 'my-custom-markup-container', + templateUrl: './custom-markup-container.component.html' +}) +export class CustomMarkupContainerComponent implements OnChanges { + @ViewChild('contentWrapper') contentWrapper: ElementRef + + @Input() content: string + + constructor ( + private customMarkupService: CustomMarkupService + ) { } + + async ngOnChanges () { + await this.buildElement() + } + + private async buildElement () { + const element = await this.customMarkupService.buildElement(this.content) + this.contentWrapper.nativeElement.appendChild(element) + } + +} diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts index 09414da95..dbb07914e 100644 --- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts +++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts @@ -8,13 +8,15 @@ import { VideoMiniatureMarkupData, VideosListMarkupData } from '@shared/models' -import { ButtonMarkupComponent } from './button-markup.component' -import { ChannelMiniatureMarkupComponent } from './channel-miniature-markup.component' import { DynamicElementService } from './dynamic-element.service' -import { EmbedMarkupComponent } from './embed-markup.component' -import { PlaylistMiniatureMarkupComponent } from './playlist-miniature-markup.component' -import { VideoMiniatureMarkupComponent } from './video-miniature-markup.component' -import { VideosListMarkupComponent } from './videos-list-markup.component' +import { + ButtonMarkupComponent, + ChannelMiniatureMarkupComponent, + EmbedMarkupComponent, + PlaylistMiniatureMarkupComponent, + VideoMiniatureMarkupComponent, + VideosListMarkupComponent +} from './peertube-custom-tags' type BuilderFunction = (el: HTMLElement) => ComponentRef @@ -30,10 +32,18 @@ export class CustomMarkupService { 'peertube-videos-list': el => this.videosListBuilder(el) } + private customMarkdownRenderer: (text: string) => Promise + constructor ( private dynamicElementService: DynamicElementService, private markdown: MarkdownService - ) { } + ) { + this.customMarkdownRenderer = async (text: string) => this.buildElement(text) + } + + getCustomMarkdownRenderer () { + return this.customMarkdownRenderer + } async buildElement (text: string) { const html = await this.markdown.customPageMarkdownToHTML(text, this.getSupportedTags()) diff --git a/client/src/app/shared/shared-custom-markup/index.ts b/client/src/app/shared/shared-custom-markup/index.ts index a9ac2516c..3bff3a914 100644 --- a/client/src/app/shared/shared-custom-markup/index.ts +++ b/client/src/app/shared/shared-custom-markup/index.ts @@ -1,4 +1,5 @@ export * from './custom-markup.service' +export * from './custom-markup-container.component' export * from './dynamic-element.service' export * from './custom-markup-help.component' export * from './shared-custom-markup.module' diff --git a/client/src/app/shared/shared-custom-markup/button-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.html similarity index 100% rename from client/src/app/shared/shared-custom-markup/button-markup.component.html rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.html diff --git a/client/src/app/shared/shared-custom-markup/button-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.scss similarity index 100% rename from client/src/app/shared/shared-custom-markup/button-markup.component.scss rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.scss diff --git a/client/src/app/shared/shared-custom-markup/button-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts similarity index 93% rename from client/src/app/shared/shared-custom-markup/button-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts index c0aab2edd..987b37d19 100644 --- a/client/src/app/shared/shared-custom-markup/button-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core' -import { VideoChannel } from '../shared-main' +import { VideoChannel } from '../../shared-main' /* * Markup component that creates a button diff --git a/client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html similarity index 100% rename from client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.html rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html diff --git a/client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss similarity index 100% rename from client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.scss rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss diff --git a/client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts similarity index 89% rename from client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts index 97bb5567e..25deafb80 100644 --- a/client/src/app/shared/shared-custom-markup/channel-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core' -import { VideoChannel, VideoChannelService } from '../shared-main' +import { VideoChannel, VideoChannelService } from '../../shared-main' /* * Markup component that creates a channel miniature only diff --git a/client/src/app/shared/shared-custom-markup/embed-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts similarity index 100% rename from client/src/app/shared/shared-custom-markup/embed-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/index.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/index.ts new file mode 100644 index 000000000..ee2a8f330 --- /dev/null +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/index.ts @@ -0,0 +1,6 @@ +export * from './button-markup.component' +export * from './channel-miniature-markup.component' +export * from './embed-markup.component' +export * from './playlist-miniature-markup.component' +export * from './video-miniature-markup.component' +export * from './videos-list-markup.component' diff --git a/client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.html similarity index 100% rename from client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.html rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.html diff --git a/client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.scss similarity index 100% rename from client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.scss rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.scss diff --git a/client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts similarity index 84% rename from client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts index 7aee450f1..eddc3636e 100644 --- a/client/src/app/shared/shared-custom-markup/playlist-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core' -import { MiniatureDisplayOptions } from '../shared-video-miniature' -import { VideoPlaylist, VideoPlaylistService } from '../shared-video-playlist' +import { MiniatureDisplayOptions } from '../../shared-video-miniature' +import { VideoPlaylist, VideoPlaylistService } from '../../shared-video-playlist' /* * Markup component that creates a playlist miniature only diff --git a/client/src/app/shared/shared-custom-markup/video-miniature-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.html similarity index 100% rename from client/src/app/shared/shared-custom-markup/video-miniature-markup.component.html rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.html diff --git a/client/src/app/shared/shared-custom-markup/video-miniature-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.scss similarity index 100% rename from client/src/app/shared/shared-custom-markup/video-miniature-markup.component.scss rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.scss diff --git a/client/src/app/shared/shared-custom-markup/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts similarity index 87% rename from client/src/app/shared/shared-custom-markup/video-miniature-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts index 79add0c3b..c833c56c7 100644 --- a/client/src/app/shared/shared-custom-markup/video-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core' import { AuthService } from '@app/core' -import { Video, VideoService } from '../shared-main' -import { MiniatureDisplayOptions } from '../shared-video-miniature' +import { Video, VideoService } from '../../shared-main' +import { MiniatureDisplayOptions } from '../../shared-video-miniature' /* * Markup component that creates a video miniature only diff --git a/client/src/app/shared/shared-custom-markup/videos-list-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.html similarity index 100% rename from client/src/app/shared/shared-custom-markup/videos-list-markup.component.html rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.html diff --git a/client/src/app/shared/shared-custom-markup/videos-list-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss similarity index 100% rename from client/src/app/shared/shared-custom-markup/videos-list-markup.component.scss rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss diff --git a/client/src/app/shared/shared-custom-markup/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts similarity index 91% rename from client/src/app/shared/shared-custom-markup/videos-list-markup.component.ts rename to client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index cc25d0a51..8d9e223da 100644 --- a/client/src/app/shared/shared-custom-markup/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit } from '@angular/core' import { AuthService } from '@app/core' import { VideoSortField } from '@shared/models' -import { Video, VideoService } from '../shared-main' -import { MiniatureDisplayOptions } from '../shared-video-miniature' +import { Video, VideoService } from '../../shared-main' +import { MiniatureDisplayOptions } from '../../shared-video-miniature' /* * Markup component list videos depending on criterias diff --git a/client/src/app/shared/shared-custom-markup/shared-custom-markup.module.ts b/client/src/app/shared/shared-custom-markup/shared-custom-markup.module.ts index 66f6b98f6..dccd64709 100644 --- a/client/src/app/shared/shared-custom-markup/shared-custom-markup.module.ts +++ b/client/src/app/shared/shared-custom-markup/shared-custom-markup.module.ts @@ -5,15 +5,18 @@ import { SharedGlobalIconModule } from '../shared-icons' import { SharedMainModule } from '../shared-main' import { SharedVideoMiniatureModule } from '../shared-video-miniature' import { SharedVideoPlaylistModule } from '../shared-video-playlist' -import { ButtonMarkupComponent } from './button-markup.component' -import { ChannelMiniatureMarkupComponent } from './channel-miniature-markup.component' +import { CustomMarkupContainerComponent } from './custom-markup-container.component' import { CustomMarkupHelpComponent } from './custom-markup-help.component' import { CustomMarkupService } from './custom-markup.service' import { DynamicElementService } from './dynamic-element.service' -import { EmbedMarkupComponent } from './embed-markup.component' -import { PlaylistMiniatureMarkupComponent } from './playlist-miniature-markup.component' -import { VideoMiniatureMarkupComponent } from './video-miniature-markup.component' -import { VideosListMarkupComponent } from './videos-list-markup.component' +import { + ButtonMarkupComponent, + ChannelMiniatureMarkupComponent, + EmbedMarkupComponent, + PlaylistMiniatureMarkupComponent, + VideoMiniatureMarkupComponent, + VideosListMarkupComponent +} from './peertube-custom-tags' @NgModule({ imports: [ @@ -33,7 +36,8 @@ import { VideosListMarkupComponent } from './videos-list-markup.component' EmbedMarkupComponent, VideosListMarkupComponent, ButtonMarkupComponent, - CustomMarkupHelpComponent + CustomMarkupHelpComponent, + CustomMarkupContainerComponent ], exports: [ @@ -43,7 +47,8 @@ import { VideosListMarkupComponent } from './videos-list-markup.component' VideosListMarkupComponent, EmbedMarkupComponent, ButtonMarkupComponent, - CustomMarkupHelpComponent + CustomMarkupHelpComponent, + CustomMarkupContainerComponent ], providers: [ diff --git a/client/src/app/shared/shared-instance/instance-about-accordion.component.ts b/client/src/app/shared/shared-instance/instance-about-accordion.component.ts index ab75c31ae..8e7bf2021 100644 --- a/client/src/app/shared/shared-instance/instance-about-accordion.component.ts +++ b/client/src/app/shared/shared-instance/instance-about-accordion.component.ts @@ -23,7 +23,6 @@ export class InstanceAboutAccordionComponent implements OnInit { about: About aboutHtml = { - description: '', terms: '', codeOfConduct: '', moderationInformation: '', diff --git a/client/src/app/shared/shared-instance/instance.service.ts b/client/src/app/shared/shared-instance/instance.service.ts index 0a30446df..70e022178 100644 --- a/client/src/app/shared/shared-instance/instance.service.ts +++ b/client/src/app/shared/shared-instance/instance.service.ts @@ -40,7 +40,6 @@ export class InstanceService { async buildHtml (about: About) { const html = { - description: '', terms: '', codeOfConduct: '', moderationInformation: '', diff --git a/client/src/app/shared/shared-instance/shared-instance.module.ts b/client/src/app/shared/shared-instance/shared-instance.module.ts index 13c681ab8..77a64b538 100644 --- a/client/src/app/shared/shared-instance/shared-instance.module.ts +++ b/client/src/app/shared/shared-instance/shared-instance.module.ts @@ -1,6 +1,7 @@ import { NgModule } from '@angular/core' import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap' +import { SharedCustomMarkupModule } from '../shared-custom-markup' import { SharedMainModule } from '../shared-main/shared-main.module' import { FeatureBooleanComponent } from './feature-boolean.component' import { InstanceAboutAccordionComponent } from './instance-about-accordion.component' @@ -12,7 +13,8 @@ import { InstanceService } from './instance.service' @NgModule({ imports: [ SharedMainModule, - NgbAccordionModule + NgbAccordionModule, + SharedCustomMarkupModule ], declarations: [