<%= render 'spree/admin/shared/product_tabs', current: 'Prices' %> <% admin_breadcrumb(plural_resource_name(Spree::Price)) %> <% content_for :page_actions do %> <% end if can?(:create, Spree::Product) %> <% content_for :table_filter_title do %> <%= t('spree.search') %> <% end %> <% content_for :table_filter do %>
<%= search_form_for [:admin, :product, @search] do |f| %>
<%= label_tag :q_variant_id_eq, Spree::Variant.model_name.human %> <%= f.select :variant_id_eq, @product.variants_including_master.map { |v| [v.descriptive_name, v.id] }, {include_blank: true}, class: "custom-select fullwidth" %>
<%= label_tag :q_currency_eq, Spree::Price.human_attribute_name(:currency) %> <%= f.select :currency_eq, @prices.map(&:currency).uniq, {include_blank: true}, class: "custom-select fullwidth" %>
<%= label_tag :q_country_iso_eq, Spree::Price.human_attribute_name(:country) %> <%= f.select :country_iso_eq, @prices.map(&:country).compact.uniq.map { |c| [c.name, c.iso]}, {include_blank: true}, class: "custom-select fullwidth" %>
<%= label_tag :q_amount_gt, t(".amount_greater_than") %> <%= f.text_field :amount_gt %>
<%= label_tag :q_amount_lt, t(".amount_less_than") %> <%= f.text_field :amount_lt %>
<%= button_tag t('spree.filter_results'), class: 'btn btn-primary' %>
<% end %>
<% end %> <%= render 'master_variant_table', master_prices: @master_prices, variants: @product.variants.any? %> <%= render 'table', variant_prices: @variant_prices if @product.variants.any? %>