From 1a1ca1352561b8567b2e1141e43064a2a333d5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 20 Dec 2018 16:39:16 +0100 Subject: [PATCH] Add age stats to polls --- app/views/polls/stats.html.erb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/views/polls/stats.html.erb b/app/views/polls/stats.html.erb index 346653654..f1da5ae07 100644 --- a/app/views/polls/stats.html.erb +++ b/app/views/polls/stats.html.erb @@ -17,6 +17,9 @@
  • <%= link_to t("stats.by_gender"), "#participants_by_gender" %>
  • +
  • + <%= link_to t("stats.by_age"), "#participants_by_age" %> +
  • @@ -54,6 +57,32 @@

    + +
    +

    <%= t("stats.by_age") %>

    + + + + + + + + + <% @stats[:age_groups].values.each do |group| %> + + + + + <% end %> + +
    <%= t("stats.age") %><%= t("stats.total") %>
    <%= group[:range] %> + <%= "#{group[:count]} (#{number_to_stats_percentage(group[:percentage])})" %> + +
    + +
    +
    +