forked from StemboltHQ/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.erb
74 lines (63 loc) · 2.34 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<%= render 'spree/admin/shared/product_tabs', current: 'Prices' %>
<% content_for :page_actions do %>
<li id="new_price_link">
<%= button_link_to t(".new_price"), new_object_url, { :remote => true, :id => 'admin_new_product' } %>
</li>
<% end if can?(:create, Spree::Product) %>
<% content_for :table_filter_title do %>
<%= Spree.t(:search) %>
<% end %>
<% content_for :table_filter do %>
<div data-hook="admin_product_prices_index_search">
<%= search_form_for [:admin, :product, @search] do |f| %>
<div class="row">
<div class="col-xs-4">
<div class="field" data-hook="sku-select">
<%= 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: "select2 fullwidth" %>
</div>
</div>
<div class="col-xs-2">
<div class="field" data-hook="currency-select">
<%= label_tag :q_currency_eq, Spree::Price.human_attribute_name(:currency) %>
<%= f.select :currency_eq,
@prices.map(&:currency).uniq,
{include_blank: true},
class: "select2 fullwidth" %>
</div>
</div>
<div class="col-xs-2">
<div class="field" data-hook="country-select">
<%= 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: "select2 fullwidth" %>
</div>
</div>
<div class="col-xs-2">
<div class="field">
<%= label_tag :q_amount_gt, t(".amount_greater_than") %>
<%= f.text_field :amount_gt %>
</div>
</div>
<div class="col-xs-2">
<div class="field">
<%= label_tag :q_amount_lt, t(".amount_less_than") %>
<%= f.text_field :amount_lt %>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="actions filter-actions">
<div data-hook="admin_orders_index_search_buttons">
<%= button Spree.t(:filter_results) %>
</div>
</div>
<% end %>
</div>
<% end %>
<%= render 'table', variant_prices: @variant_prices, master_prices: @master_prices %>