Use the new stats layout in budget stats
So now stats by gender and age are replaced by shared participation stats (which also includes stats by district), reusing the code already used in poll stats, and advanced statistics (which used to be at the top of the page) are now displayed after partipation stats.
This commit is contained in:
BIN
app/assets/images/stats_investments.png
Normal file
BIN
app/assets/images/stats_investments.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -40,6 +40,10 @@
|
|||||||
content: image-url('stats_woman.png');
|
content: image-url('stats_woman.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.total-investments::before {
|
||||||
|
content: image-url('stats_investments.png');
|
||||||
|
}
|
||||||
|
|
||||||
&.web::before {
|
&.web::before {
|
||||||
content: image-url('stats_web.png');
|
content: image-url('stats_web.png');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,197 +39,132 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<main>
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-3 sidebar">
|
||||||
<div class="callout">
|
<%= render "shared/stats/links" %>
|
||||||
<span class="uppercase"><%= t("stats.total_participants") %></span>
|
|
||||||
<p id="total_participants" class="big-number-stat budget">
|
|
||||||
<%= @stats[:total_participants] %>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<span class="uppercase"><%= t("budgets.stats.total_budget_investments") %></span>
|
<p><strong><%= link_to t("stats.advanced"), "#advanced_statistics" %></strong></p>
|
||||||
<p class="big-number-stat budget">
|
<ul class="menu vertical">
|
||||||
<%= @stats[:total_budget_investments] %>
|
<li>
|
||||||
</p>
|
<%= link_to t("stats.budgets.total_investments"), "#total_investments"%>
|
||||||
</div>
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to t("stats.budgets.total_participants_support_phase"), "#stats_by_phase"%>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to t("stats.budgets.by_heading"), "#stats_by_heading"%>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-9">
|
||||||
<p>
|
<%= render "shared/stats/participation", stats: @stats %>
|
||||||
<span class="label feasible"></span>
|
|
||||||
<span id="total_selected_investments">
|
|
||||||
<span class="uppercase"><strong><%= t("budgets.stats.total_selected_investments") %></strong></span>:
|
|
||||||
<%= @stats[:total_selected_investments] %><br>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span class="label unfeasible"></span>
|
<div id="advanced_statistics">
|
||||||
<span id="total_unfeasible_investments">
|
<h3 class="section-title"><%= t("stats.advanced") %></h3>
|
||||||
<span class="uppercase"><strong><%= t("budgets.stats.total_unfeasible_investments") %></strong></span>:
|
|
||||||
<%= @stats[:total_unfeasible_investments] %><br>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<br>
|
<div id="total_investments" class="stats-group">
|
||||||
|
<h4><%= t("stats.budgets.total_investments") %></h4>
|
||||||
|
|
||||||
<span class="label supports"></span>
|
<%= number_with_info_tags(
|
||||||
<span class="uppercase"><strong><%= t("budgets.stats.total_participants_support_phase") %></strong></span>:
|
@stats[:total_budget_investments],
|
||||||
<span id="total_participants_support_phase">
|
t("stats.budgets.total_investments"),
|
||||||
<%= @stats[:total_participants_support_phase] %> <em><%= t("budgets.stats.participants") %></em>,
|
html_class: "total-investments"
|
||||||
<%= @stats[:total_supports] %> <em><%= t("budgets.stats.supports") %></em><br>
|
) %>
|
||||||
</span>
|
|
||||||
|
|
||||||
<br>
|
<%= number_with_info_tags(@stats[:total_selected_investments],
|
||||||
|
t("stats.budgets.total_selected_investments")) %>
|
||||||
|
|
||||||
<span class="label"></span>
|
<%= number_with_info_tags(@stats[:total_unfeasible_investments],
|
||||||
<span class="uppercase"><strong><%= t("budgets.stats.total_participants_web") %></strong></span>:
|
t("stats.budgets.total_unfeasible_investments")) %>
|
||||||
<span id="total_participants_web">
|
</div>
|
||||||
<%= @stats[:total_participants_web] %><br>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span class="label"></span>
|
<div id="stats_by_phase" class="stats-group">
|
||||||
<span class="uppercase"><strong><%= t("budgets.stats.total_participants_booths") %></strong></span>:
|
<h4><%= t("stats.budgets.total_participants_support_phase") %></h4>
|
||||||
<span id="total_participants_booths">
|
|
||||||
<%= @stats[:total_participants_booths] %><br>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin">
|
<%= number_with_info_tags(@stats[:total_participants_support_phase],
|
||||||
<div class="small-12 column">
|
t("stats.budgets.participants")) %>
|
||||||
<h2 class="margin-bottom"><%= t("stats.by_gender") %></h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 medium-6 column text-center">
|
<%= number_with_info_tags(@stats[:total_supports], t("stats.budgets.supports")) %>
|
||||||
<%= image_tag ("budgets/stats/gender.png") %>
|
<%= number_with_info_tags(@stats[:total_participants_web],
|
||||||
</div>
|
t("stats.budgets.total_participants_web")) %>
|
||||||
|
<%= number_with_info_tags(@stats[:total_participants_booths],
|
||||||
|
t("stats.budgets.total_participants_booths")) %>
|
||||||
|
|
||||||
<div class="small-12 medium-6 column">
|
</div>
|
||||||
<div class="small-12 medium-6 column text-right">
|
|
||||||
<p id="female_percentage">
|
|
||||||
<span class="label" style="background: #FF9E01"></span>
|
|
||||||
<%= t("budgets.stats.total_female_participants").upcase %>
|
|
||||||
(<%= number_to_stats_percentage(@stats[:female_percentage]) %>)
|
|
||||||
</p>
|
|
||||||
<p id="total_female_participants" class="big-number-stat">
|
|
||||||
<%= @stats[:total_female_participants] %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="small-12 medium-6 column text-left">
|
<div id="stats_by_heading" class="stats-group">
|
||||||
<p id="male_percentage">
|
<h4 class="margin-bottom"><%= t("stats.budgets.by_heading") %></h4>
|
||||||
<span class="label" style="background: #FF6600"></span>
|
|
||||||
<%= t("budgets.stats.total_male_participants").upcase %>
|
|
||||||
(<%= number_to_stats_percentage(@stats[:male_percentage]) %>)
|
|
||||||
</p>
|
|
||||||
<p id="total_male_participants" class="big-number-stat">
|
|
||||||
<%= @stats[:total_male_participants] %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin">
|
<table class="stats-districts survey-districts">
|
||||||
<div class="small-12 column">
|
<thead>
|
||||||
<h2 class="margin-bottom"><%= t("stats.by_age") %></h2>
|
<tr>
|
||||||
|
<th scope="col" rowspan="2"><%= t("budgets.stats.heading") %></th>
|
||||||
|
<th scope="col" rowspan="2"><%= t("budgets.stats.investments_sent_html") %></th>
|
||||||
|
<th scope="col" colspan="3"><%= t("budgets.stats.participants_support_phase") %></th>
|
||||||
|
<th scope="col" colspan="3"><%= t("budgets.stats.participants_voting_phase") %></th>
|
||||||
|
<th scope="col" colspan="3"><%= t("budgets.stats.participants_total") %></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
||||||
|
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="headings">
|
||||||
|
<% @headings.each do |heading| %>
|
||||||
|
<tr id="<%= heading.name.parameterize %>">
|
||||||
|
<td class="border-left">
|
||||||
|
<strong><%= heading.name %></strong>
|
||||||
|
</td>
|
||||||
|
<td id="total_spending_proposals_heading_<%= heading.id %>"
|
||||||
|
class="text-center border-left border-right">
|
||||||
|
<%= @stats[:headings][heading.id][:total_investments_count] %>
|
||||||
|
</td>
|
||||||
|
|
||||||
<table>
|
<% ["support", "vote", "all"].each do |phase| %>
|
||||||
<thead>
|
<td id="total_participants_<%= phase %>_phase_heading_<%= heading.id %>"
|
||||||
<tr>
|
class="border-left text-center">
|
||||||
<th scope="col" class="small-4"><%= t("budgets.stats.age").upcase %></th>
|
<%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %>
|
||||||
<th scope="col"><%= t("budgets.stats.total").upcase %></th>
|
</td>
|
||||||
</tr>
|
<td id="percentage_participants_<%= phase %>_phase_heading_<%= heading.id %>"
|
||||||
</thead>
|
class="border-left border-right text-center">
|
||||||
<tbody>
|
<%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym]) %>
|
||||||
<% @stats[:participants_by_age].values.each do |group| %>
|
</td>
|
||||||
<tr>
|
<td id="percentage_district_population_<%= phase %>_phase_heading_<%= heading.id %>"
|
||||||
<td><%= group[:range] %></td>
|
class="text-center border-right">
|
||||||
<td>
|
<%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym]) %>
|
||||||
<strong>
|
</td>
|
||||||
<%= "#{group[:count]} (#{number_to_stats_percentage(group[:percentage])})" %>
|
<% end %>
|
||||||
</strong>
|
</tr>
|
||||||
<div class="progress" tabindex="0">
|
|
||||||
<span class="progress-meter" style="width: <%= group[:percentage] %>%">
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 column">
|
|
||||||
<h2 class="margin-bottom"><%= t("budgets.stats.by_heading") %></h2>
|
|
||||||
|
|
||||||
<table class="stats-districts survey-districts">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col" rowspan="2"><%= t("budgets.stats.heading") %></th>
|
|
||||||
<th scope="col" rowspan="2"><%= t("budgets.stats.investments_sent_html") %></th>
|
|
||||||
<th scope="col" colspan="3"><%= t("budgets.stats.participants_support_phase") %></th>
|
|
||||||
<th scope="col" colspan="3"><%= t("budgets.stats.participants_voting_phase") %></th>
|
|
||||||
<th scope="col" colspan="3"><%= t("budgets.stats.participants_total") %></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.total") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_total_participants_html") %></th>
|
|
||||||
<th scope="col" class="tiny"><%= t("budgets.stats.percent_heading_census_html") %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="headings">
|
|
||||||
<% @headings.each do |heading| %>
|
|
||||||
<tr id="<%= heading.name.parameterize %>">
|
|
||||||
<td class="border-left">
|
|
||||||
<strong><%= heading.name %></strong>
|
|
||||||
</td>
|
|
||||||
<td id="total_spending_proposals_heading_<%= heading.id %>"
|
|
||||||
class="text-center border-left border-right">
|
|
||||||
<%= @stats[:headings][heading.id][:total_investments_count] %>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<% ["support", "vote", "all"].each do |phase| %>
|
|
||||||
<td id="total_participants_<%= phase %>_phase_heading_<%= heading.id %>"
|
|
||||||
class="border-left text-center">
|
|
||||||
<%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %>
|
|
||||||
</td>
|
|
||||||
<td id="percentage_participants_<%= phase %>_phase_heading_<%= heading.id %>"
|
|
||||||
class="border-left border-right text-center">
|
|
||||||
<%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym]) %>
|
|
||||||
</td>
|
|
||||||
<td id="percentage_district_population_<%= phase %>_phase_heading_<%= heading.id %>"
|
|
||||||
class="text-center border-right">
|
|
||||||
<%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym]) %>
|
|
||||||
</td>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tbody>
|
||||||
<% end %>
|
</table>
|
||||||
</tbody>
|
</div>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row margin">
|
<div class="row margin">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<div id="total_unknown_gender_or_age">
|
<div id="total_unknown_gender_or_age">
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
<%= t("budgets.stats.no_demographic_data", total: @stats[:total_unknown_gender_or_age]) %>
|
<%= t("budgets.stats.no_demographic_data", total: @stats[:total_unknown_gender_or_age]) %>
|
||||||
</p>
|
</p>
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
<%= t("budgets.stats.participatory_disclaimer") %>
|
<%= t("budgets.stats.participatory_disclaimer") %>
|
||||||
</p>
|
</p>
|
||||||
<p class="help-text">
|
<p class="help-text">
|
||||||
<%= t("budgets.stats.heading_disclaimer") %>
|
<%= t("budgets.stats.heading_disclaimer") %>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -194,19 +194,7 @@ en:
|
|||||||
stats:
|
stats:
|
||||||
link: Stats
|
link: Stats
|
||||||
page_title: "%{budget} - Participation stats"
|
page_title: "%{budget} - Participation stats"
|
||||||
total_budget_investments: Total Proposed Investments
|
|
||||||
total_selected_investments: Proposals on final phase
|
|
||||||
total_unfeasible_investments: Unfeasible proposals
|
|
||||||
total_participants_support_phase: Support phase
|
|
||||||
total_participants_web: Vote phase web participants
|
|
||||||
total_participants_booths: Vote phase booth participants
|
|
||||||
participants: Participants
|
|
||||||
supports: Supports
|
|
||||||
total_male_participants: Mens
|
|
||||||
total_female_participants: Women
|
|
||||||
age: Age
|
|
||||||
total: Total
|
total: Total
|
||||||
by_heading: "Participants by heading"
|
|
||||||
heading: Heading
|
heading: Heading
|
||||||
investments_sent_html: "Investment proposals sent"
|
investments_sent_html: "Investment proposals sent"
|
||||||
participants_support_phase: Participants support phase
|
participants_support_phase: Participants support phase
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ en:
|
|||||||
total: "Total"
|
total: "Total"
|
||||||
geozone: "District"
|
geozone: "District"
|
||||||
geozone_participation: "% District population participation"
|
geozone_participation: "% District population participation"
|
||||||
|
budgets:
|
||||||
|
total_investments: "Total proposed investments"
|
||||||
|
total_selected_investments: "Proposals on final phase"
|
||||||
|
total_unfeasible_investments: "Unfeasible proposals"
|
||||||
|
total_participants_support_phase: "Support phase"
|
||||||
|
total_participants_web: "Vote phase web participants"
|
||||||
|
total_participants_booths: "Vote phase booth participants"
|
||||||
|
participants: "Participants"
|
||||||
|
supports: "Supports"
|
||||||
|
by_heading: "Participants by heading"
|
||||||
polls:
|
polls:
|
||||||
by_channel: "Participants by channel"
|
by_channel: "Participants by channel"
|
||||||
by_gender_and_channel: "Participants by gender and channel"
|
by_gender_and_channel: "Participants by gender and channel"
|
||||||
|
|||||||
@@ -194,19 +194,7 @@ es:
|
|||||||
stats:
|
stats:
|
||||||
link: Estadísticas
|
link: Estadísticas
|
||||||
page_title: "%{budget} - Estadísticas de participación"
|
page_title: "%{budget} - Estadísticas de participación"
|
||||||
total_budget_investments: Total propuestas enviadas
|
|
||||||
total_selected_investments: Propuestas en la fase final
|
|
||||||
total_unfeasible_investments: Propuestas inviables
|
|
||||||
total_participants_support_phase: Fase de apoyos
|
|
||||||
total_participants_web: Participantes web en votación final
|
|
||||||
total_participants_booths: Participantes en urnas votación final
|
|
||||||
participants: Participantes
|
|
||||||
supports: Apoyos
|
|
||||||
total: Total
|
total: Total
|
||||||
total_male_participants: Hombres
|
|
||||||
total_female_participants: Mujeres
|
|
||||||
age: Edad
|
|
||||||
by_heading: "Participación por distritos"
|
|
||||||
heading: Distrito
|
heading: Distrito
|
||||||
investments_sent_html: "Propuestas<br>enviadas"
|
investments_sent_html: "Propuestas<br>enviadas"
|
||||||
participants_support_phase: Participación fase apoyos
|
participants_support_phase: Participación fase apoyos
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ es:
|
|||||||
total: "Total"
|
total: "Total"
|
||||||
geozone: "Distrito"
|
geozone: "Distrito"
|
||||||
geozone_participation: "% Partipación población del distrito"
|
geozone_participation: "% Partipación población del distrito"
|
||||||
|
budgets:
|
||||||
|
total_investments: "Total propuestas enviadas"
|
||||||
|
total_selected_investments: "Propuestas en la fase final"
|
||||||
|
total_unfeasible_investments: "Propuestas inviables"
|
||||||
|
total_participants_support_phase: "Fase de apoyos"
|
||||||
|
total_participants_web: "Participantes web en votación final"
|
||||||
|
total_participants_booths: "Participantes en urnas votación final"
|
||||||
|
participants: "Participantes"
|
||||||
|
supports: "Apoyos"
|
||||||
|
by_heading: "Participación por distritos"
|
||||||
polls:
|
polls:
|
||||||
by_channel: "Participación por medio"
|
by_channel: "Participación por medio"
|
||||||
by_gender_and_channel: "Participación por género y medio"
|
by_gender_and_channel: "Participación por género y medio"
|
||||||
|
|||||||
Reference in New Issue
Block a user