Remove duplication in search results summary
We were using very similar code for proposals, debates and investments, so we might as well share the code between them. Note we're using the `proposals.index.search_results` key even for debates and investments. This will still work because the translations shared the same text, but IMHO we should rename the key to something like `shared.search_results_summary`. We aren't doing so because we'd lose all the existing translations.
This commit is contained in:
@@ -22,21 +22,11 @@
|
||||
<% end %>
|
||||
|
||||
<% if params[:search].present? || params[:advanced_search].present? %>
|
||||
<div class="search-results-summary">
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("shared.search_results") %></h2>
|
||||
<p>
|
||||
<%= page_entries_info @investments %>
|
||||
<% if params[:advanced_search].blank? %>
|
||||
<%= sanitize(t("budgets.investments.index.search_results",
|
||||
count: @investments.size,
|
||||
search_term: params[:search])) %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= render Shared::SearchResultsSummaryComponent.new(
|
||||
results: @investments,
|
||||
search_terms: params[:search],
|
||||
advanced_search_terms: params[:advanced_search]
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user