solidus_backend 2.0.3 → 2.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +14 -6
- data/app/assets/javascripts/spree/backend/images/upload.js +203 -0
- data/app/assets/javascripts/spree/backend/option_value_picker.js +2 -1
- data/app/assets/javascripts/spree/backend/stock_management/index_update_forms.coffee +1 -1
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +5 -1
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/templates/index.js +15 -0
- data/app/assets/javascripts/spree/backend/templates/products/upload_progress.hbs +12 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +13 -11
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +12 -10
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +7 -5
- data/app/assets/javascripts/spree/backend.js +57 -3
- data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +1 -1
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +2 -0
- data/app/assets/stylesheets/spree/backend/components/_table-filter.scss +3 -1
- data/app/assets/stylesheets/spree/backend/components/_tabs.scss +2 -0
- data/app/assets/stylesheets/spree/backend/sections/_adjustments.scss +3 -0
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +29 -17
- data/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +6 -0
- data/app/assets/stylesheets/spree/backend/shared/_header.scss +2 -0
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -0
- data/app/assets/stylesheets/spree/backend/shared/_utilities.scss +1 -2
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +1 -3
- data/app/controllers/spree/admin/orders_controller.rb +2 -0
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/prices_controller.rb +7 -1
- data/app/controllers/spree/admin/products_controller.rb +0 -6
- data/app/controllers/spree/admin/promotions_controller.rb +0 -2
- data/app/controllers/spree/admin/users_controller.rb +3 -0
- data/app/helpers/spree/admin/adjustments_helper.rb +1 -1
- data/app/helpers/spree/admin/base_helper.rb +0 -35
- data/app/helpers/spree/admin/stock_transfers_helper.rb +14 -0
- data/app/models/spree/backend_configuration.rb +2 -2
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/adjustment_reasons/shared/_form.html.erb +14 -16
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +4 -1
- data/app/views/spree/admin/adjustments/_form.html.erb +24 -20
- data/app/views/spree/admin/cancellations/index.html.erb +2 -3
- data/app/views/spree/admin/countries/_form.html.erb +4 -4
- data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/new.html.erb +5 -7
- data/app/views/spree/admin/general_settings/edit.html.erb +55 -46
- data/app/views/spree/admin/images/_form.html.erb +13 -11
- data/app/views/spree/admin/images/_image_row.html.erb +22 -0
- data/app/views/spree/admin/images/create.js.erb +9 -0
- data/app/views/spree/admin/images/edit.html.erb +12 -8
- data/app/views/spree/admin/images/index.html.erb +57 -49
- data/app/views/spree/admin/option_types/_form.html.erb +2 -2
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_line_item.html.erb +5 -3
- data/app/views/spree/admin/orders/_add_product.html.erb +5 -3
- data/app/views/spree/admin/orders/_shipment.html.erb +14 -6
- data/app/views/spree/admin/orders/cart.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +17 -15
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +28 -26
- data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
- data/app/views/spree/admin/orders/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +70 -63
- data/app/views/spree/admin/payment_methods/_form.html.erb +54 -48
- data/app/views/spree/admin/payment_methods/index.html.erb +7 -5
- data/app/views/spree/admin/payments/_form.html.erb +2 -2
- data/app/views/spree/admin/payments/index.html.erb +1 -1
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +32 -30
- data/app/views/spree/admin/payments/source_forms/_storecredit.html.erb +1 -0
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +8 -1
- data/app/views/spree/admin/prices/_form.html.erb +38 -43
- data/app/views/spree/admin/prices/_master_variant_table.html.erb +41 -0
- data/app/views/spree/admin/prices/_table.html.erb +35 -33
- data/app/views/spree/admin/prices/index.html.erb +37 -35
- data/app/views/spree/admin/product_properties/index.html.erb +0 -7
- data/app/views/spree/admin/products/_form.html.erb +153 -144
- data/app/views/spree/admin/products/edit.html.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +19 -13
- data/app/views/spree/admin/products/new.html.erb +5 -38
- data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/promotion_rules/create.js.erb +6 -0
- data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
- data/app/views/spree/admin/promotions/_form.html.erb +48 -44
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
- data/app/views/spree/admin/promotions/_rules.html.erb +8 -4
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +9 -5
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +30 -24
- data/app/views/spree/admin/promotions/edit.html.erb +2 -2
- data/app/views/spree/admin/promotions/index.html.erb +22 -20
- data/app/views/spree/admin/promotions/new.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +11 -5
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +18 -8
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +7 -5
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +13 -6
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +11 -7
- data/app/views/spree/admin/promotions/rules/_product.html.erb +11 -7
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +15 -9
- data/app/views/spree/admin/promotions/rules/_user.html.erb +5 -3
- data/app/views/spree/admin/promotions/rules/_user_role.html.erb +12 -0
- data/app/views/spree/admin/properties/_form.html.erb +2 -2
- data/app/views/spree/admin/properties/index.html.erb +7 -5
- data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/refund_reasons/shared/_form.html.erb +14 -16
- data/app/views/spree/admin/refunds/edit.html.erb +2 -2
- data/app/views/spree/admin/refunds/new.html.erb +4 -4
- data/app/views/spree/admin/shared/_configuration_menu.html.erb +0 -4
- data/app/views/spree/admin/shared/_head.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +0 -3
- data/app/views/spree/admin/shared/_rebuild_vat_prices_checkbox.html.erb +1 -1
- data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +12 -8
- data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +74 -81
- data/app/views/spree/admin/shipping_methods/index.html.erb +3 -3
- data/app/views/spree/admin/states/_form.html.erb +2 -2
- data/app/views/spree/admin/states/index.html.erb +9 -5
- data/app/views/spree/admin/stock_locations/_form.html.erb +42 -28
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +4 -4
- data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
- data/app/views/spree/admin/stock_movements/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_movements/index.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +10 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +29 -27
- data/app/views/spree/admin/stock_transfers/show.html.erb +26 -24
- data/app/views/spree/admin/store_credits/_form.html.erb +3 -3
- data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
- data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -1
- data/app/views/spree/admin/store_credits/index.html.erb +2 -2
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +49 -47
- data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +11 -1
- data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
- data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/_form.html.erb +28 -28
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +6 -6
- data/app/views/spree/admin/taxons/index.html.erb +2 -2
- data/app/views/spree/admin/users/_addresses_form.html.erb +19 -15
- data/app/views/spree/admin/users/_form.html.erb +9 -6
- data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
- data/app/views/spree/admin/users/addresses.html.erb +1 -1
- data/app/views/spree/admin/users/edit.html.erb +2 -2
- data/app/views/spree/admin/users/items.html.erb +2 -2
- data/app/views/spree/admin/users/orders.html.erb +2 -2
- data/app/views/spree/admin/variants/_form.html.erb +73 -49
- data/app/views/spree/admin/variants/_table_filter.html.erb +12 -8
- data/app/views/spree/admin/variants/index.html.erb +2 -2
- data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +34 -31
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/app/views/spree/admin/zones/index.html.erb +1 -3
- data/app/views/spree/layouts/admin.html.erb +4 -4
- data/config/routes.rb +0 -11
- data/solidus_backend.gemspec +4 -1
- data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -3
- data/spec/controllers/spree/admin/prices_controller_spec.rb +5 -3
- data/spec/features/admin/configuration/general_settings_spec.rb +12 -0
- data/spec/features/admin/configuration/payment_methods_spec.rb +3 -2
- data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
- data/spec/features/admin/homepage_spec.rb +0 -3
- data/spec/features/admin/orders/adjustments_spec.rb +28 -25
- data/spec/features/admin/orders/customer_details_spec.rb +1 -1
- data/spec/features/admin/orders/order_details_spec.rb +27 -1
- data/spec/features/admin/orders/payments_spec.rb +1 -1
- data/spec/features/admin/products/edit/images_spec.rb +28 -1
- data/spec/features/admin/products/pricing_spec.rb +17 -2
- data/spec/features/admin/products/products_spec.rb +0 -104
- data/spec/features/admin/store_credits_spec.rb +3 -3
- data/spec/features/admin/users_spec.rb +7 -1
- metadata +21 -32
- data/app/assets/javascripts/spree/backend/nested-attribute.js +0 -27
- data/app/assets/stylesheets/spree/backend/sections/_adjustments_table.scss +0 -8
- data/app/assets/stylesheets/spree/backend/sections/_edit_checkouts.scss +0 -72
- data/app/assets/stylesheets/spree/backend/sections/_tax_zones.scss +0 -15
- data/app/controllers/spree/admin/prototypes_controller.rb +0 -26
- data/app/controllers/spree/admin/trackers_controller.rb +0 -6
- data/app/views/spree/admin/prototypes/_form.html.erb +0 -36
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +0 -25
- data/app/views/spree/admin/prototypes/available.js.erb +0 -2
- data/app/views/spree/admin/prototypes/edit.html.erb +0 -15
- data/app/views/spree/admin/prototypes/index.html.erb +0 -50
- data/app/views/spree/admin/prototypes/new.html.erb +0 -9
- data/app/views/spree/admin/prototypes/new.js.erb +0 -5
- data/app/views/spree/admin/prototypes/select.js.erb +0 -4
- data/app/views/spree/admin/prototypes/show.html.erb +0 -42
- data/app/views/spree/admin/trackers/_form.html.erb +0 -28
- data/app/views/spree/admin/trackers/edit.html.erb +0 -19
- data/app/views/spree/admin/trackers/index.html.erb +0 -54
- data/app/views/spree/admin/trackers/new.html.erb +0 -18
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -50
- data/spec/features/admin/products/prototypes_spec.rb +0 -110
@@ -1,174 +1,189 @@
|
|
1
1
|
<div data-hook="admin_product_form_fields">
|
2
2
|
|
3
|
-
<div class="
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= f.
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
<div class="row">
|
4
|
+
|
5
|
+
<div class="left col-xs-9" data-hook="admin_product_form_left">
|
6
|
+
<div data-hook="admin_product_form_name">
|
7
|
+
<%= f.field_container :name do %>
|
8
|
+
<%= f.label :name, class: 'required' %>
|
9
|
+
<%= f.text_field :name, :class => 'fullwidth title', :required => true %>
|
10
|
+
<%= f.error_message_on :name %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
<div data-hook="admin_product_form_slug">
|
15
|
+
<%= f.field_container :slug do %>
|
16
|
+
<%= f.label :slug, class: 'required' %>
|
17
|
+
<%= f.text_field :slug, :class => 'fullwidth title', :required => true %>
|
18
|
+
<%= f.error_message_on :slug %>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
<div data-hook="admin_product_form_description">
|
23
|
+
<%= f.field_container :description do %>
|
24
|
+
<%= f.label :description %>
|
25
|
+
<%= f.text_area :description, {:rows => "#{unless @product.has_variants? then '22' else '15' end}", :class => 'fullwidth'} %>
|
26
|
+
<%= f.error_message_on :description %>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
26
29
|
</div>
|
27
|
-
</div>
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
<div class="right col-xs-3" data-hook="admin_product_form_right">
|
32
|
+
<div data-hook="admin_product_form_price">
|
33
|
+
<%= f.field_container :price do %>
|
34
|
+
<%= f.label :price, class: 'required' %>
|
35
|
+
<%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :required => true %>
|
36
|
+
<%= f.error_message_on :price %>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<% if show_rebuild_vat_checkbox? %>
|
41
|
+
<%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product" %>
|
42
|
+
<div class="clearfix"></div>
|
35
43
|
<% end %>
|
36
|
-
</div>
|
37
44
|
|
38
|
-
|
39
|
-
<%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product", wrapper_class: "alpha omega field four columns" %>
|
40
|
-
<div class="clearfix"></div>
|
41
|
-
<% end %>
|
45
|
+
<div class="row">
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
<div data-hook="admin_product_form_cost_price" class="col-xs-6">
|
48
|
+
<%= f.field_container :cost_price do %>
|
49
|
+
<%= f.label :cost_price %>
|
50
|
+
<%= f.text_field :cost_price, :value => number_to_currency(@product.cost_price, :unit => '') %>
|
51
|
+
<%= f.error_message_on :cost_price %>
|
52
|
+
<% end %>
|
53
|
+
</div>
|
50
54
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
<div data-hook="admin_product_form_cost_currency" class="col-xs-6">
|
56
|
+
<%= f.field_container :cost_currency do %>
|
57
|
+
<%= f.label :cost_currency %>
|
58
|
+
<%= f.text_field :cost_currency %>
|
59
|
+
<%= f.error_message_on :cost_currency %>
|
60
|
+
<% end %>
|
61
|
+
</div>
|
58
62
|
|
59
|
-
|
63
|
+
</div>
|
60
64
|
|
61
|
-
|
62
|
-
<%= f.field_container :available_on do %>
|
63
|
-
<%= f.label :available_on %>
|
64
|
-
<%= f.error_message_on :available_on %>
|
65
|
-
<%= f.text_field :available_on, :value => datepicker_field_value(@product.available_on), :class => 'datepicker' %>
|
66
|
-
<% end %>
|
67
|
-
</div>
|
65
|
+
<div class="clear"></div>
|
68
66
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<%= f.
|
67
|
+
<div data-hook="admin_product_form_available_on">
|
68
|
+
<%= f.field_container :available_on do %>
|
69
|
+
<%= f.label :available_on %>
|
70
|
+
<%= f.error_message_on :available_on %>
|
71
|
+
<%= f.text_field :available_on, :value => datepicker_field_value(@product.available_on), :class => 'datepicker' %>
|
73
72
|
<% end %>
|
74
|
-
|
75
|
-
<% end %>
|
76
|
-
</div>
|
73
|
+
</div>
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
75
|
+
<div data-hook="admin_product_form_promotionable">
|
76
|
+
<%= f.field_container :promotionable do %>
|
77
|
+
<%= f.label :promotionable do %>
|
78
|
+
<%= f.check_box :promotionable %> <%= Spree::Product.human_attribute_name(:promotionable) %>
|
79
|
+
<% end %>
|
80
|
+
<%= f.field_hint :promotionable %>
|
81
|
+
<% end %>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<% if @product.has_variants? %>
|
85
|
+
<div data-hook="admin_product_form_multiple_variants">
|
86
|
+
<%= f.label :skus, Spree.t(:skus) %>
|
87
|
+
<span class="info">
|
88
|
+
<%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.count) %>
|
89
|
+
<ul class="text_list">
|
90
|
+
<% @product.variants.first(5).each do |variant| %>
|
91
|
+
<li><%= link_to variant.sku, spree.edit_admin_product_variant_path(@product, variant) %></li>
|
92
|
+
<% end %>
|
93
|
+
</ul>
|
94
|
+
<% if @product.variants.count > 5 %>
|
95
|
+
<%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.count - 5) %>
|
86
96
|
<% end %>
|
87
|
-
</
|
88
|
-
|
89
|
-
|
97
|
+
</span>
|
98
|
+
<div class="info-actions">
|
99
|
+
<% if can?(:admin, Spree::Variant) %>
|
100
|
+
<%= link_to_with_icon 'th-large', Spree.t(:manage_variants), admin_product_variants_url(@product) %>
|
101
|
+
<% end %>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
<% else %>
|
105
|
+
<div data-hook="admin_product_form_sku">
|
106
|
+
<%= f.field_container :sku do %>
|
107
|
+
<%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %>
|
108
|
+
<%= f.text_field :sku, :size => 16 %>
|
90
109
|
<% end %>
|
91
|
-
</
|
92
|
-
|
93
|
-
|
94
|
-
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div id="shipping_specs" class="row">
|
113
|
+
<% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
|
114
|
+
<div id="shipping_specs_<%= field %>_field" class="col-xs-6">
|
115
|
+
<div class="field">
|
116
|
+
<%= f.label field %>
|
117
|
+
<%= f.text_field field, value: number_with_precision(@product.send(field), precision: 2) %>
|
118
|
+
</div>
|
119
|
+
</div>
|
95
120
|
<% end %>
|
96
121
|
</div>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<%= f.
|
122
|
+
|
123
|
+
<% end %>
|
124
|
+
|
125
|
+
<div data-hook="admin_product_form_shipping_categories">
|
126
|
+
<%= f.field_container :shipping_categories do %>
|
127
|
+
<%= f.label :shipping_category_id, Spree::ShippingCategory.model_name.human %>
|
128
|
+
<%= f.field_hint :shipping_category %>
|
129
|
+
<%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
|
130
|
+
<%= f.error_message_on :shipping_category %>
|
103
131
|
<% end %>
|
104
132
|
</div>
|
105
133
|
|
106
|
-
<div
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
134
|
+
<div data-hook="admin_product_form_tax_category">
|
135
|
+
<%= f.field_container :tax_category do %>
|
136
|
+
<%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
|
137
|
+
<%= f.field_hint :tax_category %>
|
138
|
+
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
|
139
|
+
<%= f.error_message_on :tax_category %>
|
112
140
|
<% end %>
|
113
141
|
</div>
|
114
|
-
<% end %>
|
115
|
-
|
116
|
-
<div data-hook="admin_product_form_shipping_categories">
|
117
|
-
<%= f.field_container :shipping_categories do %>
|
118
|
-
<%= f.label :shipping_category_id, Spree::ShippingCategory.model_name.human %>
|
119
|
-
<%= f.field_hint :shipping_category %>
|
120
|
-
<%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
|
121
|
-
<%= f.error_message_on :shipping_category %>
|
122
|
-
<% end %>
|
123
142
|
</div>
|
124
143
|
|
125
|
-
<div data-hook="admin_product_form_tax_category">
|
126
|
-
<%= f.field_container :tax_category do %>
|
127
|
-
<%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
|
128
|
-
<%= f.field_hint :tax_category %>
|
129
|
-
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
|
130
|
-
<%= f.error_message_on :tax_category %>
|
131
|
-
<% end %>
|
132
|
-
</div>
|
133
144
|
</div>
|
134
145
|
|
135
|
-
<div class="
|
136
|
-
<div data-hook="admin_product_form_taxons">
|
137
|
-
<%= f.field_container :taxons do %>
|
138
|
-
<%= f.label :taxon_ids, plural_resource_name(Spree::Taxon) %><br />
|
139
|
-
<%= f.hidden_field :taxon_ids, :value => @product.taxon_ids.join(',') %>
|
140
|
-
<% end %>
|
141
|
-
</div>
|
146
|
+
<div class="row">
|
142
147
|
|
143
|
-
<div
|
144
|
-
|
145
|
-
<%= f.
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
<div class="col-xs-9">
|
149
|
+
<div data-hook="admin_product_form_taxons">
|
150
|
+
<%= f.field_container :taxons do %>
|
151
|
+
<%= f.label :taxon_ids, plural_resource_name(Spree::Taxon) %><br />
|
152
|
+
<%= f.hidden_field :taxon_ids, :value => @product.taxon_ids.join(',') %>
|
153
|
+
<% end %>
|
154
|
+
</div>
|
150
155
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
</div>
|
156
|
+
<div data-hook="admin_product_form_option_types">
|
157
|
+
<%= f.field_container :option_types do %>
|
158
|
+
<%= f.label :option_type_ids, plural_resource_name(Spree::OptionType) %>
|
159
|
+
<%= f.hidden_field :option_type_ids, :value => @product.option_type_ids.join(',') %>
|
160
|
+
<% end %>
|
161
|
+
</div>
|
158
162
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
163
|
+
<div data-hook="admin_product_form_meta">
|
164
|
+
<div data-hook="admin_product_form_meta_title">
|
165
|
+
<%= f.field_container :meta_title do %>
|
166
|
+
<%= f.label :meta_title %>
|
167
|
+
<%= f.text_field :meta_title, :class => 'fullwidth' %>
|
168
|
+
<% end %>
|
169
|
+
</div>
|
165
170
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
+
<div data-hook="admin_product_form_meta_keywords">
|
172
|
+
<%= f.field_container :meta_keywords do %>
|
173
|
+
<%= f.label :meta_keywords %>
|
174
|
+
<%= f.text_field :meta_keywords, :class => 'fullwidth' %>
|
175
|
+
<% end %>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div data-hook="admin_product_form_meta_description">
|
179
|
+
<%= f.field_container :meta_description do %>
|
180
|
+
<%= f.label :meta_description %>
|
181
|
+
<%= f.text_field :meta_description, :class => 'fullwidth' %>
|
182
|
+
<% end %>
|
183
|
+
</div>
|
184
|
+
</div>
|
171
185
|
</div>
|
186
|
+
|
172
187
|
</div>
|
173
188
|
|
174
189
|
<div class="clear"></div>
|
@@ -177,9 +192,3 @@
|
|
177
192
|
|
178
193
|
<div class="clear"></div>
|
179
194
|
</div>
|
180
|
-
|
181
|
-
<% unless Rails.env.test? %>
|
182
|
-
<script>
|
183
|
-
$('.select2-container').css({width: '20em'})
|
184
|
-
</script>
|
185
|
-
<% end %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
<% admin_breadcrumb(Spree.t(:product_details)) %>
|
13
13
|
|
14
|
-
<%= form_for [:admin, @product], :
|
14
|
+
<%= form_for [:admin, @product], :html => { :multipart => true } do |f| %>
|
15
15
|
<fieldset class="no-border-top">
|
16
16
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
17
17
|
<% if can?(:update, @product) %>
|
@@ -16,22 +16,28 @@
|
|
16
16
|
<div data-hook="admin_products_sidebar">
|
17
17
|
<%= search_form_for [:admin, @search] do |f| %>
|
18
18
|
<%- locals = {:f => f} %>
|
19
|
-
<div data-hook="admin_products_index_search">
|
20
|
-
<div class="
|
21
|
-
|
22
|
-
|
19
|
+
<div class="row" data-hook="admin_products_index_search" >
|
20
|
+
<div class="col-xs-6">
|
21
|
+
<div class="field">
|
22
|
+
<%= f.label :name_cont, Spree::Product.human_attribute_name(:name) %>
|
23
|
+
<%= f.text_field :name_cont, :size => 15 %>
|
24
|
+
</div>
|
23
25
|
</div>
|
24
26
|
|
25
|
-
<div class="
|
26
|
-
|
27
|
-
|
27
|
+
<div class="col-xs-4">
|
28
|
+
<div class="field">
|
29
|
+
<%= f.label :variants_including_master_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
|
30
|
+
<%= f.text_field :variants_including_master_sku_cont, :size => 15 %>
|
31
|
+
</div>
|
28
32
|
</div>
|
29
33
|
|
30
|
-
<div class="
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
<div class="col-xs-2">
|
35
|
+
<div class="field checkbox">
|
36
|
+
<label>
|
37
|
+
<%= f.check_box :deleted_at_null, {:checked => params[:q][:deleted_at_null] == '0'}, '0', '1' %>
|
38
|
+
<%= Spree.t(:show_deleted) %>
|
39
|
+
</label>
|
40
|
+
</div>
|
35
41
|
</div>
|
36
42
|
</div>
|
37
43
|
|
@@ -82,7 +88,7 @@
|
|
82
88
|
</tbody>
|
83
89
|
</table>
|
84
90
|
<% else %>
|
85
|
-
<div class="
|
91
|
+
<div class="col-xs-9 no-objects-found">
|
86
92
|
<%= render 'spree/admin/shared/no_objects_found',
|
87
93
|
resource: Spree::Product,
|
88
94
|
new_resource_url: new_object_url %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div data-hook="new_product_attrs" class="row">
|
16
16
|
<% unless @product.has_variants? %>
|
17
|
-
<div data-hook="new_product_sku" class="
|
17
|
+
<div data-hook="new_product_sku" class="col-xs-3">
|
18
18
|
<%= f.field_container :sku do %>
|
19
19
|
<%= f.label :sku, Spree.t(:sku) %><br />
|
20
20
|
<%= f.text_field :sku, :size => 16, :class => 'fullwidth' %>
|
@@ -23,14 +23,7 @@
|
|
23
23
|
</div>
|
24
24
|
<% end %>
|
25
25
|
|
26
|
-
<div data-hook="
|
27
|
-
<%= f.field_container :prototype do %>
|
28
|
-
<%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
|
29
|
-
<%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
|
30
|
-
<% end %>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<div data-hook="new_product_price" class="four columns">
|
26
|
+
<div data-hook="new_product_price" class="col-xs-3">
|
34
27
|
<%= f.field_container :price do %>
|
35
28
|
<%= f.label :price, class: 'required' %><br />
|
36
29
|
<%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :class => 'fullwidth', :required => true %>
|
@@ -38,7 +31,7 @@
|
|
38
31
|
<% end %>
|
39
32
|
</div>
|
40
33
|
|
41
|
-
<div data-hook="new_product_available_on" class="
|
34
|
+
<div data-hook="new_product_available_on" class="col-xs-3">
|
42
35
|
<%= f.field_container :available_on do %>
|
43
36
|
<%= f.label :available_on %>
|
44
37
|
<%= f.error_message_on :available_on %>
|
@@ -49,7 +42,7 @@
|
|
49
42
|
</div>
|
50
43
|
|
51
44
|
<div class='row'>
|
52
|
-
<div data-hook="new_product_shipping_category" class="
|
45
|
+
<div data-hook="new_product_shipping_category" class="col-xs-3">
|
53
46
|
<%= f.field_container :shipping_category do %>
|
54
47
|
<%= f.label :shipping_category_id, Spree::ShippingCategory.
|
55
48
|
model_name.human, class: 'required' %>
|
@@ -59,7 +52,7 @@
|
|
59
52
|
<% end %>
|
60
53
|
</div>
|
61
54
|
|
62
|
-
<div data-hook="new_product_tax_category" class="
|
55
|
+
<div data-hook="new_product_tax_category" class="col-xs-3">
|
63
56
|
<%= f.field_container :tax_category do %>
|
64
57
|
<%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
|
65
58
|
<%= f.field_hint :tax_category %>
|
@@ -69,33 +62,7 @@
|
|
69
62
|
</div>
|
70
63
|
</div>
|
71
64
|
|
72
|
-
<div class="clearfix" data-hook="product-from-prototype" id="product-from-prototype">
|
73
|
-
<%= render :file => 'spree/admin/prototypes/show' if @prototype %>
|
74
|
-
</div>
|
75
|
-
|
76
65
|
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
|
77
66
|
|
78
67
|
</fieldset>
|
79
68
|
<% end %>
|
80
|
-
|
81
|
-
<script type="text/javascript">
|
82
|
-
//<![CDATA[
|
83
|
-
(function($){
|
84
|
-
var base_url = "<%= admin_prototypes_url %>";
|
85
|
-
var prototype_select = $('#product_prototype_id');
|
86
|
-
prototype_select.change(function() {
|
87
|
-
var id = prototype_select.val();
|
88
|
-
if (id.length) {
|
89
|
-
var url = new Uri(base_url);
|
90
|
-
url.setPath(url.path() + '/' + id);
|
91
|
-
$('#product-from-prototype').load(url.toString());
|
92
|
-
} else {
|
93
|
-
$('#product-from-prototype').empty();
|
94
|
-
}
|
95
|
-
})
|
96
|
-
if (prototype_select.html() == "") {
|
97
|
-
prototype_select.change();
|
98
|
-
}
|
99
|
-
})(jQuery);
|
100
|
-
//]]>
|
101
|
-
</script>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @promotion } %>
|
2
2
|
|
3
3
|
<div class='row'>
|
4
|
-
<div class='
|
4
|
+
<div class='col-xs-4'>
|
5
5
|
<%= f.field_container :name do %>
|
6
6
|
<%= f.label :name %>
|
7
7
|
<%= f.text_field :name, :class => 'fullwidth' %>
|
@@ -5,6 +5,12 @@ $('.product_picker').productAutocomplete();
|
|
5
5
|
$('.user_picker').userAutocomplete();
|
6
6
|
$('.taxon_picker').taxonAutocomplete();
|
7
7
|
|
8
|
+
$('select.select2').select2({
|
9
|
+
allowClear: true,
|
10
|
+
dropdownAutoWidth: true,
|
11
|
+
minimumResultsForSearch: 8
|
12
|
+
});
|
13
|
+
|
8
14
|
$('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
|
9
15
|
$('#promotion_rule_type').select2();
|
10
16
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<fieldset id="action_fields" class="
|
1
|
+
<fieldset id="action_fields" class="no-border-top">
|
2
2
|
|
3
3
|
<%= form_tag spree.admin_promotion_promotion_actions_path(@promotion), :remote => true, :id => 'new_promotion_action_form' do %>
|
4
4
|
<% options = options_for_select( Rails.application.config.spree.promotions.actions.map(&:name).map {|name| [ Spree.t("promotion_action_types.#{name.demodulize.underscore}.name"), name] } ) %>
|
@@ -1,59 +1,61 @@
|
|
1
1
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @promotion } %>
|
2
2
|
<div class="row">
|
3
|
-
<div id="general_fields" class="
|
4
|
-
<div class="
|
5
|
-
|
6
|
-
<%= f.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<%= fields_for :promotion_builder do |bf| %>
|
11
|
-
<%= bf.field_container :base_code do %>
|
12
|
-
<%= bf.label :base_code %>
|
13
|
-
<%= bf.text_field :base_code, :readonly => !@promotion.new_record?, :class => 'fullwidth' %>
|
3
|
+
<div id="general_fields" class="col-xs-9">
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-xs-3">
|
6
|
+
<%= f.field_container :name do %>
|
7
|
+
<%= f.label :name %>
|
8
|
+
<%= f.text_field :name, :class => 'fullwidth' %>
|
14
9
|
<% end %>
|
15
10
|
|
16
|
-
<%=
|
17
|
-
<%= bf.
|
18
|
-
|
11
|
+
<%= fields_for :promotion_builder do |bf| %>
|
12
|
+
<%= bf.field_container :base_code do %>
|
13
|
+
<%= bf.label :base_code %>
|
14
|
+
<%= bf.text_field :base_code, :readonly => !@promotion.new_record?, :class => 'fullwidth' %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= bf.field_container :number_of_codes do %>
|
18
|
+
<%= bf.label :number_of_codes %>
|
19
|
+
<%= bf.text_field :number_of_codes, :readonly => !@promotion.new_record?, class: 'fullwidth' %>
|
20
|
+
<% end %>
|
19
21
|
<% end %>
|
20
|
-
<% end %>
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
<%= f.field_container :per_code_usage_limit do %>
|
24
|
+
<%= f.label :per_code_usage_limit %>
|
25
|
+
<%= f.text_field :per_code_usage_limit, class: 'fullwidth' %>
|
26
|
+
<% end %>
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
<%= f.field_container :path do %>
|
29
|
+
<%= f.label :path %>
|
30
|
+
<%= f.text_field :path, :class => 'fullwidth' %>
|
31
|
+
<% end %>
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
<%= f.field_container :advertise do %>
|
34
|
+
<%= f.check_box :advertise %>
|
35
|
+
<%= f.label :advertise %>
|
36
|
+
<% end %>
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
<%= f.field_container :apply_automatically do %>
|
39
|
+
<%= f.check_box :apply_automatically %>
|
40
|
+
<%= f.label :apply_automatically %>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
<div class="col-xs-9">
|
45
|
+
<%= f.field_container :description do %>
|
46
|
+
<%= f.label :description %><br />
|
47
|
+
<%= f.text_area :description, :rows => 7, :class => 'fullwidth' %>
|
48
|
+
<% end %>
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
<%= f.field_container :category do %>
|
51
|
+
<%= f.label :promotion_category_id, Spree::PromotionCategory.model_name.human %><br />
|
52
|
+
<%= f.collection_select(:promotion_category_id, @promotion_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
53
55
|
</div>
|
54
56
|
</div>
|
55
57
|
|
56
|
-
<div id="expiry_fields" class="
|
58
|
+
<div id="expiry_fields" class="col-xs-3">
|
57
59
|
<%= f.field_container :overall_usage_limit do %>
|
58
60
|
<%= f.label :usage_limit %><br />
|
59
61
|
<%= f.number_field :usage_limit, :min => 0, :class => 'fullwidth' %><br>
|
@@ -64,12 +66,14 @@
|
|
64
66
|
|
65
67
|
<div id="starts_at_field" class="field">
|
66
68
|
<%= f.label :starts_at %>
|
67
|
-
<%= f.
|
69
|
+
<%= f.field_hint :starts_at %>
|
70
|
+
<%= f.text_field :starts_at, :value => datepicker_field_value(@promotion.starts_at), :placeholder => t(".starts_at_placeholder"), :class => 'datepicker datepicker-from fullwidth' %>
|
68
71
|
</div>
|
69
72
|
|
70
73
|
<div id="expires_at_field" class="field">
|
71
74
|
<%= f.label :expires_at %>
|
72
|
-
<%= f.
|
75
|
+
<%= f.field_hint :expires_at %>
|
76
|
+
<%= f.text_field :expires_at, :value => datepicker_field_value(@promotion.expires_at), :placeholder => t(".expires_at_placeholder"), :class => 'datepicker datepicker-to fullwidth' %>
|
73
77
|
</div>
|
74
78
|
</div>
|
75
79
|
</div>
|