diff --git a/app/assets/images/budgets/stats/gender.png b/app/assets/images/budgets/stats/gender.png new file mode 100644 index 000000000..e4179354c Binary files /dev/null and b/app/assets/images/budgets/stats/gender.png differ diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index a1e723be4..5570cc13e 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -1,17 +1,20 @@ <% cache [@stats] do %> <% provide :title, t("spending_proposals.stats.page_title") %> <% provide :social_media_meta_tags do %> - <%= render "shared/social_media_meta_tags_participatory_budget" %> + <%= render "shared/social_media_meta_tags", + social_url: budget_url(@budget), + social_title: @budget.name, + social_description: @budget.description_finished %> <% end %> <%= javascript_include_tag "chart", "data-turbolinks-track" => true %> - <%= javascript_include_tag "participatory-budget-charts", "data-turbolinks-track" => true %> + <%= javascript_include_tag "budgets-stats-charts", "data-turbolinks-track" => true %>
- <%= back_link_to participatory_budget_path %> + <%= back_link_to budgets_path %>

<%= t("spending_proposals.stats.heading") %>

@@ -21,11 +24,11 @@
  • - <%= link_to t("spending_proposals.stats.results_link"), participatory_budget_results_path %> + <%= link_to t("budget.results.link"), budget_results_path(@budget) %>
  • <%= t("shared.you_are_in") %> - <%= link_to t("spending_proposals.stats.stats_link"), participatory_budget_stats_path, class: "is-active" %> + <%= link_to t("budgets.stats.link"), budget_stats_path(@budget), class: "is-active" %>
@@ -34,7 +37,7 @@
-

TOTAL PARTICIPANTES

+

<%= t("budgets.stats.total_participants").upcase %>

<%= @stats[:total_participants] %>

@@ -47,9 +50,9 @@
-

TOTAL PROPUESTAS ENVIADAS

+

<%= t("budgets.stats.total_budget_investments").upcase %>

- <%= @stats[:total_spending_proposals] + @stats[:paper_spending_proposals] %> + <%= @stats[:total_budget_investments] %>

@@ -58,34 +61,34 @@

  - PROPUESTAS EN LA FASE FINAL: - <%= @stats[:total_feasible_spending_proposals] %>
+ <%= t("budgets.stats.total_feasible_investments").upcase %>: + <%= @stats[:total_feasible_investments] %>
  - PROPUESTAS INVIABLES: - <%= @stats[:total_unfeasible_spending_proposals] %>
+ <%= t("budgets.stats.total_unfeasible_investments").upcase %>: + <%= @stats[:total_unfeasible_investments] %>

  - FASE DE APOYOS: + <%= t("budgets.stats.total_participants_support_phase").upcase %>: - <%= @stats[:total_participants_support_phase] %> Participantes, + <%= @stats[:total_participants_support_phase] %> <%= t("budgets.stats.participants") %>, - <%= @stats[:total_supports] %> Apoyos
+ <%= @stats[:total_supports] %> <%= t("budgets.stats.supports") %>
  - FASE DE VOTACIÓN: + <%= t("budgets.stats.total_participants_vote_phase").upcase %>: - <%= @stats[:total_participants_vote_phase] %> Participantes, + <%= @stats[:total_participants_vote_phase] %> <%= t("budgets.stats.participants") %>, - <%= @stats[:total_votes] %> Votos
+ <%= @stats[:total_votes] %> <%= t("budgets.stats.votes") %>

@@ -95,19 +98,18 @@
-
-

Participación
por sexo

+

<%= t("budgets.stats.by_gender") %>


- <%= image_tag ("participatory_budget_stats/sex.png") %> + <%= image_tag ("budgets/stats/gender.png") %>
- +
@@ -117,7 +119,7 @@

-  HOMBRES +  <%= t("budgets.stats.total_male_participants").upcase %> (<%= number_to_percentage(@stats[:male_percentage], strip_insignificant_zeros: true, precision: 2) %>) @@ -132,7 +134,7 @@

-  MUJERES +  <%= t("budgets.stats.total_female_participants").upcase %> (<%= number_to_percentage(@stats[:female_percentage], strip_insignificant_zeros: true, precision: 2) %>) @@ -148,12 +150,46 @@

-

Participación por
grupos de edad

+

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


- <%= render "spending_proposals_results_age" %> + + + + + + + + + <% all_ages_count = @stats[:age_groups].values.sum.to_f %> + <% @stats[:age_groups].each do |age_group, count| %> + "> + + + + <% end %> + +
<%= t("budgets.stats.age").upcase %><%= t("budgets.stats.total").upcase %>
+ <%= age_group.gsub("+", t("budgets.stats.more_than")) + t("budgets.stats.years") %> + + + <% + percentage_age_count = all_ages_count == 0 ? 0 : (count / all_ages_count * 100) + formatted_percentage_age_count = number_to_percentage(percentage_age_count, + strip_insignificant_zeros: true, + precision: 2) + %> + <%= count %> + (<%= formatted_percentage_age_count %>) + +
+ +
+

@@ -161,62 +197,56 @@
-

Participación por
distritos

-
- -
- -
- <%= image_tag("map.jpg", usemap: "#html_map", alt: "Mapa de distritos de Madrid") %> +

<%= t("budgets.stats.by_heading") %>

- - - - - + + + + + - - - - - - - - - + + + + + + + + + - <% @stats.headings.each do |heading| %> + <% @budget.headings.each do |heading| %> <% ["support", "vote", "all"].each do |phase| %>
DISTRITOPROPUESTAS ENVIADASPARTICIPACIÓN FASE APOYOSPARTICIPACIÓN FASE VOTACIÓNPARTICIPACIÓN TOTAL<% t("budgets.stats.heading").upcase %><% t("budgets.stats.investments_sent").upcase %><% t("budgets.stats.participants_support_phase").upcase %><% t("budgets.stats.participants_voting_phase").upcase %><% t("budgets.stats.participants_total").upcase %>
TOTAL%
TOTAL
PARTICIPANTES
%
CENSO
DISTRITO
TOTAL%
TOTAL
PARTICIPANTES
%
CENSO
DISTRITO
TOTAL%
TOTAL
PARTICIPANTES
%
CENSO
DISTRITO
<%= t("budgets.stats.total").upcase %><%= t("budgets.stats.percent_total_participants").upcase %><%= t("budgets.stats.percent_heading_census").upcase %><%= t("budgets.stats.total").upcase %><%= t("budgets.stats.percent_total_participants").upcase %><%= t("budgets.stats.percent_heading_census").upcase %><%= t("budgets.stats.total").upcase %><%= t("budgets.stats.percent_total_participants").upcase %><%= t("budgets.stats.percent_heading_census").upcase %>
<%= heading.name %> - <%= heading.spending_proposals.count %> + <%= heading.investments.count %> + class="border-left text-center <%= phase == "all" ? "success" : "" %>"> <%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %> + class="border-left border-right text-center <%= phase == "all" ? "success" : "" %>"> <%= number_to_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym], strip_insignificant_zeros: true, precision: 2) %> + class="text-center <%= phase == "all" ? "success" : "" %>"> <%= number_to_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym], strip_insignificant_zeros: true, precision: 2) %> @@ -231,17 +261,15 @@

- * No se dispone de los datos demográficos de - <%= @stats[:total_unknown_gender_or_age] %> - participantes. + <%= t("budgets.stats.no_demographic_data", total: @stats[:total_unknown_gender_or_age]) %>
- ** Las cifras de participación total se refieren a personas que han creado, apoyado o votado propuestas. + <%= t("budgets.stats.participatory_disclaimer") %>
- *** Los datos de distrito se refieren al distrito en el que el usuario ha votado, no necesariamente en el que está empadronado. + <%= t("budgets.stats.heading_disclaimer") %>

diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index d7bd7235d..2002d54ea 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -191,3 +191,34 @@ en: dates_range_invalid: "Start date can't be equal or later than End date" prev_phase_dates_invalid: "Start date must be later than the start date of the previous enabled phase (%{phase_name})" next_phase_dates_invalid: "End date must be earlier than the end date of the next enabled phase (%{phase_name})" + stats: + link: Stats + page_title: "%{budget} - Stats" + total_participants: Total Participants + total_budget_investments: Total Proposed Investments + total_feasible_investments: Proposals on final phase + total_unfeasible_investments: Unfeasible proposals + total_participants_support_phase: Support phase + participants: Participants + supports: Supports + votes: Votes + total_participants_vote_phase: Voting Phase + by_gender: "Participants
by sex" + total_male_participants: Mens + total_female_participants: Women + by_age: "Participants by
age groups" + age: Age + total: Total + more_than: More than + years: years + by_heading: "Participants by
heading" + heading: Heading + investments_sent: Investment proposals sent + participants_support_phase: Participants support phase + participants_voting_phase: Participants voting phase + participants_total: Total Participants + percent_total_participants: "%
Total
Participants" + percent_heading_census: "%
Heading
Census" + no_demographic_data: "* There is no demographic data for
%{total}
participants." + participatory_disclaimer: "** The numbers of total participation refer to persons that created, supported or voted investment proposals." + heading_disclaimer: "*** Data about headings refer to the heading where each user voted, not necessarily the one that person is registered on." diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index 982149b5a..5fefc3430 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -191,3 +191,34 @@ es: dates_range_invalid: "La fecha de comienzo no puede ser igual o superior a la de finalización" prev_phase_dates_invalid: "La fecha de inicio debe ser posterior a la fecha de inicio de la anterior fase habilitada (%{phase_name})" next_phase_dates_invalid: "La fecha de fin debe ser anterior a la fecha de fin de la siguiente fase habilitada (%{phase_name})" + stats: + link: Estadísticas + page_title: "%{budget} - Estadísticas" + total_participants: Total participantes + total_budget_investments: Total propuestas enviadas + total_feasible_investments: Propuestas en la fase final + total_unfeasible_investments: Propuestas inviables + total_participants_support_phase: Fase de apoyos + participants: Participantess + supports: Apoyos + votes: Votos + total_participants_vote_phase: Fase de votación + total: Total + by_gender: "Participación
por sexo" + total_male_participants: Hombres + total_female_participants: Mujeres + by_age: "Participación por
grupos de edad" + age: Edad + more_than: Más de + years: años + by_heading: "Participación por
distritos" + heading: Distrito + investments_sent: Propuestas enviadas + participants_support_phase: Participación fase apoyos + participants_voting_phase: Participación fase apoyos + participants_total: Participación fase apoyos + percent_total_participants: "%
Total
Participantes" + percent_heading_census: "%
Censo
Distrito" + no_demographic_data: "* No se dispone de los datos demográficos de
%{total}
participantes." + participatory_disclaimer: "** Las cifras de participación total se refieren a personas que han creado, apoyado o votado propuestas." + heading_disclaimer: "*** Los datos de distrito se refieren al distrito en el que el usuario ha votado, no necesariamente en el que está empadronado."