diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index f95311022..89666053f 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -1,5 +1,7 @@ <% cache [@stats] do %> - <% provide :title, t("spending_proposals.stats.page_title") %> + <% provide :title do %> + <%= t("budgets.stats.title") %> - <%= @budget.name %> + <% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", social_url: budget_url(@budget), @@ -7,246 +9,210 @@ social_description: @budget.description_finished %> <% end %> - <%= javascript_include_tag "chart", "data-turbolinks-track" => true %> - <%= javascript_include_tag "budgets-stats-charts", "data-turbolinks-track" => true %> - -
<%= t("budgets.stats.total_participants").upcase %>
-- <%= @stats[:total_participants] %> -
-<%= t("budgets.stats.total_budget_investments").upcase %>
-- <%= @stats[:total_budget_investments] %> -
+
-
-
- <%= t("budgets.stats.total_feasible_investments").upcase %>:
- <%= @stats[:total_feasible_investments] %>
-
-
-
-
- <%= t("budgets.stats.total_unfeasible_investments").upcase %>:
- <%= @stats[:total_unfeasible_investments] %>
-
-
-
-
-
- <%= t("budgets.stats.total_participants_support_phase").upcase %>:
-
- <%= @stats[:total_participants_support_phase] %> <%= t("budgets.stats.participants") %>,
-
-
- <%= @stats[:total_supports] %> <%= t("budgets.stats.supports") %>
-
-
-
- <%= t("budgets.stats.total_participants_vote_phase").upcase %>:
-
- <%= @stats[:total_participants_vote_phase] %> <%= t("budgets.stats.participants") %>,
-
-
- <%= @stats[:total_votes] %> <%= t("budgets.stats.votes") %>
-
-
+ <%= @stats[:total_participants] %> +
+ + <%= t("budgets.stats.total_budget_investments") %> ++ <%= @stats[:total_budget_investments] %> +
+
+
+
+ <%= t("budgets.stats.total_feasible_investments") %>:
+ <%= @stats[:total_feasible_investments] %>
+
+
+
+
+ <%= t("budgets.stats.total_unfeasible_investments") %>:
+ <%= @stats[:total_unfeasible_investments] %>
+
-
- - <%= t("budgets.stats.total_male_participants").upcase %> - (<%= number_to_percentage(@stats[:male_percentage], - strip_insignificant_zeros: true, - precision: 2) %>) -
-- <%= @stats[:total_male_participants] %> -
-+ + <%= t("budgets.stats.total_male_participants").upcase %> + (<%= number_to_percentage(@stats[:male_percentage], + strip_insignificant_zeros: true, + precision: 2) %>) +
++ <%= @stats[:total_male_participants] %> +
- - <%= t("budgets.stats.total_female_participants").upcase %> - (<%= number_to_percentage(@stats[:female_percentage], - strip_insignificant_zeros: true, - precision: 2) %>) -
-- <%= @stats[:total_female_participants] %> -
-+ + <%= t("budgets.stats.total_female_participants").upcase %> + (<%= number_to_percentage(@stats[:female_percentage], + strip_insignificant_zeros: true, + precision: 2) %>) +
++ <%= @stats[:total_female_participants] %> +
| <%= 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 %>)
-
-
-
-
- |
-
| <% 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 %> | +<%= 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 %>)
+
+
+
+
+ |
+ |||||||||||
| <%= t("budgets.stats.heading") %> | +<%= t("budgets.stats.investments_sent") %> | +<%= t("budgets.stats.participants_support_phase") %> | +<%= t("budgets.stats.participants_voting_phase") %> | +<%= t("budgets.stats.participants_total") %> | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= t("budgets.stats.total").upcase %> | -<%= t("budgets.stats.percent_total_participants_html") %> | -<%= t("budgets.stats.percent_heading_census_html") %> | -<%= t("budgets.stats.total").upcase %> | -<%= t("budgets.stats.percent_total_participants_html") %> | -<%= t("budgets.stats.percent_heading_census_html") %> | -<%= t("budgets.stats.total").upcase %> | -<%= 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") %> | +<%= t("budgets.stats.total") %> | +<%= t("budgets.stats.percent_total_participants_html") %> | +<%= t("budgets.stats.percent_heading_census_html") %> |
| + | <%= heading.name %> | + class="text-center border-left border-right"> <%= heading.investments.count %> | <% ["support", "vote", "all"].each do |phase| %>"> + class="border-left text-center"> <%= @stats[:headings][heading.id]["total_participants_#{phase}_phase".to_sym] %> | "> + class="border-left border-right text-center %>"> <%= number_to_percentage(@stats[:headings][heading.id]["percentage_participants_#{phase}_phase".to_sym], strip_insignificant_zeros: true, precision: 2) %> | "> + class="text-center border-right"> <%= number_to_percentage(@stats[:headings][heading.id]["percentage_district_population_#{phase}_phase".to_sym], strip_insignificant_zeros: true, precision: 2) %> @@ -256,26 +222,23 @@ <% end %> | ||||||||||||
-
- <%= t("budgets.stats.no_demographic_data_html", 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") %> +