Skip to content

Commit

Permalink
Hide search filters when no product is present
Browse files Browse the repository at this point in the history
  • Loading branch information
saunmanoj888 committed Nov 18, 2024
1 parent db79af4 commit fa26cf4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions app/views/admin/products_v3/_content.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
.spinner-container
.spinner
= t('.loading')
.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 }
- if display_search_filter
.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 }
- 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

0 comments on commit fa26cf4

Please sign in to comment.