Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ export class PdfDocumentService {
);
}
}
const margin: Margins = [lrMargin ? lrMargin[0] : 75, 30, lrMargin ? lrMargin[0] : 75, 10];
const margin: Margins = [lrMargin ? lrMargin[0] : 75, 18, lrMargin ? lrMargin[0] : 0, 35];
// pdfmake order: [left, top, right, bottom]

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,16 @@ export const getAgendaExportSubscriptionConfig: SubscriptionConfigGenerator = (.
follow: [
{
idField: `content_object_id`,
fieldset: [`number`, `title`, `agenda_item_id`, `text`, `poll_ids`, ...MEETING_ROUTING_FIELDS],
fieldset: [
`number`,
`title`,
`agenda_item_id`,
`text`,
`description`,
`poll_ids`,
`assignment`,
...MEETING_ROUTING_FIELDS
],
follow: [
{
idField: `list_of_speakers_id`,
Expand Down Expand Up @@ -271,6 +280,10 @@ export const getAgendaExportSubscriptionConfig: SubscriptionConfigGenerator = (.
{
idField: `poll_ids`,
...pollModelRequest
},
{
idField: `motion_ids`,
fieldset: [`title`, `meeting_id`, `sequential_number`, `number`, `block_id`]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TreeService } from 'src/app/ui/modules/sorting/modules/sorting-tree/ser

import { MeetingPdfExportService } from '../../../../services/export';
import { MeetingSettingsService } from '../../../../services/meeting-settings.service';
import { ViewMotion } from '../../../motions';
import { ViewPoll } from '../../../polls';
import { ViewSpeaker } from '../../modules/list-of-speakers/view-models/view-speaker';
import { ViewTopic } from '../../modules/topics/view-models';
Expand Down Expand Up @@ -231,7 +232,12 @@ export class AgendaPdfCatalogExportService {
const useTitle: boolean = info.includes(`title`);
const itemNumber: string = agendaItem.item_number ?? ``;
const title: string = agendaItem.content_object!.getTitle();
const styleName = agendaItem.level ? `header-child` : `header2`;
let styleName = `header2`;
let margin = ``;
if (agendaItem.level > 0) {
styleName = `header-child`;
margin = `margin-header-child`;
}
let numberOrTitle = ``;
if (agendaItem.content_object?.collection === `motion`) {
const motion = agendaItem.content_object;
Expand All @@ -252,6 +258,16 @@ export class AgendaPdfCatalogExportService {
numberOrTitle = `${itemNumber} `;
}
numberOrTitle = numberOrTitle.concat(`${this.translate.instant('Motion block')}: ${motionBlock.title}`);
} else if (agendaItem.content_object?.collection === `assignment`) {
const election = agendaItem.content_object;
if (useItemNumber && itemNumber) {
numberOrTitle = `${itemNumber} `;
}
numberOrTitle = numberOrTitle.concat(
election.number
? `${(this.translate.instant('Wahl'), election.number)}: ${election.title}`
: `${this.translate.instant('Wahl')}: ${election.title}`
);
} else {
if (useItemNumber && itemNumber && useTitle) {
numberOrTitle = `${itemNumber}: ${title}`;
Expand All @@ -263,17 +279,45 @@ export class AgendaPdfCatalogExportService {
}
return {
style: this.getStyle(styleName),
text: numberOrTitle
text: numberOrTitle,
margin: this.getStyle(margin)
};
}

private createTextDoc(agendaItem: ViewAgendaItem): Content {
const style = this.getStyle(`body-text`);
const margin = this.getStyle(`margin-body-text`);
if (!this.isTopic(agendaItem.content_object)) {
return [];
}
if (agendaItem.content_object?.getCSVExportText) {
const entry = this.htmlToPdfService.convertHtml({ htmlText: agendaItem.content_object?.text ?? `` });
return entry;
// MOTION
if (agendaItem.content_object?.collection === 'motion') {
const entry = this.htmlToPdfService.convertHtml({
htmlText: agendaItem.content_object?.text ?? `EMPTY ${agendaItem.content_object?.collection}`
});
return { text: [...entry], style: style, margin: margin };
// ASSIGNMENT / ELECTION
} else if (agendaItem.content_object?.collection === `assignment`) {
const entry = this.htmlToPdfService.convertHtml({
htmlText: agendaItem.content_object.description ?? `EMPTY ${agendaItem.content_object?.collection}`
});
return { text: [...entry], style: style, margin: margin };
// MOTION BLOCK
} else if (agendaItem.content_object?.collection === 'motion_block') {
const motions: ViewMotion[] = agendaItem.content_object?.motions || [];
const entry = this.htmlToPdfService.convertHtml({
htmlText:
motions.map(m => `Motion ${m.number}: ${m.title}`).join('<br><br>') ??
`EMPTY ${agendaItem.content_object.collection}`
});
return { text: entry, style: this.getStyle(`header3`), margin: margin };
} else {
return { text: agendaItem.content_object?.collection, style: style, margin: margin };
}
// AGENDA TOPIC
} else if (agendaItem.content_object?.getCSVExportText) {
const entry = this.htmlToPdfService.convertHtml({
htmlText: agendaItem.content_object?.text ?? `EMPTY ${agendaItem.content_object?.collection}`
});
return { text: [...entry], style: style, margin: margin };
}
return [];
}
Expand All @@ -286,14 +330,45 @@ export class AgendaPdfCatalogExportService {
const entry = this.htmlToPdfService.convertHtml({ htmlText: moderationNotes });
if (moderationNotes) {
this._addExtraSpace = true;
return [
{
text: this.translate.instant(`Moderation note`),
style: this.getStyle(`header3`),
margin: this.getStyle(`margin-header3`)
},
entry
];
const moderationText = {
text: entry
};
const text = this.translate.instant(`Moderation note`);
const style = [this.getStyle(`header3`), this.getStyle(`body-text`)];
const margin: [
[number, number, number, number],
[number, number, number, number],
[number, number, number, number],
[number, number, number, number]
] = [[20, 10, 0, 0], [25, 10, 0, 0], this.getStyle(`margin-header3`), this.getStyle(`margin-body-text`)];
// Indents the moderation note inside a subitem
if (agendaItem.level > 0) {
return [
{
text: text,
style: style[0],
margin: margin[0]
},
{
text: moderationText,
style: style[1],
margin: margin[1]
}
];
} else {
return [
{
text: text,
style: style[0],
margin: margin[2]
},
{
text: moderationText,
style: style[1],
margin: margin[3]
}
];
}
} else {
return [];
}
Expand Down Expand Up @@ -517,27 +592,34 @@ export class AgendaPdfCatalogExportService {
private getStyle(name: string): any {
switch (name) {
case `header1`:
return { bold: true, fontSize: 24 };
case `header2`:
return { bold: true, fontSize: 20 };
case `header2`:
return { bold: true, fontSize: 16 };
case `header3`:
return { bold: true, fontSize: 14 };
return { bold: true, fontSize: 12 };
case `header-child`:
return { bold: true, fontSize: 16 };
return { bold: true, fontSize: 14 };
case `table-header`:
return { bold: true, fontSize: 12 };
return { bold: true, fontSize: 10 };
case `body-text`:
return { fontSize: 10 };
case `grey`:
return { layout: TABLEROW_GREY };
case `italics`:
return { italics: true };
case `margin-header1`:
return [0, 0, 0, 20];
// [L,U,R,D]
return [0, 10, 0, 0];
case `margin-header3`:
return [0, 15, 0, 10];
return [15, 10, 0, 0];
case `margin-header-child`:
return [15, 10, 0, 0];
case `margin-type-text`:
return [0, 0, 0, 10];
return [12, 10, 0, 0];
case `margin-body-text`:
return [20, 10, 0, 5];
case `margin-item`:
return [0, 0, 0, 5];
return [0, 0, 0, 0];
case `margin-item-2`:
return [0, 10, 0, 5];
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,55 +63,58 @@ <h2 class="text-large-bold color-inherit">
{{ 'Gender' | translate }}
</button>
</h2>
<div>
<button matIconButton (click)="toggle(entry.id, true)">
@if (toggleGenderMap.get(entry.id)) {
<mat-icon>keyboard_arrow_up</mat-icon>
} @else {
<mat-icon>keyboard_arrow_down</mat-icon>
}
</button>
</div>
<button matIconButton (click)="toggle(entry.id, true)">
@if (toggleGenderMap.get(entry.id)) {
<mat-icon>keyboard_arrow_up</mat-icon>
} @else {
<mat-icon>keyboard_arrow_down</mat-icon>
}
</button>
</div>
@if (toggleGenderMap.get(entry.id)) {
<div class="card-grid">
<div class="gender-map-grid">
@for (gender of genders; track gender.id) {
@if (entry.getTotalCount(gender.id)) {
<div></div>
<div class="foreground-active align-left">
@if (entry.getTotalCount(gender.id)) {
<div class="text-medium">
<!-- LEFT EMPTY -->
<div class="row">
<div></div>
<div class="foreground-active align-left">
@if (entry.getTotalCount(gender.id)) {
<!-- FIRST VAL -->
{{ entry.genderEntryMap.get(gender.id)?.present }}
{{
displayPercent(
entry.genderEntryMap.get(gender.id)?.present /
entry.presentUserIds.length
)
}}
</div>
}
</div>
<div class="justify-center bold">
<div>{{ entry.genderEntryMap.get(gender.id)?.label | translate }}</div>
</div>
<div class="text align-left">
@if (entry.getTotalCount(gender.id)) {
<div class="text-medium">
}
</div>
<div class="justify-center bold">
<!-- SECOND VAL -->
{{ entry.genderEntryMap.get(gender.id)?.label | translate }}
</div>
<div class="text align-right text-medium">
@if (entry.getTotalCount(gender.id)) {
<!-- THIRD VAL -->
{{ entry.getTotalCount(gender.id) }}
{{ displayPercent(entry.getTotalCount(gender.id) / entry.getTotalCount()) }}
</div>
}
}
</div>
<!-- LEFT EMPTY -->
<div></div>
</div>
<div></div>
}
}
</div>
}
<div class="header-grid">
<h2 class="text-large-bold color-inherit">
<button matButton (click)="toggle(entry.id)">
{{ 'Participants' | translate }}
</button>
<div class="row">
<button matButton (click)="toggle(entry.id)">
{{ 'Participants' | translate }}
</button>
</div>
</h2>
<div>
<button matIconButton (click)="toggle(entry.id)">
Expand All @@ -130,15 +133,15 @@ <h2 class="text-large-bold color-inherit">
{{ 'Present' | translate }}
</div>
@for (userId of entry.presentUserIds; track userId) {
<div class="margin-left-large text foreground-active">{{ getName(userId) }}</div>
<div class="margin-left-medium text foreground-active">{{ getName(userId) }}</div>
}
</div>
<div>
<div class="bold margin-left-medium small-margin-top text">
{{ 'Absent' | translate }}
</div>
@for (userId of entry.absentUserIds; track userId) {
<div class="margin-left-large color-black">{{ getName(userId) }}</div>
<div class="margin-left-medium color-black">{{ getName(userId) }}</div>
}
</div>
</div>
Expand Down
Loading
Loading