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

View File

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

View File

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

View File

@ -23,6 +23,7 @@ export type InfoToExport =
| 'category'
| 'block'
| 'origin'
| 'tags'
| 'polls'
| 'id'
| '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
if (motion.motion_block && (!infoToExport || infoToExport.includes('block'))) {
metaTableBody.push([