From 2b163af5d7fdda8b953774883f0906a5229530c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Tue, 14 May 2019 19:48:58 +0200 Subject: [PATCH] Improved users PDF and CSV export - PDF: use full_name (with structure_level and number) instead of short_name. - CSV: add gender column --- .../motion-block-detail.component.ts | 2 +- .../components/user-list/user-list.component.ts | 3 ++- .../src/app/site/users/services/user-pdf.service.ts | 13 ++----------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts index 97b72b20c..19b33bd34 100644 --- a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts @@ -79,7 +79,7 @@ export class MotionBlockDetailComponent extends ListViewBaseComponent imp { property: 'is_present', label: 'Is present' }, { property: 'is_committee', label: 'Is a committee' }, { property: 'default_password', label: 'Initial password' }, - { property: 'email' } + { property: 'email' }, + { property: 'gender' } ], this.translate.instant('Participants') + '.csv' ); diff --git a/client/src/app/site/users/services/user-pdf.service.ts b/client/src/app/site/users/services/user-pdf.service.ts index 8795214d2..3209048e0 100644 --- a/client/src/app/site/users/services/user-pdf.service.ts +++ b/client/src/app/site/users/services/user-pdf.service.ts @@ -242,10 +242,6 @@ export class UserPdfService { text: this.translate.instant('Name'), style: 'tableHeader' }, - { - text: this.translate.instant('Structure level'), - style: 'tableHeader' - }, { text: this.translate.instant('Groups'), style: 'tableHeader' @@ -254,7 +250,7 @@ export class UserPdfService { ]; return { table: { - widths: ['auto', '*', 'auto', 'auto'], + widths: ['auto', '*', 'auto'], headerRows: 1, body: userTableBody.concat(this.getListUsers(users)) }, @@ -274,12 +270,7 @@ export class UserPdfService { let counter = 1; users.forEach(user => { const groupList = user.groups.map(grp => this.translate.instant(grp.name)); - result.push([ - { text: '' + counter }, - { text: user.short_name }, - { text: user.structure_level }, - { text: groupList.join(', ') } - ]); + result.push([{ text: '' + counter }, { text: user.full_name }, { text: groupList.join(', ') }]); counter += 1; }); return result;