From 698fc753ba77232d0f6bea63ebd746e883e71f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 2 Feb 2023 21:11:57 +0100 Subject: [PATCH] Fix invalid HTML in budget stats tables The elements should be inside elements. Since we're changing this code, we're also adding and tags because that's what we usually do and it makes it easier to select tags from either the table head or the table body using CSS or JavaScript. --- .../stats/budget_balloting_component.html.erb | 52 +++++++++++-------- .../admin/stats/budget_supporting.html.erb | 30 ++++++----- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/app/components/admin/stats/budget_balloting_component.html.erb b/app/components/admin/stats/budget_balloting_component.html.erb index 1bb7edb24..4d118b732 100644 --- a/app/components/admin/stats/budget_balloting_component.html.erb +++ b/app/components/admin/stats/budget_balloting_component.html.erb @@ -27,31 +27,39 @@ - + + + - <% vote_count_by_heading.each do |heading_name, count| %> - - - - - <% end %> + + <% vote_count_by_heading.each do |heading_name, count| %> + + + + + <% end %> +
<%= t("admin.stats.budget_balloting.votes_per_heading") %>
<%= t("admin.stats.budget_balloting.votes_per_heading") %>
- <%= heading_name %> - - <%= number_with_delimiter count %> -
+ <%= heading_name %> + + <%= number_with_delimiter count %> +
- + + + - <% user_count_by_heading.each do |heading_name, count| %> - - - - - <% end %> + + <% user_count_by_heading.each do |heading_name, count| %> + + + + + <% end %> +
<%= t("admin.stats.budget_balloting.participants_per_district") %>
<%= t("admin.stats.budget_balloting.participants_per_district") %>
- <%= heading_name %> - - <%= number_with_delimiter count %> -
+ <%= heading_name %> + + <%= number_with_delimiter count %> +
diff --git a/app/views/admin/stats/budget_supporting.html.erb b/app/views/admin/stats/budget_supporting.html.erb index 770029969..8affe4cd2 100644 --- a/app/views/admin/stats/budget_supporting.html.erb +++ b/app/views/admin/stats/budget_supporting.html.erb @@ -33,17 +33,23 @@ <%= render "graph", name: "user_supported_budgets", event: "", count: @user_count %> - - - - <% @voters_in_heading.each do |heading, count| %> - - - + + + + - <% end %> + + + + <% @voters_in_heading.each do |heading, count| %> + + + + + <% end %> +
<%= t("admin.stats.budget_supporting.headings") %><%= t("admin.stats.budget_supporting.users") %>
- <%= heading.name %> - - <%= number_with_delimiter count %> -
<%= t("admin.stats.budget_supporting.headings") %><%= t("admin.stats.budget_supporting.users") %>
+ <%= heading.name %> + + <%= number_with_delimiter count %> +