From 61cbafc1f80a33a895b54b15751a42e0d78af231 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Jun 2021 10:31:27 +0200 Subject: Improve channel card custom markup --- .../shared/shared-custom-markup/custom-markup.service.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/shared-custom-markup/custom-markup.service.ts') 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 db5f64ee8..aa5dbe643 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 @@ -122,7 +122,13 @@ export class CustomMarkupService { const data = el.dataset as ChannelMiniatureMarkupData const component = this.dynamicElementService.createElement(ChannelMiniatureMarkupComponent) - this.dynamicElementService.setModel(component, { name: data.name }) + const model = { + name: data.name, + displayLatestVideo: this.buildBoolean(data.displayLatestVideo) ?? true, + displayDescription: this.buildBoolean(data.displayDescription) ?? true + } + + this.dynamicElementService.setModel(component, model) return component } @@ -178,7 +184,12 @@ export class CustomMarkupService { const data = el.dataset as ContainerMarkupData const root = document.createElement('div') - root.classList.add('peertube-container') + + const layoutClass = data.layout + ? 'layout-' + data.layout + : 'layout-row' + + root.classList.add('peertube-container', layoutClass) if (data.width) { root.setAttribute('width', data.width) -- cgit v1.2.3