spree_backend 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/general_settings.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/payments/new.js +4 -4
- data/app/assets/javascripts/spree/backend.js +1 -1
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +1 -1
- data/app/controllers/spree/admin/products_controller.rb +57 -48
- data/app/controllers/spree/admin/refunds_controller.rb +7 -0
- data/app/controllers/spree/admin/reimbursements_controller.rb +7 -0
- data/app/controllers/spree/admin/resource_controller.rb +5 -3
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +2 -1
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +1 -1
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +9 -11
- data/app/views/spree/admin/payments/index.html.erb +3 -3
- data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +6 -4
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/show.html.erb +1 -1
- data/app/views/spree/admin/shared/_destroy.js.erb +1 -1
- data/config/initializers/assets.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07d6da4a39570959b8010649ff1ef18040859ae7
|
4
|
+
data.tar.gz: c03bc5c2165dedf0d2c7d7a88c0c7b34839a5de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f8d1c6d29305a975e5b2fb0b3c76f0430e46fc73c19520f9fea93eb91dfcc6e943ad12b595a99c77e0178f057c34ffdb9b23075bf4a0d8758f3ee055c31232
|
7
|
+
data.tar.gz: 89f93de4b2b15a2e43e360204ccf4eb0afa633b325649520ce149b40deb8883e15ba61ed2541856b0c6f038e9c0c1d58f77c376b56d2bbcf810e0888a78133ef
|
@@ -12,9 +12,9 @@ $(document).ready(function() {
|
|
12
12
|
$('.payment_methods_radios').click(
|
13
13
|
function() {
|
14
14
|
$('.payment-methods').hide();
|
15
|
-
$('.payment-methods input').prop('disabled', true);
|
15
|
+
$('.payment-methods :input').prop('disabled', true);
|
16
16
|
if (this.checked) {
|
17
|
-
$('#payment_method_' + this.value + ' input').prop('disabled', false);
|
17
|
+
$('#payment_method_' + this.value + ' :input').prop('disabled', false);
|
18
18
|
$('#payment_method_' + this.value).show();
|
19
19
|
}
|
20
20
|
}
|
@@ -23,11 +23,11 @@ $(document).ready(function() {
|
|
23
23
|
$('.payment_methods_radios').each(
|
24
24
|
function() {
|
25
25
|
if (this.checked) {
|
26
|
-
$('#payment_method_' + this.value + ' input').prop('disabled', false);
|
26
|
+
$('#payment_method_' + this.value + ' :input').prop('disabled', false);
|
27
27
|
$('#payment_method_' + this.value).show();
|
28
28
|
} else {
|
29
29
|
$('#payment_method_' + this.value).hide();
|
30
|
-
$('#payment_method_' + this.value + ' input').prop('disabled', true);
|
30
|
+
$('#payment_method_' + this.value + ' :input').prop('disabled', true);
|
31
31
|
}
|
32
32
|
|
33
33
|
if ($("#card_new" + this.value).is("*")) {
|
@@ -21,9 +21,9 @@
|
|
21
21
|
//= require spree/backend/spree-select2
|
22
22
|
//= require_tree .
|
23
23
|
|
24
|
-
|
25
24
|
Spree.routes.checkouts_api = Spree.pathFor('api/checkouts')
|
26
25
|
Spree.routes.classifications_api = Spree.pathFor('api/classifications')
|
26
|
+
Spree.routes.clear_cache = Spree.pathFor('admin/general_settings/clear_cache')
|
27
27
|
Spree.routes.option_type_search = Spree.pathFor('api/option_types')
|
28
28
|
Spree.routes.orders_api = Spree.pathFor('api/orders')
|
29
29
|
Spree.routes.product_search = Spree.pathFor('api/products')
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
// Fonts
|
6
6
|
//--------------------------------------------------------------
|
7
|
-
$base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
|
7
|
+
$base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
|
8
8
|
|
9
9
|
// Colors
|
10
10
|
//--------------------------------------------------------------
|
@@ -10,7 +10,7 @@ module Spree
|
|
10
10
|
|
11
11
|
def show
|
12
12
|
session[:return_to] ||= request.referer
|
13
|
-
redirect_to
|
13
|
+
redirect_to action: :edit
|
14
14
|
end
|
15
15
|
|
16
16
|
def index
|
@@ -31,10 +31,11 @@ module Spree
|
|
31
31
|
flash[:success] = flash_message_for(@object, :successfully_updated)
|
32
32
|
respond_with(@object) do |format|
|
33
33
|
format.html { redirect_to location_after_save }
|
34
|
-
format.js { render :
|
34
|
+
format.js { render layout: false }
|
35
35
|
end
|
36
36
|
else
|
37
|
-
# Stops people submitting blank slugs, causing errors when they try to
|
37
|
+
# Stops people submitting blank slugs, causing errors when they try to
|
38
|
+
# update the product again
|
38
39
|
@product.slug = @product.slug_was if @product.slug.blank?
|
39
40
|
invoke_callbacks(:update, :fails)
|
40
41
|
respond_with(@object)
|
@@ -66,7 +67,7 @@ module Spree
|
|
66
67
|
end
|
67
68
|
|
68
69
|
def stock
|
69
|
-
@variants = @product.variants
|
70
|
+
@variants = @product.variants.includes(*variant_stock_includes)
|
70
71
|
@variants = [@product.master] if @variants.empty?
|
71
72
|
@stock_locations = StockLocation.accessible_by(current_ability, :read)
|
72
73
|
if @stock_locations.empty?
|
@@ -77,59 +78,67 @@ module Spree
|
|
77
78
|
|
78
79
|
protected
|
79
80
|
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
def find_resource
|
82
|
+
Product.with_deleted.friendly.find(params[:id])
|
83
|
+
end
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
def location_after_save
|
86
|
+
spree.edit_admin_product_url(@product)
|
87
|
+
end
|
87
88
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
89
|
+
def load_data
|
90
|
+
@taxons = Taxon.order(:name)
|
91
|
+
@option_types = OptionType.order(:name)
|
92
|
+
@tax_categories = TaxCategory.order(:name)
|
93
|
+
@shipping_categories = ShippingCategory.order(:name)
|
94
|
+
end
|
94
95
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
params[:q][:s] ||= "name asc"
|
101
|
-
@collection = super
|
102
|
-
@collection = @collection.with_deleted if params[:q].delete(:deleted_at_null) == '0'
|
103
|
-
# @search needs to be defined as this is passed to search_form_for
|
104
|
-
@search = @collection.ransack(params[:q])
|
105
|
-
@collection = @search.result.
|
106
|
-
distinct_by_product_ids(params[:q][:s]).
|
107
|
-
includes(product_includes).
|
108
|
-
page(params[:page]).
|
109
|
-
per(Spree::Config[:admin_products_per_page])
|
110
|
-
|
111
|
-
@collection
|
112
|
-
end
|
96
|
+
def collection
|
97
|
+
return @collection if @collection.present?
|
98
|
+
params[:q] ||= {}
|
99
|
+
params[:q][:deleted_at_null] ||= "1"
|
113
100
|
|
114
|
-
|
115
|
-
|
116
|
-
|
101
|
+
params[:q][:s] ||= "name asc"
|
102
|
+
@collection = super
|
103
|
+
if params[:q].delete(:deleted_at_null) == '0'
|
104
|
+
@collection = @collection.with_deleted
|
117
105
|
end
|
106
|
+
# @search needs to be defined as this is passed to search_form_for
|
107
|
+
@search = @collection.ransack(params[:q])
|
108
|
+
@collection = @search.result.
|
109
|
+
distinct_by_product_ids(params[:q][:s]).
|
110
|
+
includes(product_includes).
|
111
|
+
page(params[:page]).
|
112
|
+
per(params[:per_page] || Spree::Config[:admin_products_per_page])
|
113
|
+
|
114
|
+
@collection
|
115
|
+
end
|
118
116
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
end
|
117
|
+
def create_before
|
118
|
+
return if params[:product][:prototype_id].blank?
|
119
|
+
@prototype = Spree::Prototype.find(params[:product][:prototype_id])
|
120
|
+
end
|
124
121
|
|
125
|
-
|
126
|
-
|
127
|
-
|
122
|
+
def update_before
|
123
|
+
# note: we only reset the product properties if we're receiving a post
|
124
|
+
# from the form on that tab
|
125
|
+
return unless params[:clear_product_properties]
|
126
|
+
params[:product] ||= {}
|
127
|
+
end
|
128
128
|
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
def product_includes
|
130
|
+
[{ variants: [:images], master: [:images, :default_price] }]
|
131
|
+
end
|
132
132
|
|
133
|
+
def clone_object_url(resource)
|
134
|
+
clone_admin_product_url resource
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
def variant_stock_includes
|
140
|
+
[:images, stock_items: :stock_location, option_values: :option_type]
|
141
|
+
end
|
133
142
|
end
|
134
143
|
end
|
135
144
|
end
|
@@ -6,6 +6,8 @@ module Spree
|
|
6
6
|
|
7
7
|
helper_method :refund_reasons
|
8
8
|
|
9
|
+
rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error, only: :create
|
10
|
+
|
9
11
|
private
|
10
12
|
|
11
13
|
def location_after_save
|
@@ -26,6 +28,11 @@ module Spree
|
|
26
28
|
refund.amount = refund.payment.credit_allowed
|
27
29
|
end
|
28
30
|
end
|
31
|
+
|
32
|
+
def spree_core_gateway_error(error)
|
33
|
+
flash[:error] = error.message
|
34
|
+
render :new
|
35
|
+
end
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
@@ -5,6 +5,8 @@ module Spree
|
|
5
5
|
|
6
6
|
before_action :load_simulated_refunds, only: :edit
|
7
7
|
|
8
|
+
rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error, only: :perform
|
9
|
+
|
8
10
|
def perform
|
9
11
|
@reimbursement.perform!
|
10
12
|
redirect_to location_after_save
|
@@ -33,6 +35,11 @@ module Spree
|
|
33
35
|
def load_simulated_refunds
|
34
36
|
@reimbursement_objects = @reimbursement.simulate
|
35
37
|
end
|
38
|
+
|
39
|
+
def spree_core_gateway_error(error)
|
40
|
+
flash[:error] = error.message
|
41
|
+
redirect_to edit_admin_order_reimbursement_path(parent, @reimbursement)
|
42
|
+
end
|
36
43
|
end
|
37
44
|
end
|
38
45
|
end
|
@@ -70,12 +70,14 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def update_positions
|
73
|
-
|
74
|
-
|
73
|
+
ActiveRecord::Base.transaction do
|
74
|
+
params[:positions].each do |id, index|
|
75
|
+
model_class.find(id).set_list_position(index)
|
76
|
+
end
|
75
77
|
end
|
76
78
|
|
77
79
|
respond_to do |format|
|
78
|
-
format.js { render :
|
80
|
+
format.js { render text: 'Ok' }
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
@@ -29,7 +29,8 @@
|
|
29
29
|
<%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
|
30
30
|
</td>
|
31
31
|
<td class="align-center">
|
32
|
-
<%= return_item.exchange_variant.try(:
|
32
|
+
<%= return_item.exchange_variant.try(:exchange_name) %>
|
33
|
+
<td>
|
33
34
|
</td>
|
34
35
|
<td class="align-center">
|
35
36
|
<%= return_item.acceptance_status_errors %>
|
@@ -21,17 +21,15 @@
|
|
21
21
|
</td>
|
22
22
|
<% end %>
|
23
23
|
<td class="item-total align-center"><%= line_item_shipment_price(item.line_item, item.quantity) %></td>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<%= link_to '', '#', :class => 'delete-item fa fa-trash no-text with-tip', :data => { 'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove'}, :title => Spree.t('delete') %>
|
32
|
-
<% end %>
|
24
|
+
<td class="cart-item-delete actions" data-hook="cart_item_delete">
|
25
|
+
<% if !shipment.shipped? && can?(:update, item.line_item) %>
|
26
|
+
<%= link_to '', '#', :class => 'save-item fa fa-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
|
27
|
+
<%= link_to '', '#', :class => 'cancel-item fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
|
28
|
+
<% if shipment.order.shipped_shipments.count == 0 %>
|
29
|
+
<%= link_to '', '#', :class => 'split-item icon_link fa fa-arrows-h no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
|
30
|
+
<%= link_to '', '#', :class => 'delete-item fa fa-trash no-text with-tip', :data => { 'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove'}, :title => Spree.t('delete') %>
|
33
31
|
<% end %>
|
34
|
-
|
35
|
-
|
32
|
+
<% end %>
|
33
|
+
</td>
|
36
34
|
</tr>
|
37
35
|
<% end %>
|
@@ -1,11 +1,11 @@
|
|
1
|
-
<%= render :
|
1
|
+
<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: "Payments" } %>
|
2
2
|
|
3
|
-
<% content_for :page_actions do %>
|
3
|
+
<% content_for :page_actions do %>
|
4
4
|
<% if @order.outstanding_balance? %>
|
5
5
|
<li id="new_payment_section">
|
6
6
|
<%= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order), :icon => 'plus' %>
|
7
7
|
</li>
|
8
|
-
<% end %>
|
8
|
+
<% end %>
|
9
9
|
<li><%= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'arrow-left' %></li>
|
10
10
|
<% end %>
|
11
11
|
|
@@ -1,17 +1,19 @@
|
|
1
1
|
<tr class="product_property fields" id="spree_<%= dom_id(f.object) %>" data-hook="product_property">
|
2
2
|
<td class="no-border">
|
3
|
-
|
4
|
-
|
3
|
+
<% if f.object.persisted? %>
|
4
|
+
<span class="handle"></span>
|
5
|
+
<%= f.hidden_field :id %>
|
6
|
+
<% end %>
|
5
7
|
</td>
|
6
8
|
<td class='property_name'>
|
7
|
-
<%= f.text_field :property_name, :
|
9
|
+
<%= f.text_field :property_name, class: 'autocomplete' %>
|
8
10
|
</td>
|
9
11
|
<td class='value'>
|
10
12
|
<%= f.text_field :value %>
|
11
13
|
</td>
|
12
14
|
<td class="actions">
|
13
15
|
<% if f.object.persisted? %>
|
14
|
-
<%= link_to_delete f.object, :
|
16
|
+
<%= link_to_delete f.object, no_text: true %>
|
15
17
|
<% end %>
|
16
18
|
</td>
|
17
19
|
</tr>
|
@@ -51,9 +51,9 @@
|
|
51
51
|
</td>
|
52
52
|
<td class="align-center">
|
53
53
|
<% if return_item.exchange_processed? %>
|
54
|
-
<%= return_item.exchange_variant.
|
54
|
+
<%= return_item.exchange_variant.exchange_name %>
|
55
55
|
<% else %>
|
56
|
-
<%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :
|
56
|
+
<%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2 fullwidth return-item-exchange-selection" } %>
|
57
57
|
<% end %>
|
58
58
|
</td>
|
59
59
|
</tr>
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<%= reimbursement_type_name(return_item.override_reimbursement_type) %>
|
39
39
|
</td>
|
40
40
|
<td>
|
41
|
-
<%= return_item.exchange_variant.try(:
|
41
|
+
<%= return_item.exchange_variant.try(:exchange_name) %>
|
42
42
|
</td>
|
43
43
|
<td class="align-center">
|
44
44
|
<%= return_item.display_pre_tax_amount %>
|
@@ -1 +1 @@
|
|
1
|
-
Rails.application.config.assets.precompile += %w( jquery-ui/* )
|
1
|
+
Rails.application.config.assets.precompile += %w( jquery-ui/* logo/spree_50.png )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.
|
19
|
+
version: 2.4.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.4.
|
26
|
+
version: 2.4.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.4.
|
33
|
+
version: 2.4.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.4.
|
40
|
+
version: 2.4.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jquery-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: select2-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.5.
|
75
|
+
version: 3.5.9.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.5.
|
82
|
+
version: 3.5.9.1
|
83
83
|
description: Required dependency for Spree
|
84
84
|
email: sean@spreecommerce.com
|
85
85
|
executables: []
|
@@ -559,7 +559,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
559
559
|
requirements:
|
560
560
|
- none
|
561
561
|
rubyforge_project: spree_backend
|
562
|
-
rubygems_version: 2.
|
562
|
+
rubygems_version: 2.4.5
|
563
563
|
signing_key:
|
564
564
|
specification_version: 4
|
565
565
|
summary: backend e-commerce functionality for the Spree project.
|