Remove duplicate <main> tags in management views

There can only be one <main> tag in a document, and we've already got a
<main> tag in the management layout.
This commit is contained in:
Javi Martín
2023-09-29 21:36:38 +02:00
parent f0baa080b6
commit f1105140ae
4 changed files with 88 additions and 96 deletions

View File

@@ -1,30 +1,28 @@
<main>
<span class="not-print">
<%= render "admin/shared/budget_investment_search", url: management_budget_investments_path(@budget) %>
</span>
<span class="not-print">
<%= render "admin/shared/budget_investment_search", url: management_budget_investments_path(@budget) %>
</span>
<div class="wrap row">
<div id="budget-investments" class="budget-investments-list small-12 column">
<div class="wrap row">
<div id="budget-investments" class="budget-investments-list small-12 column">
<div class="small-12 search-results">
<%= tag.h2 t("management.budget_investments.filters.unfeasible") if params[:unfeasible].present? %>
<%= tag.h2 t("management.budget_investments.filters.heading", heading: @heading.name) if @heading.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @investments %>
<%= t("management.budget_investments.search_results", count: @investments.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
<% @investments.each do |investment| %>
<%= render "/budgets/investments/investment",
investment: investment,
investment_ids: @investment_ids,
ballot: @ballot %>
<div class="small-12 search-results">
<%= tag.h2 t("management.budget_investments.filters.unfeasible") if params[:unfeasible].present? %>
<%= tag.h2 t("management.budget_investments.filters.heading", heading: @heading.name) if @heading.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @investments %>
<%= t("management.budget_investments.search_results", count: @investments.size, search_term: params[:search]) %>
</h2>
<% end %>
<%= paginate @investments %>
</div>
<% @investments.each do |investment| %>
<%= render "/budgets/investments/investment",
investment: investment,
investment_ids: @investment_ids,
ballot: @ballot %>
<% end %>
<%= paginate @investments %>
</div>
</main>
</div>

View File

@@ -1,37 +1,35 @@
<main>
<span class="not-print">
<%= render "admin/shared/budget_investment_search", url: print_management_budget_investments_path(@budget) %>
</span>
<span class="not-print">
<%= render "admin/shared/budget_investment_search", url: print_management_budget_investments_path(@budget) %>
</span>
<div class="wrap row">
<div id="budget-investments" class="budget-investments-list small-12 column">
<div class="wrap row">
<div id="budget-investments" class="budget-investments-list small-12 column">
<div class="not-print">
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t("management.budget_investments.print.print_button") %>
</a>
</div>
<div class="not-print">
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t("management.budget_investments.print.print_button") %>
</a>
</div>
<div class="small-12 search-results">
<% if params[:unfeasible].present? %>
<h2 class="inline-block"><%= t("management.budget_investments.filters.unfeasible") %></h2>
<% end %>
<% if @heading.present? %>
<h2 class="inline-block"><%= t("management.budget_investments.filters.heading", heading_name: @heading.name) %></h2>
<% end %>
<h2 class="inline-block"><%= t("management.budget_investments.search_results", count: @investments.count, search_term: params[:search]) %></h2>
</div>
<% @investments.each do |investment| %>
<%= render "/budgets/investments/investment",
investment: investment,
investment_ids: @investment_ids,
ballot: @ballot %>
<div class="small-12 search-results">
<% if params[:unfeasible].present? %>
<h2 class="inline-block"><%= t("management.budget_investments.filters.unfeasible") %></h2>
<% end %>
<% if @heading.present? %>
<h2 class="inline-block"><%= t("management.budget_investments.filters.heading", heading_name: @heading.name) %></h2>
<% end %>
<h2 class="inline-block"><%= t("management.budget_investments.search_results", count: @investments.count, search_term: params[:search]) %></h2>
</div>
<div class="for-print-only">
<p><strong><%= t("management.print.budget_investments_info") %></strong></p>
</div>
<% @investments.each do |investment| %>
<%= render "/budgets/investments/investment",
investment: investment,
investment_ids: @investment_ids,
ballot: @ballot %>
<% end %>
<div class="for-print-only">
<p><strong><%= t("management.print.budget_investments_info") %></strong></p>
</div>
</div>
</main>
</div>

View File

@@ -1,24 +1,22 @@
<main>
<h2><%= t("management.proposals.index.title") %></h2>
<h2><%= t("management.proposals.index.title") %></h2>
<%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.proposals")) %>
<%= render Admin::SearchComponent.new(label: t("admin.shared.search.label.proposals")) %>
<div class="management-list">
<div class="proposals-list">
<div class="management-list">
<div class="proposals-list">
<div class="filters">
<% if @search_terms %>
<h3>
<%= page_entries_info @proposals %>
<%= sanitize(t("proposals.index.search_results",
count: @proposals.size,
search_term: strip_tags(@search_terms))) %>
</h3>
<% end %>
<div class="filters">
<% if @search_terms %>
<h3>
<%= page_entries_info @proposals %>
<%= sanitize(t("proposals.index.search_results",
count: @proposals.size,
search_term: strip_tags(@search_terms))) %>
</h3>
<% end %>
<%= render @proposals %>
<%= paginate @proposals %>
</div>
<%= render @proposals %>
<%= paginate @proposals %>
</div>
</div>
</main>
</div>

View File

@@ -1,29 +1,27 @@
<main>
<div class="row">
<div class="proposals-list">
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t("management.proposals.print.print_button") %>
</a>
<div class="row">
<div class="proposals-list">
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t("management.proposals.print.print_button") %>
</a>
<%= image_tag "header_print_proposals.jpg", class: "for-print-only" %>
<%= image_tag "header_print_proposals.jpg", class: "for-print-only" %>
<div class="filters">
<span class="for-print-only date-for-print"><%= l Date.current, format: :long %></span>
<div class="filters">
<span class="for-print-only date-for-print"><%= l Date.current, format: :long %></span>
<h2 class="inline-block">
<span class="not-print"><%= t("proposals.index.select_order_long") %></span>
<span class="for-print-only"><%= t("management.print.proposals_title") %></span>
</h2>
<div class="not-print">
<%= render "shared/order_links", i18n_namespace: "proposals.index" %>
</div>
</div>
<%= render @proposals %>
<div class="for-print-only">
<p><strong><%= t("management.print.proposals_info") %></strong></p>
<h2 class="inline-block">
<span class="not-print"><%= t("proposals.index.select_order_long") %></span>
<span class="for-print-only"><%= t("management.print.proposals_title") %></span>
</h2>
<div class="not-print">
<%= render "shared/order_links", i18n_namespace: "proposals.index" %>
</div>
</div>
<%= render @proposals %>
<div class="for-print-only">
<p><strong><%= t("management.print.proposals_info") %></strong></p>
</div>
</div>
</main>
</div>