spree_backend 3.6.6 → 3.7.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend.js +7 -7
  3. data/app/assets/javascripts/spree/backend/address_states.js +21 -21
  4. data/app/assets/javascripts/spree/backend/adjustments.js +25 -0
  5. data/app/assets/javascripts/spree/backend/admin.js +253 -244
  6. data/app/assets/javascripts/spree/backend/calculator.js +14 -13
  7. data/app/assets/javascripts/spree/backend/checkouts/edit.js +48 -52
  8. data/app/assets/javascripts/spree/backend/gateway.js +11 -10
  9. data/app/assets/javascripts/spree/backend/general_settings.js +18 -0
  10. data/app/assets/javascripts/spree/backend/handlebar_extensions.js +6 -6
  11. data/app/assets/javascripts/spree/backend/line_items.js +72 -0
  12. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +48 -47
  13. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +10 -10
  14. data/app/assets/javascripts/spree/backend/option_value_picker.js +13 -14
  15. data/app/assets/javascripts/spree/backend/orders/edit.js +3 -4
  16. data/app/assets/javascripts/spree/backend/payments/edit.js +230 -0
  17. data/app/assets/javascripts/spree/backend/payments/new.js +31 -31
  18. data/app/assets/javascripts/spree/backend/product_picker.js +15 -15
  19. data/app/assets/javascripts/spree/backend/progress.js +8 -0
  20. data/app/assets/javascripts/spree/backend/promotions.js +102 -107
  21. data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js +5 -0
  22. data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +32 -33
  23. data/app/assets/javascripts/spree/backend/shipments.js +246 -241
  24. data/app/assets/javascripts/spree/backend/spree-select2.js +3 -3
  25. data/app/assets/javascripts/spree/backend/states.js +8 -8
  26. data/app/assets/javascripts/spree/backend/stock_location.js +4 -3
  27. data/app/assets/javascripts/spree/backend/stock_management.js +13 -0
  28. data/app/assets/javascripts/spree/backend/stock_movement.js +35 -0
  29. data/app/assets/javascripts/spree/backend/stock_transfer.js +260 -0
  30. data/app/assets/javascripts/spree/backend/tag_picker.js +21 -21
  31. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +13 -13
  32. data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +8 -9
  33. data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +35 -0
  34. data/app/assets/javascripts/spree/backend/taxonomy.js +165 -0
  35. data/app/assets/javascripts/spree/backend/taxons.js +122 -0
  36. data/app/assets/javascripts/spree/backend/user_picker.js +11 -11
  37. data/app/assets/javascripts/spree/backend/users/edit.js +14 -15
  38. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +61 -0
  39. data/app/assets/javascripts/spree/backend/variant_management.js +14 -0
  40. data/app/assets/javascripts/spree/backend/zone.js +44 -0
  41. data/app/controllers/spree/admin/countries_controller.rb +3 -3
  42. data/app/controllers/spree/admin/customer_returns_controller.rb +1 -0
  43. data/app/controllers/spree/admin/general_settings_controller.rb +1 -0
  44. data/app/controllers/spree/admin/orders_controller.rb +4 -4
  45. data/app/controllers/spree/admin/payment_methods_controller.rb +1 -0
  46. data/app/controllers/spree/admin/payments_controller.rb +3 -2
  47. data/app/controllers/spree/admin/products_controller.rb +3 -1
  48. data/app/controllers/spree/admin/promotions_controller.rb +1 -0
  49. data/app/controllers/spree/admin/properties_controller.rb +1 -0
  50. data/app/controllers/spree/admin/reports_controller.rb +4 -4
  51. data/app/controllers/spree/admin/resource_controller.rb +3 -1
  52. data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
  53. data/app/controllers/spree/admin/return_index_controller.rb +1 -0
  54. data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -0
  55. data/app/controllers/spree/admin/store_credits_controller.rb +1 -2
  56. data/app/controllers/spree/admin/users_controller.rb +3 -1
  57. data/app/helpers/spree/admin/base_helper.rb +8 -5
  58. data/app/helpers/spree/admin/{general_settings_helper.rb → currency_helper.rb} +4 -3
  59. data/app/helpers/spree/admin/navigation_helper.rb +0 -8
  60. data/app/helpers/spree/admin/orders_helper.rb +2 -1
  61. data/app/models/spree/admin/resource.rb +1 -0
  62. data/app/views/spree/admin/orders/_line_items.html.erb +3 -1
  63. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +3 -1
  64. data/app/views/spree/admin/orders/index.html.erb +15 -8
  65. data/app/views/spree/admin/products/index.html.erb +2 -2
  66. data/app/views/spree/admin/promotions/index.html.erb +4 -4
  67. data/app/views/spree/admin/properties/index.html.erb +2 -2
  68. data/app/views/spree/admin/return_index/customer_returns.html.erb +1 -1
  69. data/app/views/spree/admin/return_index/return_authorizations.html.erb +2 -2
  70. data/app/views/spree/admin/shared/_order_summary.html.erb +6 -0
  71. data/app/views/spree/admin/store_credits/_form.html.erb +15 -6
  72. data/app/views/spree/admin/store_credits/edit.html.erb +1 -1
  73. data/app/views/spree/admin/store_credits/new.html.erb +1 -1
  74. data/app/views/spree/admin/users/_addresses_form.html.erb +1 -1
  75. data/app/views/spree/admin/users/index.html.erb +8 -8
  76. data/app/views/spree/admin/users/items.html.erb +3 -1
  77. data/app/views/spree/admin/variants/index.html.erb +2 -2
  78. data/lib/generators/spree/backend/copy_views/copy_views_generator.rb +1 -1
  79. data/lib/spree/backend/callbacks.rb +1 -0
  80. data/spree_backend.gemspec +2 -2
  81. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +4358 -4358
  82. data/vendor/assets/javascripts/js.cookie.js +165 -0
  83. metadata +28 -28
  84. data/app/assets/javascripts/spree/backend/adjustments.js.coffee +0 -17
  85. data/app/assets/javascripts/spree/backend/general_settings.js.coffee +0 -15
  86. data/app/assets/javascripts/spree/backend/line_items.js.coffee +0 -64
  87. data/app/assets/javascripts/spree/backend/payments/edit.js.coffee +0 -145
  88. data/app/assets/javascripts/spree/backend/progress.js.coffee +0 -6
  89. data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.coffee +0 -4
  90. data/app/assets/javascripts/spree/backend/stock_management.js.coffee +0 -9
  91. data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +0 -19
  92. data/app/assets/javascripts/spree/backend/stock_transfer.js.coffee +0 -201
  93. data/app/assets/javascripts/spree/backend/taxon_tree_menu.js.coffee +0 -22
  94. data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +0 -153
  95. data/app/assets/javascripts/spree/backend/taxons.js.coffee +0 -82
  96. data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee +0 -38
  97. data/app/assets/javascripts/spree/backend/variant_management.js.coffee +0 -10
  98. data/app/assets/javascripts/spree/backend/zone.js.coffee +0 -43
  99. data/vendor/assets/javascripts/jquery.cookie.js +0 -117
@@ -1,38 +0,0 @@
1
- # variant autocompletion
2
- $(document).ready ->
3
- if $("#variant_autocomplete_template").length > 0
4
- window.variantTemplate = Handlebars.compile($("#variant_autocomplete_template").text())
5
- window.variantStockTemplate = Handlebars.compile($("#variant_autocomplete_stock_template").text())
6
- window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
7
- return
8
-
9
- formatVariantResult = (variant) ->
10
- variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
11
- variantTemplate variant: variant
12
-
13
- $.fn.variantAutocomplete = ->
14
- @select2
15
- placeholder: Spree.translations.variant_placeholder
16
- minimumInputLength: 3
17
- initSelection: (element, callback) ->
18
- $.get Spree.routes.variants_api + "/" + element.val(), { token: Spree.api_key }, (data) ->
19
- callback data
20
- ajax:
21
- url: Spree.url(Spree.routes.variants_api)
22
- quietMillis: 200
23
- datatype: "json"
24
- data: (term, page) ->
25
- q:
26
- product_name_or_sku_cont: term
27
- token: Spree.api_key
28
-
29
- results: (data, page) ->
30
- window.variants = data["variants"]
31
- results: data["variants"]
32
-
33
- formatResult: formatVariantResult
34
- formatSelection: (variant, container, escapeMarkup) ->
35
- if !!variant.options_text
36
- Select2.util.escapeMarkup("#{variant.name} (#{variant.options_text})")
37
- else
38
- Select2.util.escapeMarkup(variant.name)
@@ -1,10 +0,0 @@
1
- jQuery ->
2
- $('.track_inventory_checkbox').on 'click', ->
3
- $(this).siblings('.variant_track_inventory').val($(this).is(':checked'))
4
- $(this).parents('form').submit()
5
- $('.toggle_variant_track_inventory').on 'submit', ->
6
- $.ajax
7
- type: @method
8
- url: @action
9
- data: $(this).serialize()
10
- false
@@ -1,43 +0,0 @@
1
- $ ->
2
- ($ '#country_based').click ->
3
- show_country()
4
-
5
- ($ '#state_based').click ->
6
- show_state()
7
-
8
- if ($ '#country_based').is(':checked')
9
- show_country()
10
- else if ($ '#state_based').is(':checked')
11
- show_state()
12
- else
13
- show_state()
14
- ($ '#state_based').click()
15
-
16
-
17
- show_country = ->
18
- ($ '#state_members :input').each ->
19
- ($ this).prop 'disabled', true
20
-
21
- ($ '#state_members').hide()
22
- ($ '#zone_members :input').each ->
23
- ($ this).prop 'disabled', true
24
-
25
- ($ '#zone_members').hide()
26
- ($ '#country_members :input').each ->
27
- ($ this).prop 'disabled', false
28
-
29
- ($ '#country_members').show()
30
-
31
- show_state = ->
32
- ($ '#country_members :input').each ->
33
- ($ this).prop 'disabled', true
34
-
35
- ($ '#country_members').hide()
36
- ($ '#zone_members :input').each ->
37
- ($ this).prop 'disabled', true
38
-
39
- ($ '#zone_members').hide()
40
- ($ '#state_members :input').each ->
41
- ($ this).prop 'disabled', false
42
-
43
- ($ '#state_members').show()
@@ -1,117 +0,0 @@
1
- /*!
2
- * jQuery Cookie Plugin v1.4.1
3
- * https://github.com/carhartl/jquery-cookie
4
- *
5
- * Copyright 2006, 2014 Klaus Hartl
6
- * Released under the MIT license
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD
11
- define(['jquery'], factory);
12
- } else if (typeof exports === 'object') {
13
- // CommonJS
14
- factory(require('jquery'));
15
- } else {
16
- // Browser globals
17
- factory(jQuery);
18
- }
19
- }(function ($) {
20
-
21
- var pluses = /\+/g;
22
-
23
- function encode(s) {
24
- return config.raw ? s : encodeURIComponent(s);
25
- }
26
-
27
- function decode(s) {
28
- return config.raw ? s : decodeURIComponent(s);
29
- }
30
-
31
- function stringifyCookieValue(value) {
32
- return encode(config.json ? JSON.stringify(value) : String(value));
33
- }
34
-
35
- function parseCookieValue(s) {
36
- if (s.indexOf('"') === 0) {
37
- // This is a quoted cookie as according to RFC2068, unescape...
38
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
- }
40
-
41
- try {
42
- // Replace server-side written pluses with spaces.
43
- // If we can't decode the cookie, ignore it, it's unusable.
44
- // If we can't parse the cookie, ignore it, it's unusable.
45
- s = decodeURIComponent(s.replace(pluses, ' '));
46
- return config.json ? JSON.parse(s) : s;
47
- } catch(e) {}
48
- }
49
-
50
- function read(s, converter) {
51
- var value = config.raw ? s : parseCookieValue(s);
52
- return $.isFunction(converter) ? converter(value) : value;
53
- }
54
-
55
- var config = $.cookie = function (key, value, options) {
56
-
57
- // Write
58
-
59
- if (arguments.length > 1 && !$.isFunction(value)) {
60
- options = $.extend({}, config.defaults, options);
61
-
62
- if (typeof options.expires === 'number') {
63
- var days = options.expires, t = options.expires = new Date();
64
- t.setTime(+t + days * 864e+5);
65
- }
66
-
67
- return (document.cookie = [
68
- encode(key), '=', stringifyCookieValue(value),
69
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
- options.path ? '; path=' + options.path : '',
71
- options.domain ? '; domain=' + options.domain : '',
72
- options.secure ? '; secure' : ''
73
- ].join(''));
74
- }
75
-
76
- // Read
77
-
78
- var result = key ? undefined : {};
79
-
80
- // To prevent the for loop in the first place assign an empty array
81
- // in case there are no cookies at all. Also prevents odd result when
82
- // calling $.cookie().
83
- var cookies = document.cookie ? document.cookie.split('; ') : [];
84
-
85
- for (var i = 0, l = cookies.length; i < l; i++) {
86
- var parts = cookies[i].split('=');
87
- var name = decode(parts.shift());
88
- var cookie = parts.join('=');
89
-
90
- if (key && key === name) {
91
- // If second argument (value) is a function it's a converter...
92
- result = read(cookie, value);
93
- break;
94
- }
95
-
96
- // Prevent storing a cookie that we couldn't decode.
97
- if (!key && (cookie = read(cookie)) !== undefined) {
98
- result[name] = cookie;
99
- }
100
- }
101
-
102
- return result;
103
- };
104
-
105
- config.defaults = {};
106
-
107
- $.removeCookie = function (key, options) {
108
- if ($.cookie(key) === undefined) {
109
- return false;
110
- }
111
-
112
- // Must not alter options, thus extending a fresh object...
113
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
- return !$.cookie(key);
115
- };
116
-
117
- }));