Skip to content

Commit

Permalink
Change default motion poll title
Browse files Browse the repository at this point in the history
  • Loading branch information
vkrasnovyd committed Sep 17, 2024
1 parent c4bf57c commit 4f76107
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,28 @@ export class MotionPollService extends PollService {

public getDefaultPollData(contentObject?: Motion): Partial<Poll> {
const poll: Partial<Poll> = {
title: this.translate.instant(`Vote`),
onehundred_percent_base: this.defaultPercentBase,
entitled_group_ids: Object.values(this.defaultGroupIds ?? []),
type: this.isElectronicVotingEnabled ? this.defaultPollType : PollType.Analog,
pollmethod: PollMethod.YNA
};

let titlePrefix = this.translate.instant(`Motion`);
let title = this.translate.instant(`Vote`);

if (contentObject) {
if (contentObject.number) {
titlePrefix += ` ${contentObject.number}`;
}

const length = this.repo.getViewModelListByContentObject(contentObject.fqid).length;
if (length) {
poll.title += ` (${length + 1})`;
title += ` (${length + 1})`;
}
}

poll.title = `${titlePrefix} ${title}:`;

return poll;
}

Expand Down

0 comments on commit 4f76107

Please sign in to comment.