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 %>
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] %>
- 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") %>
- 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 @@
| <%= 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 %>)
+
+
+
+
+ |
+
| DISTRITO | -PROPUESTAS ENVIADAS | -PARTICIPACIÓN FASE APOYOS | -PARTICIPACIÓN FASE VOTACIÓN | -PARTICIPACIÓ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 %> | <% ["support", "vote", "all"].each do |phase| %>+ 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]) %>
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." | |||||||||||||||||