Merge pull request #4375 from tsiegleauq/pdf-motion-tag

Add tags to motion pdf
This commit is contained in:
Emanuel Schütze 2019-02-21 09:12:29 +01:00 committed by GitHub
commit 3bcb3de249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 6 deletions

View File

@ -49,6 +49,7 @@
<mat-button-toggle value="state"> <span translate>State</span> </mat-button-toggle> <mat-button-toggle value="state"> <span translate>State</span> </mat-button-toggle>
<mat-button-toggle value="recommendation"> <span translate>Recommendation</span> </mat-button-toggle> <mat-button-toggle value="recommendation"> <span translate>Recommendation</span> </mat-button-toggle>
<mat-button-toggle value="category"> <span translate>Category</span> </mat-button-toggle> <mat-button-toggle value="category"> <span translate>Category</span> </mat-button-toggle>
<mat-button-toggle value="tags"> <span translate>Tags</span> </mat-button-toggle>
<mat-button-toggle value="origin"> <span translate>Origin</span> </mat-button-toggle> <mat-button-toggle value="origin"> <span translate>Origin</span> </mat-button-toggle>
<mat-button-toggle value="block"> <span translate>Motion block</span> </mat-button-toggle> <mat-button-toggle value="block"> <span translate>Motion block</span> </mat-button-toggle>
<mat-button-toggle value="poll" #votingResultButton> <mat-button-toggle value="poll" #votingResultButton>
@ -59,11 +60,7 @@
</div> </div>
<div *ngIf="commentsToExport.length && exportForm.get('format').value === 'pdf'"> <div *ngIf="commentsToExport.length && exportForm.get('format').value === 'pdf'">
<p class="toggle-group-head" translate>Comments</p> <p class="toggle-group-head" translate>Comments</p>
<mat-button-toggle-group <mat-button-toggle-group class="smaller-buttons" multiple formControlName="comments">
class="smaller-buttons"
multiple
formControlName="comments"
>
<mat-button-toggle *ngFor="let comment of commentsToExport" [value]="comment.id"> <mat-button-toggle *ngFor="let comment of commentsToExport" [value]="comment.id">
<span>{{ comment.name }}</span> <span>{{ comment.name }}</span>
</mat-button-toggle> </mat-button-toggle>

View File

@ -51,6 +51,7 @@ export class MotionExportDialogComponent implements OnInit {
'recommendation', 'recommendation',
'category', 'category',
'origin', 'origin',
'tags',
'block', 'block',
'polls', 'polls',
'id' 'id'

View File

@ -198,7 +198,7 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
*/ */
public openExportDialog(): void { public openExportDialog(): void {
const exportDialogRef = this.dialog.open(MotionExportDialogComponent, { const exportDialogRef = this.dialog.open(MotionExportDialogComponent, {
width: '950px', width: '1100px',
maxWidth: '90vw', maxWidth: '90vw',
maxHeight: '90vh', maxHeight: '90vh',
data: this.dataSource data: this.dataSource

View File

@ -23,6 +23,7 @@ export type InfoToExport =
| 'category' | 'category'
| 'block' | 'block'
| 'origin' | 'origin'
| 'tags'
| 'polls' | 'polls'
| 'id' | 'id'
| 'allcomments'; | 'allcomments';
@ -252,6 +253,25 @@ export class MotionPdfService {
]); ]);
} }
// tags
if (motion.tags.length && (!infoToExport || infoToExport.includes('tags'))) {
const tags = motion.tags
.map(tag => {
return tag;
})
.join(', ');
metaTableBody.push([
{
text: `${this.translate.instant('Tags')}:`,
style: 'boldText'
},
{
text: tags
}
]);
}
// motion block // motion block
if (motion.motion_block && (!infoToExport || infoToExport.includes('block'))) { if (motion.motion_block && (!infoToExport || infoToExport.includes('block'))) {
metaTableBody.push([ metaTableBody.push([