diff --git a/app/assets/images/stats_investments.png b/app/assets/images/stats_investments.png new file mode 100644 index 000000000..951dfe393 Binary files /dev/null and b/app/assets/images/stats_investments.png differ diff --git a/app/assets/stylesheets/stats.scss b/app/assets/stylesheets/stats.scss index 9bab1d5c2..34de4361b 100644 --- a/app/assets/stylesheets/stats.scss +++ b/app/assets/stylesheets/stats.scss @@ -40,6 +40,10 @@ content: image-url('stats_woman.png'); } + &.total-investments::before { + content: image-url('stats_investments.png'); + } + &.web::before { content: image-url('stats_web.png'); } diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index e156d0d9b..6fe5153e3 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -39,197 +39,132 @@ -
-
-
- <%= t("stats.total_participants") %> -

- <%= @stats[:total_participants] %> -

+
+ +

<%= link_to t("stats.advanced"), "#advanced_statistics" %>

+
-
-

-   - - <%= t("budgets.stats.total_selected_investments") %>: - <%= @stats[:total_selected_investments] %>
-
+

+ <%= render "shared/stats/participation", stats: @stats %> -   - - <%= t("budgets.stats.total_unfeasible_investments") %>: - <%= @stats[:total_unfeasible_investments] %>
-
+
+

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

-
+
+

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

-   - <%= t("budgets.stats.total_participants_support_phase") %>: - - <%= @stats[:total_participants_support_phase] %> <%= t("budgets.stats.participants") %>, - <%= @stats[:total_supports] %> <%= t("budgets.stats.supports") %>
-
+ <%= number_with_info_tags( + @stats[:total_budget_investments], + t("stats.budgets.total_investments"), + html_class: "total-investments" + ) %> -
+ <%= number_with_info_tags(@stats[:total_selected_investments], + t("stats.budgets.total_selected_investments")) %> -   - <%= t("budgets.stats.total_participants_web") %>: - - <%= @stats[:total_participants_web] %>
-
+ <%= number_with_info_tags(@stats[:total_unfeasible_investments], + t("stats.budgets.total_unfeasible_investments")) %> +
-   - <%= t("budgets.stats.total_participants_booths") %>: - - <%= @stats[:total_participants_booths] %>
-
-

-
-
+
+

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

-
-
-

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

-
+ <%= number_with_info_tags(@stats[:total_participants_support_phase], + t("stats.budgets.participants")) %> -
- <%= image_tag ("budgets/stats/gender.png") %> -
+ <%= number_with_info_tags(@stats[:total_supports], t("stats.budgets.supports")) %> + <%= number_with_info_tags(@stats[:total_participants_web], + t("stats.budgets.total_participants_web")) %> + <%= number_with_info_tags(@stats[:total_participants_booths], + t("stats.budgets.total_participants_booths")) %> -
-
-

- -  <%= t("budgets.stats.total_female_participants").upcase %> - (<%= number_to_stats_percentage(@stats[:female_percentage]) %>) -

-

- <%= @stats[:total_female_participants] %> -

-
+
-
-

- -  <%= t("budgets.stats.total_male_participants").upcase %> - (<%= number_to_stats_percentage(@stats[:male_percentage]) %>) -

-

- <%= @stats[:total_male_participants] %> -

-
-
-
+
+

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

-
-
-

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

+ + + + + + + + + + + + + + + + + + + + + + + <% @headings.each do |heading| %> + + + -
<%= t("budgets.stats.heading") %><%= t("budgets.stats.investments_sent_html") %><%= t("budgets.stats.participants_support_phase") %><%= t("budgets.stats.participants_voting_phase") %><%= t("budgets.stats.participants_total") %>
<%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %><%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %><%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %>
+ <%= heading.name %> + + <%= @stats[:headings][heading.id][:total_investments_count] %> +
- - - - - - - - <% @stats[:participants_by_age].values.each do |group| %> - - - - - <% end %> - -
<%= t("budgets.stats.age").upcase %><%= t("budgets.stats.total").upcase %>
<%= group[:range] %> - - <%= "#{group[:count]} (#{number_to_stats_percentage(group[:percentage])})" %> - -
- - -
-
-
-
- -
-
-

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

- - - - - - - - - - - - - - - - - - - - - - - - <% @headings.each do |heading| %> - - - - - <% ["support", "vote", "all"].each do |phase| %> - - - + <% ["support", "vote", "all"].each do |phase| %> + + + + <% end %> + <% end %> - - <% end %> - -
<%= t("budgets.stats.heading") %><%= t("budgets.stats.investments_sent_html") %><%= t("budgets.stats.participants_support_phase") %><%= t("budgets.stats.participants_voting_phase") %><%= t("budgets.stats.participants_total") %>
<%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %><%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %><%= t("budgets.stats.total") %><%= t("budgets.stats.percent_total_participants_html") %><%= t("budgets.stats.percent_heading_census_html") %>
- <%= heading.name %> - - <%= @stats[:headings][heading.id][:total_investments_count] %> - - <%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %> - - <%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym]) %> - - <%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym]) %> - + <%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %> + + <%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym]) %> + + <%= number_to_stats_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym]) %> +
-
-
+ + +
+
-
-
-
-

- <%= t("budgets.stats.no_demographic_data", total: @stats[:total_unknown_gender_or_age]) %> -

-

- <%= t("budgets.stats.participatory_disclaimer") %> -

-

- <%= t("budgets.stats.heading_disclaimer") %> -

+
+
+
+

+ <%= t("budgets.stats.no_demographic_data", total: @stats[:total_unknown_gender_or_age]) %> +

+

+ <%= t("budgets.stats.participatory_disclaimer") %> +

+

+ <%= t("budgets.stats.heading_disclaimer") %> +

+
+
-
+
<% end %> diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index 4aa814def..6eab5a41c 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -194,19 +194,7 @@ en: stats: link: 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 - by_heading: "Participants by heading" heading: Heading investments_sent_html: "Investment proposals sent" participants_support_phase: Participants support phase diff --git a/config/locales/en/stats.yml b/config/locales/en/stats.yml index 577bf03b8..3f876e48b 100644 --- a/config/locales/en/stats.yml +++ b/config/locales/en/stats.yml @@ -16,6 +16,16 @@ en: total: "Total" geozone: "District" 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: by_channel: "Participants by channel" by_gender_and_channel: "Participants by gender and channel" diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index 67599b725..bbcea750a 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -194,19 +194,7 @@ es: stats: link: Estadísticas 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_male_participants: Hombres - total_female_participants: Mujeres - age: Edad - by_heading: "Participación por distritos" heading: Distrito investments_sent_html: "Propuestas
enviadas" participants_support_phase: Participación fase apoyos diff --git a/config/locales/es/stats.yml b/config/locales/es/stats.yml index d2d2a3e14..f76d35142 100644 --- a/config/locales/es/stats.yml +++ b/config/locales/es/stats.yml @@ -16,6 +16,16 @@ es: total: "Total" geozone: "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: by_channel: "Participación por medio" by_gender_and_channel: "Participación por género y medio"