From 30d9f9f7686c90ea78525f62583d17e9651fdc27 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 5 Jul 2018 12:29:30 -0700 Subject: [PATCH] Adding participation count. Fixes #61 --- ui/src/app/components/poll/poll.component.html | 2 +- ui/src/app/components/poll/poll.component.ts | 5 +++-- ui/src/app/shared/poll.interface.ts | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/src/app/components/poll/poll.component.html b/ui/src/app/components/poll/poll.component.html index 10936d3..bc2c3b5 100755 --- a/ui/src/app/components/poll/poll.component.html +++ b/ui/src/app/components/poll/poll.component.html @@ -64,7 +64,7 @@

Details

- Participation: {{this.poll.participation_pct.toFixed(0)}}% + Participation: {{this.poll.participationPct.toFixed(0)}}% | {{poll.participationCount}} / {{poll.userListMatches.length}} votes
diff --git a/ui/src/app/components/poll/poll.component.ts b/ui/src/app/components/poll/poll.component.ts index a441e47..5b56aa6 100755 --- a/ui/src/app/components/poll/poll.component.ts +++ b/ui/src/app/components/poll/poll.component.ts @@ -517,8 +517,9 @@ export class PollComponent implements OnInit { } ulms.push(ulm); } - this.poll.user_list_matches = ulms; - this.poll.participation_pct = participation / ulms.length * 100; + this.poll.userListMatches = ulms; + this.poll.participationCount = participation; + this.poll.participationPct = participation / ulms.length * 100; return ulms; } diff --git a/ui/src/app/shared/poll.interface.ts b/ui/src/app/shared/poll.interface.ts index 14dd7c3..b37c309 100755 --- a/ui/src/app/shared/poll.interface.ts +++ b/ui/src/app/shared/poll.interface.ts @@ -14,6 +14,7 @@ export interface Poll { editing?: boolean; readOnly?: boolean; predefined_user_list?: string; - user_list_matches?: Array; - participation_pct?: number; + userListMatches?: Array; + participationPct?: number; + participationCount?: number; }