Add poll stats by channel

Note we currently don't have a way to get the votes by mail, so that
section is always blank.
This commit is contained in:
Javi Martín
2019-01-04 17:41:23 +01:00
parent 8f0bccf5b3
commit 553af8e95b
7 changed files with 37 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -40,6 +40,18 @@
content: image-url('stats_woman.png');
}
&.web::before {
content: image-url('stats_web.png');
}
&.booth::before {
content: image-url('stats_booth.png');
}
&.mail::before {
content: image-url('stats_mail.png');
}
.content {
display: inline-block;
margin-right: $line-height * 2;

View File

@@ -11,6 +11,9 @@
<p><strong><%= link_to t("stats.advanced"), "#advanced_statistics" %></strong></p>
<ul class="menu vertical">
<li>
<%= link_to t("stats.polls.by_channel"), "#stats_by_channel" %>
</li>
<li>
<%= link_to t("stats.polls.vote_by_channel"), "#vote_stats_by_channel" %>
</li>
@@ -23,6 +26,20 @@
<div id="advanced_statistics">
<h3 class="section-title"><%= t("stats.advanced") %></h3>
<div id="stats_by_channel" class="stats-group">
<h4><%= t("stats.polls.by_channel") %></h4>
<% Poll::Stats::CHANNELS.each do |channel| %>
<%= number_with_info_tags(
@stats[:"total_participants_#{channel}"],
t("stats.polls.#{channel}_percentage",
percentage: number_to_stats_percentage(@stats[:"total_participants_#{channel}_percentage"])
),
html_class: channel
) %>
<% end %>
</div>
<div id="vote_stats_by_channel" class="stats-group">
<h4><%= t("stats.polls.vote_by_channel") %></h4>

View File

@@ -15,4 +15,8 @@ en:
geozone: "District"
geozone_participation: "% District population participation"
polls:
by_channel: "Participants by channel"
vote_by_channel: "Vote type by channel"
web_percentage: "%{percentage} Web"
booth_percentage: "%{percentage} Booths"
mail_percentage: "%{percentage} Mail"

View File

@@ -15,4 +15,8 @@ es:
geozone: "Distrito"
geozone_participation: "% Partipación población del distrito"
polls:
by_channel: "Participación por medio"
vote_by_channel: "Votos emitidos por medio"
web_percentage: "%{percentage} Web"
booth_percentage: "%{percentage} Urnas"
mail_percentage: "%{percentage} Correo"