spree_backend 3.0.0.rc3 → 3.0.0.rc4
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 +4 -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 +1 -0
- data/app/views/spree/admin/stock_transfers/index.html.erb +1 -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: c830b0a478d89e82b4dcf34c843707d5d974fd26
|
4
|
+
data.tar.gz: cbee1596932e60b0916c42810631bb22bf768f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcc6c7c2b33851b52ec086e45389f8c9f1a374b605270704311b072cb79640f1d79740f13779eafa3df6a008fa53f4c5e2966b8c0a5a9926b99297ca57cebee6
|
7
|
+
data.tar.gz: a21a2a1aee9751be825199134d671e43f21c870e1e33c7a7dc4eeab2bd6d7934878342a3641dfcbff389614db86ffedef57c8092c1f4eb956e1659a7943d5aad
|
@@ -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
|
+
)
|
@@ -362,6 +362,9 @@ $(document).ready(function(){
|
|
362
362
|
$.ajax({
|
363
363
|
type: "PUT",
|
364
364
|
async: false,
|
365
|
+
data: {
|
366
|
+
token: Spree.api_key
|
367
|
+
},
|
365
368
|
url: Spree.url(Spree.routes.checkouts_api + "/" + order_number + "/advance")
|
366
369
|
}).done(function() {
|
367
370
|
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()
|
@@ -32,7 +32,13 @@ adjustLineItems = function(order_number, variant_id, quantity){
|
|
32
32
|
$.ajax({
|
33
33
|
type: "POST",
|
34
34
|
url: Spree.url(url),
|
35
|
-
data: {
|
35
|
+
data: {
|
36
|
+
line_item: {
|
37
|
+
variant_id: variant_id,
|
38
|
+
quantity: quantity
|
39
|
+
},
|
40
|
+
token: Spree.api_key
|
41
|
+
}
|
36
42
|
}).done(function( msg ) {
|
37
43
|
window.Spree.advanceOrder();
|
38
44
|
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
|
+
});
|
@@ -57,7 +57,10 @@ $(document).ready(function () {
|
|
57
57
|
var url = Spree.url(Spree.routes.shipments_api + '/' + shipment_number + '/ship.json');
|
58
58
|
$.ajax({
|
59
59
|
type: 'PUT',
|
60
|
-
url: url
|
60
|
+
url: url,
|
61
|
+
data: {
|
62
|
+
token: Spree.api_key
|
63
|
+
}
|
61
64
|
}).done(function () {
|
62
65
|
window.location.reload();
|
63
66
|
}).error(function (msg) {
|
@@ -86,7 +89,8 @@ $(document).ready(function () {
|
|
86
89
|
shipment: {
|
87
90
|
selected_shipping_rate_id: selected_shipping_rate_id,
|
88
91
|
unlock: unlock
|
89
|
-
}
|
92
|
+
},
|
93
|
+
token: Spree.api_key
|
90
94
|
}
|
91
95
|
}).done(function () {
|
92
96
|
window.location.reload();
|
@@ -122,7 +126,8 @@ $(document).ready(function () {
|
|
122
126
|
data: {
|
123
127
|
shipment: {
|
124
128
|
tracking: tracking
|
125
|
-
}
|
129
|
+
},
|
130
|
+
token: Spree.api_key
|
126
131
|
}
|
127
132
|
}).done(function (data) {
|
128
133
|
link.parents('tbody').find('tr.edit-tracking').toggle();
|
@@ -154,7 +159,11 @@ adjustShipmentItems = function(shipment_number, variant_id, quantity){
|
|
154
159
|
$.ajax({
|
155
160
|
type: "PUT",
|
156
161
|
url: Spree.url(url),
|
157
|
-
data: {
|
162
|
+
data: {
|
163
|
+
variant_id: variant_id,
|
164
|
+
quantity: new_quantity,
|
165
|
+
token: Spree.api_key
|
166
|
+
}
|
158
167
|
}).done(function( msg ) {
|
159
168
|
window.location.reload();
|
160
169
|
}).fail(function(msg) {
|
@@ -200,7 +209,8 @@ startItemSplit = function(event){
|
|
200
209
|
data: {
|
201
210
|
q: {
|
202
211
|
"id_eq": variant_id
|
203
|
-
}
|
212
|
+
},
|
213
|
+
token: Spree.api_key
|
204
214
|
}
|
205
215
|
}).success(function( data ) {
|
206
216
|
variant = data['variants'][0];
|
@@ -248,7 +258,8 @@ completeItemSplit = function(event) {
|
|
248
258
|
original_shipment_number: original_shipment_number,
|
249
259
|
variant_id: variant_id,
|
250
260
|
quantity: quantity,
|
251
|
-
stock_location_id: stock_location_id
|
261
|
+
stock_location_id: stock_location_id,
|
262
|
+
token: Spree.api_key
|
252
263
|
}
|
253
264
|
}).error(function(msg) {
|
254
265
|
alert(msg.responseJSON['message']);
|
@@ -265,7 +276,8 @@ completeItemSplit = function(event) {
|
|
265
276
|
original_shipment_number: original_shipment_number,
|
266
277
|
target_shipment_number: target_shipment_number,
|
267
278
|
variant_id: variant_id,
|
268
|
-
quantity: quantity
|
279
|
+
quantity: quantity,
|
280
|
+
token: Spree.api_key
|
269
281
|
}
|
270
282
|
}).error(function(msg) {
|
271
283
|
alert(msg.responseJSON['message']);
|
@@ -303,7 +315,12 @@ addVariantFromStockLocation = function(event) {
|
|
303
315
|
$.ajax({
|
304
316
|
type: "POST",
|
305
317
|
url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
|
306
|
-
data: {
|
318
|
+
data: {
|
319
|
+
variant_id: variant_id,
|
320
|
+
quantity: quantity,
|
321
|
+
stock_location_id: stock_location_id,
|
322
|
+
token: Spree.api_key
|
323
|
+
}
|
307
324
|
}).done(function( msg ) {
|
308
325
|
window.location.reload();
|
309
326
|
}).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
|
|
@@ -109,6 +109,7 @@ $ ->
|
|
109
109
|
query_object = {}
|
110
110
|
query_object[query] = term
|
111
111
|
q: query_object
|
112
|
+
token: Spree.api_key
|
112
113
|
|
113
114
|
results: (data, page) ->
|
114
115
|
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)
|
@@ -23,6 +23,7 @@ $(document).ready ->
|
|
23
23
|
data: (term, page) ->
|
24
24
|
per_page: 50,
|
25
25
|
page: page,
|
26
|
+
token: Spree.api_key,
|
26
27
|
q:
|
27
28
|
name_cont: term
|
28
29
|
results: (data, page) ->
|
@@ -39,7 +40,8 @@ $(document).ready ->
|
|
39
40
|
$.ajax
|
40
41
|
url: Spree.routes.taxon_products_api,
|
41
42
|
data:
|
42
|
-
id: e.val
|
43
|
+
id: e.val,
|
44
|
+
token: Spree.api_key
|
43
45
|
success: (data) ->
|
44
46
|
el.empty();
|
45
47
|
if data.products.length == 0
|
@@ -58,7 +60,7 @@ $(document).ready ->
|
|
58
60
|
product_index = product_taxons.indexOf(parseFloat(current_taxon_id));
|
59
61
|
product_taxons.splice(product_index, 1);
|
60
62
|
$.ajax
|
61
|
-
url: Spree.routes.products_api + "/" + product_id + "?product[taxon_ids]=" + product_taxons,
|
63
|
+
url: Spree.routes.products_api + "/" + product_id + "?product[taxon_ids]=" + product_taxons + '&token=' + Spree.api_key,
|
62
64
|
type: "PUT",
|
63
65
|
success: (data) ->
|
64
66
|
product.fadeOut 400, (e) ->
|
@@ -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
|
@@ -75,7 +75,7 @@
|
|
75
75
|
<% else %>
|
76
76
|
<div class="alert alert-info no-objects-found">
|
77
77
|
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StockTransfer)) %>,
|
78
|
-
<%= link_to(Spree.t(:add_one),
|
78
|
+
<%= link_to(Spree.t(:add_one), new_admin_stock_transfer_path) if can? :create, Spree::StockTransfer %>!
|
79
79
|
</div>
|
80
80
|
<% end %>
|
81
81
|
|
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: 3.0.0.
|
4
|
+
version: 3.0.0.rc4
|
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: 3.0.0.
|
19
|
+
version: 3.0.0.rc4
|
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: 3.0.0.
|
26
|
+
version: 3.0.0.rc4
|
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: 3.0.0.
|
33
|
+
version: 3.0.0.rc4
|
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: 3.0.0.
|
40
|
+
version: 3.0.0.rc4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bootstrap-sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|