Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back Office Product List - Hide search field and filters when there are no products in list #12983

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/views/admin/products_v3/_content.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/views/admin/products_v3/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading