spree_backend 2.2.9 → 2.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bcb1884615353d33f853200f421a091c56a2f8b
4
- data.tar.gz: 9695ba8467c411876e9984d6dc397ec2d49eb92d
3
+ metadata.gz: 89ce981f657e0415a271dc5ef18755d1d75f5c77
4
+ data.tar.gz: d6813759c824ffd1127110640fedbc14a886921d
5
5
  SHA512:
6
- metadata.gz: bea6745864a1a7ba1188c41ad54e112f86fff11df404129e339707da428613b3118908102bd52bb24d05fd19ee8ae867f2d106588a2dadb259810ef34124d600
7
- data.tar.gz: a718c52841cd6b993ccdf6a9e2a101b7aa0a507389950b3fcf66ee410433cbff548bb7972b671d17689218c4fcbdf8f5dbad3827eeb4feb43605f70cabfa058f
6
+ metadata.gz: 4c3f893ba97421aca33802742448ca5fa799a3c0979d003516163a0153368114dd85e5211db3fbeba490fdf7fc16e2ac7e89f3eb0b2a10d014f2d290d8ca9d8e
7
+ data.tar.gz: fadd70d7c5cf9d0f9a916cd8c15be924b369950a5b6efca8c76ff9e34b0ddae635fe8b499d95a4b0e412a9298a98d0c12cad839e93ad8e1d6b0f5326ba52c3a3
@@ -6,6 +6,7 @@ $(@).ready( ->
6
6
  url: Spree.url(Spree.routes.orders_api + '/' + order_number + '/apply_coupon_code.json');
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 { q: term }
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
+ });
@@ -65,7 +65,10 @@ $(document).ready(function () {
65
65
  var url = Spree.url(Spree.routes.shipments_api + '/' + shipment_number + '/ship.json');
66
66
  $.ajax({
67
67
  type: 'PUT',
68
- url: url
68
+ url: url,
69
+ data: {
70
+ token: Spree.api_key
71
+ }
69
72
  }).done(function () {
70
73
  window.location.reload();
71
74
  }).error(function (msg) {
@@ -92,7 +95,8 @@ $(document).ready(function () {
92
95
  shipment: {
93
96
  selected_shipping_rate_id: selected_shipping_rate_id,
94
97
  unlock: unlock
95
- }
98
+ },
99
+ token: Spree.api_key
96
100
  }
97
101
  }).done(function () {
98
102
  window.location.reload();
@@ -118,7 +122,8 @@ $(document).ready(function () {
118
122
  data: {
119
123
  shipment: {
120
124
  tracking: tracking
121
- }
125
+ },
126
+ token: Spree.api_key
122
127
  }
123
128
  }).done(function () {
124
129
  window.location.reload();
@@ -149,7 +154,11 @@ adjustShipmentItems = function(shipment_number, variant_id, quantity){
149
154
  $.ajax({
150
155
  type: "PUT",
151
156
  url: Spree.url(url),
152
- data: { variant_id: variant_id, quantity: new_quantity }
157
+ data: {
158
+ variant_id: variant_id,
159
+ quantity: new_quantity,
160
+ token: Spree.api_key
161
+ }
153
162
  }).done(function( msg ) {
154
163
  window.location.reload();
155
164
  });
@@ -197,7 +206,8 @@ startItemSplit = function(event){
197
206
  data: {
198
207
  q: {
199
208
  "id_eq": variant_id
200
- }
209
+ },
210
+ token: Spree.api_key
201
211
  }
202
212
  }).success(function( data ) {
203
213
  variant = data['variants'][0];
@@ -250,7 +260,7 @@ completeItemSplit = function(event) {
250
260
  type: "POST",
251
261
  async: false,
252
262
  url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
253
- data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id }
263
+ data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id, token: Spree.api_key }
254
264
  }).done(function(msg) {
255
265
  advanceOrder();
256
266
  });
@@ -259,7 +269,7 @@ completeItemSplit = function(event) {
259
269
  type: "PUT",
260
270
  async: false,
261
271
  url: Spree.url(Spree.routes.shipments_api + "/" + target_shipment_number + "/add.json"),
262
- data: { variant_id: variant_id, quantity: quantity }
272
+ data: { variant_id: variant_id, quantity: quantity, token: Spree.api_key }
263
273
  }).done(function(msg) {
264
274
  advanceOrder();
265
275
  });
@@ -302,7 +312,12 @@ addVariantFromStockLocation = function() {
302
312
  $.ajax({
303
313
  type: "POST",
304
314
  url: Spree.url(Spree.routes.shipments_api + "?shipment[order_id]=" + order_number),
305
- data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id }
315
+ data: {
316
+ variant_id: variant_id,
317
+ quantity: quantity,
318
+ stock_location_id: stock_location_id,
319
+ token: Spree.api_key
320
+ }
306
321
  }).done(function( msg ) {
307
322
  window.location.reload();
308
323
  }).error(function( msg ) {
@@ -8,10 +8,11 @@ jQuery ->
8
8
  variant_product_name_cont: term
9
9
  per_page: 50
10
10
  page: page
11
+ token: Spree.api_key
11
12
  results: (data, page) ->
12
13
  more = (page * 50) < data.count
13
14
  return { results: data.stock_items, more: more }
14
15
  formatResult: (stock_item) ->
15
16
  variantTemplate({ variant: stock_item.variant })
16
17
  formatSelection: (stock_item) ->
17
- "#{stock_item.variant.name} (#{stock_item.variant.options_text})"
18
+ "#{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: ({_method: "put", "taxon[parent_id]": new_parent.prop("id"), "taxon[child_index]": position }),
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: ({"taxon[name]": name, "taxon[parent_id]": new_parent.prop("id"), "taxon[child_index]": position }),
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: {_method: "put", "taxon[name]": name },
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: {_method: "delete"},
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,7 +23,7 @@
23
23
  <td class="item-total align-center"><%= line_item_shipment_price(item.line_item, item.quantity) %></td>
24
24
  <% unless shipment.shipped? %>
25
25
  <td class="cart-item-delete actions" data-hook="cart_item_delete">
26
- <% if can? :update, item %>
26
+ <% if can?(:update, item.line_item) %>
27
27
  <%= link_to '', '#', :class => 'save-item fa fa-check no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
28
28
  <%= link_to '', '#', :class => 'cancel-item fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
29
29
  <%= link_to '', '#', :class => 'edit-item fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
@@ -1,6 +1,6 @@
1
1
  <% success = flash.discard(:success)
2
2
  if success %>
3
- show_flash('success', "<%= success %>")
3
+ show_flash('success', "<%= j success %>")
4
4
  <% end %>
5
5
 
6
6
  <%= render :partial => '/spree/admin/shared/update_order_state' if @order %>
@@ -24,6 +24,7 @@
24
24
  <%= javascript_tag do -%>
25
25
  jQuery.alerts.dialogClass = 'spree';
26
26
  <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
27
- <% end -%>
27
+ <%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
28
+ <% end %>
28
29
 
29
30
  <%= 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.2.9
4
+ version: 2.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
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.2.9
19
+ version: 2.2.10
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.2.9
26
+ version: 2.2.10
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.2.9
33
+ version: 2.2.10
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.2.9
40
+ version: 2.2.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: jquery-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -528,7 +528,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
528
528
  requirements:
529
529
  - none
530
530
  rubyforge_project: spree_backend
531
- rubygems_version: 2.2.2
531
+ rubygems_version: 2.4.5
532
532
  signing_key:
533
533
  specification_version: 4
534
534
  summary: backend e-commerce functionality for the Spree project.