diff --git a/frontend/src/components/Vote/VoteRating.vue b/frontend/src/components/Vote/VoteRating.vue index fec33399..9ed954dc 100644 --- a/frontend/src/components/Vote/VoteRating.vue +++ b/frontend/src/components/Vote/VoteRating.vue @@ -70,6 +70,19 @@ +
+

{{ $t('montage-round-stats') }}

+
+
+ + + {{ star }}: + + {{ voteStats.stats?.[star] || 0 }} +
+
+
+

{{ $t('montage-vote-actions') }}

@@ -163,7 +176,7 @@ diff --git a/frontend/src/components/Vote/VoteYesNo.vue b/frontend/src/components/Vote/VoteYesNo.vue index a7fce3a7..cf985600 100644 --- a/frontend/src/components/Vote/VoteYesNo.vue +++ b/frontend/src/components/Vote/VoteYesNo.vue @@ -71,6 +71,20 @@
+
+

{{ $t('montage-round-stats') }}

+
+
+ {{ $t('montage-vote-accept') }}: + {{ voteStats.stats?.yes || 0 }} +
+
+ {{ $t('montage-vote-decline') }}: + {{ voteStats.stats?.no || 0 }} +
+
+
+

{{ $t('montage-vote-actions') }}

@@ -164,7 +178,7 @@ diff --git a/montage/juror_endpoints.py b/montage/juror_endpoints.py index 0f6241cd..8a1f5901 100644 --- a/montage/juror_endpoints.py +++ b/montage/juror_endpoints.py @@ -172,6 +172,10 @@ def get_votes_stats_from_round(user_dao, round_id): juror_dao = JurorDAO(user_dao) rnd = juror_dao.get_round(round_id) + # Only return statistics if show_stats is enabled + if not rnd.show_stats: + return None + stats = None if rnd.vote_method == 'yesno':