OpenSlides/client/src/app/shared/models/poll/base-vote.ts
Sean Engelhardt 84a39ccb62 More voting UI improvements
For Motion poll:
- Overworked how motion poll chart displays the legend
- Added the vote counter to the motion detail
- Added a progress bar to the vote counter
- Fixed some perm errors with the chart
- Show a "Singe Votes" link as button for published named polls
- Replace the edit-button with a dot-menu
  - Having project, Edit, PDF and Delete

For Motion Poll detail:
- enhance search panel
- Remove the breadcrumbs
- Remove the vote counter
- Enhanced the single-vote grid, table and filter bar
- Enhance how the poll state enum was checkend

For the Motion Poll Create/Update Form:
- Remove the selection of poll-methode (whenever possible)
- only show "publish imediately" during creation
2020-03-17 07:24:40 +01:00

33 lines
754 B
TypeScript

import { BaseDecimalModel } from '../base/base-decimal-model';
export type VoteValue = 'Y' | 'N' | 'A';
export const VoteValueVerbose = {
Y: 'Yes',
N: 'No',
A: 'Abstain'
};
export const GeneralValueVerbose = {
votesvalid: 'Valid votes',
votesinvalid: 'Invalid votes',
votescast: 'Total votes cast',
votesno: 'Votes No',
votesabstain: 'Votes abstain'
};
export abstract class BaseVote<T> extends BaseDecimalModel<T> {
public weight: number;
public value: VoteValue;
public option_id: number;
public user_id?: number;
public get valueVerbose(): string {
return VoteValueVerbose[this.value];
}
protected getDecimalFields(): (keyof BaseVote<T>)[] {
return ['weight'];
}
}