mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #12983 from saunmanoj888/12957-hide-search-filter-for-no-products
Back Office Product List - Hide search field and filters when there are no products in list
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
.container
|
||||
.sixteen.columns
|
||||
= render partial: 'admin/shared/flashes', locals: { flashes: } if defined? flashes
|
||||
= render partial: 'filters', locals: { search_term: search_term,
|
||||
producer_id: producer_id,
|
||||
producer_options: producer_options,
|
||||
category_options: category_options,
|
||||
category_id: category_id }
|
||||
= render partial: 'filters', locals: { search_term:,
|
||||
producer_id:,
|
||||
producer_options:,
|
||||
category_options:,
|
||||
category_id: } if display_search_filter
|
||||
- if products.any?
|
||||
.container.results
|
||||
.sixteen.columns
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
= render partial: "content", locals: { products: @products, pagy: @pagy, search_term: @search_term,
|
||||
producer_options: producers, producer_id: @producer_id,
|
||||
category_options: categories, category_id: @category_id,
|
||||
tax_category_options:, flashes: flash }
|
||||
tax_category_options:, flashes: flash,
|
||||
display_search_filter: (@products.any? || @search_term.present? || @category_id.present?) }
|
||||
- %w[product variant].each do |object_type|
|
||||
= render partial: 'delete_modal', locals: { object_type: }
|
||||
#modal-component
|
||||
|
||||
Reference in New Issue
Block a user