spree_backend 2.3.7 → 2.3.8
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/adjustments.js.coffee +2 -1
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +4 -1
- data/app/assets/javascripts/spree/backend/line_items.js.coffee +4 -1
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +2 -1
- data/app/assets/javascripts/spree/backend/orders/edit_form.js +3 -2
- data/app/assets/javascripts/spree/backend/product_picker.js +2 -1
- data/app/assets/javascripts/spree/backend/shipments.js.erb +23 -8
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -1
- data/app/assets/javascripts/spree/backend/stock_transfer.js.coffee +2 -1
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +2 -1
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +24 -5
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +3 -2
- data/app/assets/javascripts/spree/backend/user_picker.js +3 -2
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +2 -1
- data/app/views/spree/admin/shared/_head.html.erb +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50cfafb9dba0587d60b905297774c84f0801c5e7
|
4
|
+
data.tar.gz: 1b8d36f92add1bc681ecdd3aac34c3689a38e35b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d5585c2238c7335ddfae82942cafbfa50d82ffae041311f907707b0275929e34299fb2342fe5f86a1ca3847dc7809027b41462ecb25fd8b7f0da6acc259aafb
|
7
|
+
data.tar.gz: db6b9fd4ad2e146d9617eae8e306971dcbd21a5353bdf1a11425f31e33083cdc1c33c9aed9b9eb6c12b1d170b42793b0f42c20801f6af493be8e26cbadf6850e
|
@@ -6,6 +6,7 @@ $(@).ready( ->
|
|
6
6
|
url: Spree.url(Spree.routes.apply_coupon_code(order_number))
|
7
7
|
data:
|
8
8
|
coupon_code: $("#coupon_code").val()
|
9
|
+
token: Spree.api_key
|
9
10
|
success: ->
|
10
11
|
window.location.reload();
|
11
12
|
error: (msg) ->
|
@@ -13,4 +14,4 @@ $(@).ready( ->
|
|
13
14
|
show_flash 'error', msg.responseJSON["error"]
|
14
15
|
else
|
15
16
|
show_flash 'error', "There was a problem adding this coupon code."
|
16
|
-
)
|
17
|
+
)
|
@@ -19,7 +19,10 @@ $(document).ready(function() {
|
|
19
19
|
url: Spree.routes.user_search,
|
20
20
|
datatype: 'json',
|
21
21
|
data: function(term, page) {
|
22
|
-
return {
|
22
|
+
return {
|
23
|
+
q: term,
|
24
|
+
token: Spree.api_key
|
25
|
+
}
|
23
26
|
},
|
24
27
|
results: function(data, page) {
|
25
28
|
return { results: data }
|
@@ -46,6 +46,7 @@ adjustLineItem = (line_item_id, quantity) ->
|
|
46
46
|
data:
|
47
47
|
line_item:
|
48
48
|
quantity: quantity
|
49
|
+
token: Spree.api_key
|
49
50
|
).done (msg) ->
|
50
51
|
advanceOrder()
|
51
52
|
|
@@ -54,8 +55,10 @@ deleteLineItem = (line_item_id) ->
|
|
54
55
|
$.ajax(
|
55
56
|
type: "DELETE"
|
56
57
|
url: Spree.url(url)
|
58
|
+
data:
|
59
|
+
token: Spree.api_key
|
57
60
|
).done (msg) ->
|
58
61
|
$('#line-item-' + line_item_id).remove()
|
59
62
|
if $('.line-items tr.line-item').length == 0
|
60
63
|
$('.line-items').remove()
|
61
|
-
advanceOrder()
|
64
|
+
advanceOrder()
|
@@ -9,7 +9,8 @@ $(document).ready(function () {
|
|
9
9
|
|
10
10
|
$.post('/admin/orders/' + $('input#order_number').val() + '/line_items/' + $(id).val(), {
|
11
11
|
_method: 'put',
|
12
|
-
'line_item[quantity]': $(this).val()
|
12
|
+
'line_item[quantity]': $(this).val(),
|
13
|
+
token: Spree.api_key
|
13
14
|
},
|
14
15
|
|
15
16
|
function (resp) {
|
@@ -17,4 +18,4 @@ $(document).ready(function () {
|
|
17
18
|
});
|
18
19
|
});
|
19
20
|
});
|
20
|
-
});
|
21
|
+
});
|
@@ -66,7 +66,10 @@ $(document).ready(function () {
|
|
66
66
|
var url = Spree.url(Spree.routes.shipments_api + '/' + shipment_number + '/ship.json');
|
67
67
|
$.ajax({
|
68
68
|
type: 'PUT',
|
69
|
-
url: url
|
69
|
+
url: url,
|
70
|
+
data: {
|
71
|
+
token: Spree.api_key
|
72
|
+
}
|
70
73
|
}).done(function () {
|
71
74
|
window.location.reload();
|
72
75
|
}).error(function (msg) {
|
@@ -95,7 +98,8 @@ $(document).ready(function () {
|
|
95
98
|
shipment: {
|
96
99
|
selected_shipping_rate_id: selected_shipping_rate_id,
|
97
100
|
unlock: unlock
|
98
|
-
}
|
101
|
+
},
|
102
|
+
token: Spree.api_key
|
99
103
|
}
|
100
104
|
}).done(function () {
|
101
105
|
window.location.reload();
|
@@ -131,7 +135,8 @@ $(document).ready(function () {
|
|
131
135
|
data: {
|
132
136
|
shipment: {
|
133
137
|
tracking: tracking
|
134
|
-
}
|
138
|
+
},
|
139
|
+
token: Spree.api_key
|
135
140
|
}
|
136
141
|
}).done(function (data) {
|
137
142
|
link.parents('tbody').find('tr.edit-tracking').toggle();
|
@@ -163,7 +168,11 @@ adjustShipmentItems = function(shipment_number, variant_id, quantity){
|
|
163
168
|
$.ajax({
|
164
169
|
type: "PUT",
|
165
170
|
url: Spree.url(url),
|
166
|
-
data: {
|
171
|
+
data: {
|
172
|
+
variant_id: variant_id,
|
173
|
+
quantity: new_quantity,
|
174
|
+
token: Spree.api_key
|
175
|
+
}
|
167
176
|
}).done(function( msg ) {
|
168
177
|
window.location.reload();
|
169
178
|
});
|
@@ -207,7 +216,8 @@ startItemSplit = function(event){
|
|
207
216
|
data: {
|
208
217
|
q: {
|
209
218
|
"id_eq": variant_id
|
210
|
-
}
|
219
|
+
},
|
220
|
+
token: Spree.api_key
|
211
221
|
}
|
212
222
|
}).success(function( data ) {
|
213
223
|
variant = data['variants'][0];
|
@@ -260,7 +270,7 @@ completeItemSplit = function(event) {
|
|
260
270
|
type: "POST",
|
261
271
|
async: false,
|
262
272
|
url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
|
263
|
-
data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id }
|
273
|
+
data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id, token: Spree.api_key }
|
264
274
|
}).done(function(msg) {
|
265
275
|
advanceOrder();
|
266
276
|
});
|
@@ -269,7 +279,7 @@ completeItemSplit = function(event) {
|
|
269
279
|
type: "PUT",
|
270
280
|
async: false,
|
271
281
|
url: Spree.url(Spree.routes.shipments_api + "/" + target_shipment_number + "/add.json"),
|
272
|
-
data: { variant_id: variant_id, quantity: quantity }
|
282
|
+
data: { variant_id: variant_id, quantity: quantity, token: Spree.api_key }
|
273
283
|
}).done(function(msg) {
|
274
284
|
advanceOrder();
|
275
285
|
});
|
@@ -314,7 +324,12 @@ addVariantFromStockLocation = function(event) {
|
|
314
324
|
$.ajax({
|
315
325
|
type: "POST",
|
316
326
|
url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
|
317
|
-
data: {
|
327
|
+
data: {
|
328
|
+
variant_id: variant_id,
|
329
|
+
quantity: quantity,
|
330
|
+
stock_location_id: stock_location_id,
|
331
|
+
token: Spree.api_key
|
332
|
+
}
|
318
333
|
}).done(function( msg ) {
|
319
334
|
window.location.reload();
|
320
335
|
}).error(function( msg ) {
|
@@ -9,10 +9,11 @@ jQuery ->
|
|
9
9
|
variant_product_name_cont: term
|
10
10
|
per_page: 50
|
11
11
|
page: page
|
12
|
+
token: Spree.api_key
|
12
13
|
results: (data, page) ->
|
13
14
|
more = (page * 50) < data.count
|
14
15
|
return { results: data.stock_items, more: more }
|
15
16
|
formatResult: (stock_item) ->
|
16
17
|
variantTemplate({ variant: stock_item.variant })
|
17
18
|
formatSelection: (stock_item) ->
|
18
|
-
"#{stock_item.variant.name} (#{stock_item.variant.options_text})"
|
19
|
+
"#{stock_item.variant.name} (#{stock_item.variant.options_text})"
|
@@ -30,7 +30,7 @@ $ ->
|
|
30
30
|
|
31
31
|
$('#transfer_receive_stock').change (event) => @receive_stock_change(event)
|
32
32
|
|
33
|
-
$.getJSON Spree.url(Spree.routes.stock_locations_api), (data) =>
|
33
|
+
$.getJSON Spree.url(Spree.routes.stock_locations_api) + '?token=' + Spree.api_key, (data) =>
|
34
34
|
@locations = (location for location in data.stock_locations)
|
35
35
|
@force_receive_stock() if @locations.length < 2
|
36
36
|
|
@@ -107,6 +107,7 @@ $ ->
|
|
107
107
|
query_object = {}
|
108
108
|
query_object[query] = term
|
109
109
|
q: query_object
|
110
|
+
token: Spree.api_key
|
110
111
|
|
111
112
|
results: (data, page) ->
|
112
113
|
result = data["variants"] || data["stock_items"]
|
@@ -14,7 +14,12 @@ handle_move = (e, data) ->
|
|
14
14
|
type: "POST",
|
15
15
|
dataType: "json",
|
16
16
|
url: url.toString(),
|
17
|
-
data:
|
17
|
+
data: {
|
18
|
+
_method: "put",
|
19
|
+
"taxon[parent_id]": new_parent.prop("id"),
|
20
|
+
"taxon[child_index]": position,
|
21
|
+
token: Spree.api_key
|
22
|
+
},
|
18
23
|
error: handle_ajax_error
|
19
24
|
|
20
25
|
true
|
@@ -30,7 +35,12 @@ handle_create = (e, data) ->
|
|
30
35
|
type: "POST",
|
31
36
|
dataType: "json",
|
32
37
|
url: base_url.toString(),
|
33
|
-
data:
|
38
|
+
data: {
|
39
|
+
"taxon[name]": name,
|
40
|
+
"taxon[parent_id]": new_parent.prop("id"),
|
41
|
+
"taxon[child_index]": position,
|
42
|
+
token: Spree.api_key
|
43
|
+
},
|
34
44
|
error: handle_ajax_error,
|
35
45
|
success: (data,result) ->
|
36
46
|
node.prop('id', data.id)
|
@@ -47,7 +57,11 @@ handle_rename = (e, data) ->
|
|
47
57
|
type: "POST",
|
48
58
|
dataType: "json",
|
49
59
|
url: url.toString(),
|
50
|
-
data: {
|
60
|
+
data: {
|
61
|
+
_method: "put",
|
62
|
+
"taxon[name]": name,
|
63
|
+
token: Spree.api_key
|
64
|
+
},
|
51
65
|
error: handle_ajax_error
|
52
66
|
|
53
67
|
handle_delete = (e, data) ->
|
@@ -61,7 +75,10 @@ handle_delete = (e, data) ->
|
|
61
75
|
type: "POST",
|
62
76
|
dataType: "json",
|
63
77
|
url: delete_url.toString(),
|
64
|
-
data: {
|
78
|
+
data: {
|
79
|
+
_method: "delete",
|
80
|
+
token: Spree.api_key
|
81
|
+
},
|
65
82
|
error: handle_ajax_error
|
66
83
|
else
|
67
84
|
$.jstree.rollback(last_rollback)
|
@@ -75,6 +92,8 @@ root.setup_taxonomy_tree = (taxonomy_id) ->
|
|
75
92
|
|
76
93
|
$.ajax
|
77
94
|
url: Spree.url(base_url.path().replace("/taxons", "/jstree")).toString(),
|
95
|
+
data:
|
96
|
+
token: Spree.api_key
|
78
97
|
success: (taxonomy) ->
|
79
98
|
last_rollback = null
|
80
99
|
|
@@ -83,7 +102,7 @@ root.setup_taxonomy_tree = (taxonomy_id) ->
|
|
83
102
|
data: taxonomy,
|
84
103
|
ajax:
|
85
104
|
url: (e) ->
|
86
|
-
Spree.url(base_url.path() + '/' + e.prop('id') + '/jstree').toString()
|
105
|
+
Spree.url(base_url.path() + '/' + e.prop('id') + '/jstree' + '?token=' + Spree.api_key).toString()
|
87
106
|
themes:
|
88
107
|
theme: "apple",
|
89
108
|
url: Spree.url(Spree.routes.jstree_theme_path)
|
@@ -20,6 +20,7 @@ $(document).ready ->
|
|
20
20
|
data: (term, page) ->
|
21
21
|
per_page: 50,
|
22
22
|
page: page,
|
23
|
+
token: Spree.api_key,
|
23
24
|
q:
|
24
25
|
name_cont: term
|
25
26
|
results: (data, page) ->
|
@@ -36,7 +37,8 @@ $(document).ready ->
|
|
36
37
|
$.ajax
|
37
38
|
url: Spree.routes.taxon_products_api,
|
38
39
|
data:
|
39
|
-
id: e.val
|
40
|
+
id: e.val,
|
41
|
+
token: Spree.api_key
|
40
42
|
success: (data) ->
|
41
43
|
el.empty();
|
42
44
|
if data.products.length == 0
|
@@ -48,4 +50,3 @@ $(document).ready ->
|
|
48
50
|
product.image = product.master.images[0].small_url
|
49
51
|
el.append(productTemplate({ product: product }))
|
50
52
|
$('#sorting_explanation').show()
|
51
|
-
|
@@ -16,7 +16,8 @@ $.fn.userAutocomplete = function () {
|
|
16
16
|
datatype: 'json',
|
17
17
|
data: function (term) {
|
18
18
|
return {
|
19
|
-
q: term
|
19
|
+
q: term,
|
20
|
+
token: Spree.api_key
|
20
21
|
};
|
21
22
|
},
|
22
23
|
results: function (data) {
|
@@ -36,4 +37,4 @@ $.fn.userAutocomplete = function () {
|
|
36
37
|
|
37
38
|
$(document).ready(function () {
|
38
39
|
$('.user_picker').userAutocomplete();
|
39
|
-
});
|
40
|
+
});
|
@@ -22,6 +22,7 @@ $.fn.variantAutocomplete = ->
|
|
22
22
|
data: (term, page) ->
|
23
23
|
q:
|
24
24
|
product_name_or_sku_cont: term
|
25
|
+
token: Spree.api_key
|
25
26
|
|
26
27
|
results: (data, page) ->
|
27
28
|
window.variants = data["variants"]
|
@@ -32,4 +33,4 @@ $.fn.variantAutocomplete = ->
|
|
32
33
|
if !!variant.options_text
|
33
34
|
variant.name + " (#{variant.options_text})"
|
34
35
|
else
|
35
|
-
variant.name
|
36
|
+
variant.name
|
@@ -23,6 +23,7 @@
|
|
23
23
|
<%= javascript_tag do -%>
|
24
24
|
jQuery.alerts.dialogClass = 'spree';
|
25
25
|
<%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
|
26
|
-
|
26
|
+
<%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
|
27
|
+
<% end %>
|
27
28
|
|
28
29
|
<%= yield :head %>
|
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.3.
|
4
|
+
version: 2.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-03 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.3.
|
19
|
+
version: 2.3.8
|
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.3.
|
26
|
+
version: 2.3.8
|
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.3.
|
33
|
+
version: 2.3.8
|
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.3.
|
40
|
+
version: 2.3.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jquery-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|