mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Avoid pagination when editing errored products
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
.sixteen.columns
|
||||
= render partial: 'sort', locals: { pagy: pagy, search_term: search_term, producer_id: producer_id, category_id: category_id }
|
||||
= render partial: 'table', locals: { products: products }
|
||||
- if pagy.pages > 1
|
||||
- if pagy.present? && pagy.pages > 1
|
||||
= render partial: 'admin/shared/stimulus_pagination', locals: { pagy: pagy }
|
||||
- else
|
||||
#no-products
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
= form_with url: admin_products_path, id: "filters", method: :get, data: { remote: false, "search-target": "form" } do
|
||||
= hidden_field_tag :page, @page, class: "page"
|
||||
= hidden_field_tag :per_page, @per_page, class: "per-page"
|
||||
= hidden_field_tag :page, nil, class: "page"
|
||||
= hidden_field_tag :per_page, nil, class: "per-page"
|
||||
|
||||
.query
|
||||
.search-input
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#sort
|
||||
%div
|
||||
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
|
||||
- if pagy.present?
|
||||
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
|
||||
|
||||
- if search_term.present? || producer_id.present? || category_id.present?
|
||||
%a{ href: url_for(per_page: @per_page, page: @page), class: "button disruptive" }
|
||||
= t(".pagination.clear_search")
|
||||
%a{ href: url_for(page: 1), class: "button disruptive" }
|
||||
= t(".pagination.clear_search")
|
||||
|
||||
%form.with-dropdown
|
||||
= t(".pagination.per_page.show")
|
||||
= select_tag :per_page,
|
||||
options_for_select([15, 25, 50, 100].collect{|i| [t('.pagination.per_page.per_page', num: i), i]}, pagy.items),
|
||||
options_for_select([15, 25, 50, 100].collect{|i| [t('.pagination.per_page.per_page', num: i), i]}, pagy&.items),
|
||||
class: "no-input per-page",
|
||||
data: { controller: "tom-select search", action: "change->search#changePerPage", "tom-select-options-value": '{ "plugins": [] }'}
|
||||
|
||||
Reference in New Issue
Block a user