spree_backend 2.4.4 → 2.4.5
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/admin.js.erb +3 -0
- 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/line_items_on_order_edit.js.erb +7 -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 +25 -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: d105c88339af651b3d6dab5380d768a8904ca8fd
|
4
|
+
data.tar.gz: c382e1e7ef8e6ad235562ad3d5904d22a06a0b21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc8380f690b551b42d9117ea79cfb06e21fce015c059f398554a2438b3e6cfc4a88c82ae776dbf263cb7a5db1de3a0d497fad104c33dba245b2e5a00df1846e3
|
7
|
+
data.tar.gz: ccd896e04c903ac8b252d74b9e9488b306fcb3944e187c1e9eb0254bf1241a51b53f15d8e7216b523d2f26d01db746e694f02aa4dbc108668bfa85cc28717b9b
|
@@ -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
|
+
)
|
@@ -276,6 +276,9 @@ $(document).ready(function(){
|
|
276
276
|
$.ajax({
|
277
277
|
type: "PUT",
|
278
278
|
async: false,
|
279
|
+
data: {
|
280
|
+
token: Spree.api_key
|
281
|
+
},
|
279
282
|
url: Spree.url(Spree.routes.checkouts_api + "/" + order_number + "/advance")
|
280
283
|
}).done(function() {
|
281
284
|
window.location.reload();
|
@@ -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
|
window.Spree.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
|
-
window.Spree.advanceOrder()
|
64
|
+
window.Spree.advanceOrder()
|
@@ -41,7 +41,13 @@ adjustLineItems = function(order_number, variant_id, quantity){
|
|
41
41
|
$.ajax({
|
42
42
|
type: "POST",
|
43
43
|
url: Spree.url(url),
|
44
|
-
data: {
|
44
|
+
data: {
|
45
|
+
line_item: {
|
46
|
+
variant_id: variant_id,
|
47
|
+
quantity: quantity
|
48
|
+
},
|
49
|
+
token: Spree.api_key
|
50
|
+
}
|
45
51
|
}).done(function( msg ) {
|
46
52
|
window.Spree.advanceOrder();
|
47
53
|
window.location.reload();
|
@@ -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];
|
@@ -262,7 +272,8 @@ completeItemSplit = function(event) {
|
|
262
272
|
original_shipment_number: original_shipment_number,
|
263
273
|
variant_id: variant_id,
|
264
274
|
quantity: quantity,
|
265
|
-
stock_location_id: stock_location_id
|
275
|
+
stock_location_id: stock_location_id,
|
276
|
+
token: Spree.api_key
|
266
277
|
}
|
267
278
|
}).error(function(msg) {
|
268
279
|
alert(msg.responseJSON['message']);
|
@@ -279,7 +290,8 @@ completeItemSplit = function(event) {
|
|
279
290
|
original_shipment_number: original_shipment_number,
|
280
291
|
target_shipment_number: target_shipment_number,
|
281
292
|
variant_id: variant_id,
|
282
|
-
quantity: quantity
|
293
|
+
quantity: quantity,
|
294
|
+
token: Spree.api_key
|
283
295
|
}
|
284
296
|
}).error(function(msg) {
|
285
297
|
alert(msg.responseJSON['message']);
|
@@ -317,7 +329,12 @@ addVariantFromStockLocation = function(event) {
|
|
317
329
|
$.ajax({
|
318
330
|
type: "POST",
|
319
331
|
url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
|
320
|
-
data: {
|
332
|
+
data: {
|
333
|
+
variant_id: variant_id,
|
334
|
+
quantity: quantity,
|
335
|
+
stock_location_id: stock_location_id,
|
336
|
+
token: Spree.api_key
|
337
|
+
}
|
321
338
|
}).done(function( msg ) {
|
322
339
|
window.location.reload();
|
323
340
|
}).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
|
+
});
|
@@ -23,6 +23,7 @@ $.fn.variantAutocomplete = ->
|
|
23
23
|
data: (term, page) ->
|
24
24
|
q:
|
25
25
|
product_name_or_sku_cont: term
|
26
|
+
token: Spree.api_key
|
26
27
|
|
27
28
|
results: (data, page) ->
|
28
29
|
window.variants = data["variants"]
|
@@ -33,4 +34,4 @@ $.fn.variantAutocomplete = ->
|
|
33
34
|
if !!variant.options_text
|
34
35
|
variant.name + " (#{variant.options_text})"
|
35
36
|
else
|
36
|
-
variant.name
|
37
|
+
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.4.
|
4
|
+
version: 2.4.5
|
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.4.
|
19
|
+
version: 2.4.5
|
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.5
|
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.5
|
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.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jquery-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|