From f63838ff83790d9ff77ec35d15d8e17ae44812bf Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Mon, 17 Jun 2019 13:55:42 +0200 Subject: [PATCH] Adds extended label to pdf-export --- .../app/site/motions/services/motion-pdf-catalog.service.ts | 4 ++-- client/src/app/site/motions/services/motion-pdf.service.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/app/site/motions/services/motion-pdf-catalog.service.ts b/client/src/app/site/motions/services/motion-pdf-catalog.service.ts index 6e0b5fbf2..ad773197b 100644 --- a/client/src/app/site/motions/services/motion-pdf-catalog.service.ts +++ b/client/src/app/site/motions/services/motion-pdf-catalog.service.ts @@ -128,7 +128,7 @@ export class MotionPdfCatalogService { if (categories && categories.length) { const catTocBody = []; - for (const category of categories) { + for (const category of categories.sort((a, b) => a.weight - b.weight)) { // push the name of the category // make a table for correct alignment catTocBody.push({ @@ -136,7 +136,7 @@ export class MotionPdfCatalogService { body: [ [ { - text: category.prefix ? category.prefix + ' - ' + category.name : category.name, + text: category.prefixedNameWithParents, style: 'tocCategoryTitle' } ] diff --git a/client/src/app/site/motions/services/motion-pdf.service.ts b/client/src/app/site/motions/services/motion-pdf.service.ts index 2f6ccc30d..90f32efa3 100644 --- a/client/src/app/site/motions/services/motion-pdf.service.ts +++ b/client/src/app/site/motions/services/motion-pdf.service.ts @@ -271,9 +271,7 @@ export class MotionPdfService { style: 'boldText' }, { - text: motion.category.prefix - ? `${motion.category.prefix} - ${motion.category.name}` - : `${motion.category.name}` + text: motion.category.prefixedNameWithParents } ]); }