solidus_backend 2.2.2 → 2.3.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend.js +1 -2
  3. data/app/assets/javascripts/spree/backend/address_states.js +1 -1
  4. data/app/assets/javascripts/spree/backend/adjustments.js.coffee +1 -1
  5. data/app/assets/javascripts/spree/backend/admin.js +37 -41
  6. data/app/assets/javascripts/spree/backend/components/editable_table.js.coffee +3 -0
  7. data/app/assets/javascripts/spree/backend/images/index.js.coffee +1 -1
  8. data/app/assets/javascripts/spree/backend/images/upload.js +13 -189
  9. data/app/assets/javascripts/spree/backend/models/image_upload.js +76 -0
  10. data/app/assets/javascripts/spree/backend/models/index.js +2 -0
  11. data/app/assets/javascripts/spree/backend/models/taxonomy.js +3 -0
  12. data/app/assets/javascripts/spree/backend/namespaces.js +3 -1
  13. data/app/assets/javascripts/spree/backend/payments/new.js +8 -36
  14. data/app/assets/javascripts/spree/backend/promotions.js.coffee +1 -1
  15. data/app/assets/javascripts/spree/backend/select_payments.js.coffee +0 -12
  16. data/app/assets/javascripts/spree/backend/shipments.js +1 -1
  17. data/app/assets/javascripts/spree/backend/spree-select2.js +1 -1
  18. data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +101 -95
  19. data/app/assets/javascripts/spree/backend/templates/products/upload_progress.hbs +5 -3
  20. data/app/assets/javascripts/spree/backend/views/images/upload_progress.js +48 -0
  21. data/app/assets/javascripts/spree/backend/views/images/upload_zone.js +39 -0
  22. data/app/assets/javascripts/spree/backend/views/index.js +6 -0
  23. data/app/assets/javascripts/spree/backend/views/order/address.js +1 -5
  24. data/app/assets/javascripts/spree/backend/views/payment/edit_credit_card.js +23 -0
  25. data/app/assets/javascripts/spree/backend/views/payment/new.js +25 -0
  26. data/app/assets/javascripts/spree/backend/views/state_select.js +4 -4
  27. data/app/assets/javascripts/spree/backend/views/tables/editable_table.js.coffee +14 -0
  28. data/app/assets/javascripts/spree/backend/views/tables/editable_table_row.js.coffee +45 -0
  29. data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
  30. data/app/assets/stylesheets/spree/backend/components/_editable_table.scss +37 -0
  31. data/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss +2 -2
  32. data/app/assets/stylesheets/spree/backend/sections/_products.scss +0 -8
  33. data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +15 -9
  34. data/app/assets/stylesheets/spree/backend/shared/_icons.scss +14 -14
  35. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -2
  36. data/app/assets/stylesheets/spree/backend/shared/_utilities.scss +13 -0
  37. data/app/assets/stylesheets/spree/backend/spree_admin.scss +1 -1
  38. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  39. data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
  40. data/app/controllers/spree/admin/orders_controller.rb +3 -10
  41. data/app/controllers/spree/admin/payment_methods_controller.rb +19 -6
  42. data/app/controllers/spree/admin/payments_controller.rb +2 -2
  43. data/app/controllers/spree/admin/products_controller.rb +3 -9
  44. data/app/controllers/spree/admin/promotion_rules_controller.rb +5 -1
  45. data/app/controllers/spree/admin/promotions_controller.rb +1 -1
  46. data/app/controllers/spree/admin/properties_controller.rb +1 -1
  47. data/app/controllers/spree/admin/reports_controller.rb +24 -21
  48. data/app/controllers/spree/admin/resource_controller.rb +25 -14
  49. data/app/controllers/spree/admin/style_guide_controller.rb +4 -0
  50. data/app/controllers/spree/admin/users_controller.rb +1 -1
  51. data/app/controllers/spree/admin/variants_controller.rb +5 -0
  52. data/app/helpers/spree/admin/navigation_helper.rb +6 -2
  53. data/app/helpers/spree/promotion_rules_helper.rb +2 -2
  54. data/app/models/spree/backend_configuration.rb +1 -0
  55. data/app/views/spree/admin/adjustments/_form.html.erb +1 -1
  56. data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +2 -2
  57. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  58. data/app/views/spree/admin/images/_form.html.erb +1 -1
  59. data/app/views/spree/admin/images/_image_row.html.erb +22 -4
  60. data/app/views/spree/admin/images/create.js.erb +8 -5
  61. data/app/views/spree/admin/images/index.html.erb +4 -8
  62. data/app/views/spree/admin/orders/_risk_analysis.html.erb +6 -7
  63. data/app/views/spree/admin/orders/_shipment.html.erb +1 -1
  64. data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +1 -1
  65. data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
  66. data/app/views/spree/admin/orders/index.html.erb +3 -3
  67. data/app/views/spree/admin/payment_methods/_form.html.erb +5 -5
  68. data/app/views/spree/admin/payments/_form.html.erb +2 -2
  69. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  70. data/app/views/spree/admin/payments/show.html.erb +1 -1
  71. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +2 -7
  72. data/app/views/spree/admin/prices/_form.html.erb +2 -2
  73. data/app/views/spree/admin/prices/edit.html.erb +2 -0
  74. data/app/views/spree/admin/prices/index.html.erb +5 -4
  75. data/app/views/spree/admin/prices/new.html.erb +4 -0
  76. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  77. data/app/views/spree/admin/products/_form.html.erb +4 -3
  78. data/app/views/spree/admin/products/index.html.erb +3 -3
  79. data/app/views/spree/admin/products/new.html.erb +2 -2
  80. data/app/views/spree/admin/products/new.js.erb +0 -3
  81. data/app/views/spree/admin/promotion_actions/create.js.erb +2 -6
  82. data/app/views/spree/admin/promotion_rules/create.js.erb +0 -8
  83. data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
  84. data/app/views/spree/admin/promotions/_form.html.erb +1 -1
  85. data/app/views/spree/admin/promotions/_promotion_action.html.erb +3 -4
  86. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +3 -3
  87. data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
  88. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +6 -2
  89. data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +1 -1
  90. data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +54 -0
  91. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +33 -14
  92. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +33 -14
  93. data/app/views/spree/admin/promotions/index.html.erb +1 -1
  94. data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +1 -1
  95. data/app/views/spree/admin/promotions/rules/_item_total.html.erb +1 -1
  96. data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +1 -1
  97. data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +1 -1
  98. data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
  99. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
  100. data/app/views/spree/admin/promotions/rules/_user_role.html.erb +2 -2
  101. data/app/views/spree/admin/refunds/edit.html.erb +1 -1
  102. data/app/views/spree/admin/refunds/new.html.erb +1 -1
  103. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  104. data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
  105. data/app/views/spree/admin/return_authorizations/_form.html.erb +4 -4
  106. data/app/views/spree/admin/shared/_address_form.html.erb +2 -2
  107. data/app/views/spree/admin/shared/_calculator_fields.html.erb +1 -1
  108. data/app/views/spree/admin/shared/_product_tabs.html.erb +4 -4
  109. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
  110. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  111. data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
  112. data/app/views/spree/admin/states/index.html.erb +1 -1
  113. data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
  114. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  115. data/app/views/spree/admin/stock_transfers/edit.html.erb +1 -1
  116. data/app/views/spree/admin/stock_transfers/index.html.erb +1 -1
  117. data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
  118. data/app/views/spree/admin/store_credits/_form.html.erb +1 -1
  119. data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
  120. data/app/views/spree/admin/stores/_form.html.erb +1 -1
  121. data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +4 -8
  122. data/app/views/spree/admin/style_guide/topics/forms/_buttons.html.erb +6 -0
  123. data/app/views/spree/admin/style_guide/topics/forms/_helper_text.html.erb +13 -0
  124. data/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb +96 -0
  125. data/app/views/spree/admin/style_guide/topics/forms/_labels.html.erb +6 -0
  126. data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +8 -1
  127. data/app/views/spree/admin/style_guide/topics/layout/_full_width_table_layout.html.erb +10 -0
  128. data/app/views/spree/admin/style_guide/topics/layout/_helpful_layout.html.erb +0 -0
  129. data/app/views/spree/admin/style_guide/topics/layout/_sidebar_layout.html.erb +4 -0
  130. data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +10 -4
  131. data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +45 -0
  132. data/app/views/spree/admin/style_guide/topics/tables/_forms_in_tables.html.erb +4 -0
  133. data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +1 -1
  134. data/app/views/spree/admin/tax_rates/_form.html.erb +17 -3
  135. data/app/views/spree/admin/tax_rates/index.html.erb +12 -3
  136. data/app/views/spree/admin/taxonomies/edit.erb +1 -8
  137. data/app/views/spree/admin/taxons/_form.html.erb +6 -4
  138. data/app/views/spree/admin/taxons/edit.html.erb +0 -15
  139. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  140. data/app/views/spree/admin/variants/_form.html.erb +8 -9
  141. data/app/views/spree/admin/variants/new.js.erb +0 -1
  142. data/config/routes.rb +1 -1
  143. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +1 -1
  144. data/spec/controllers/spree/admin/orders_controller_spec.rb +16 -4
  145. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -2
  146. data/spec/controllers/spree/admin/payments_controller_spec.rb +1 -1
  147. data/spec/controllers/spree/admin/products_controller_spec.rb +33 -0
  148. data/spec/controllers/spree/admin/variants_controller_spec.rb +39 -13
  149. data/spec/features/admin/configuration/payment_methods_spec.rb +11 -11
  150. data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
  151. data/spec/features/admin/configuration/states_spec.rb +4 -4
  152. data/spec/features/admin/configuration/store_spec.rb +3 -3
  153. data/spec/features/admin/configuration/tax_rates_spec.rb +1 -1
  154. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  155. data/spec/features/admin/orders/customer_details_spec.rb +10 -11
  156. data/spec/features/admin/orders/listing_spec.rb +1 -1
  157. data/spec/features/admin/orders/new_order_spec.rb +4 -11
  158. data/spec/features/admin/orders/order_details_spec.rb +20 -30
  159. data/spec/features/admin/orders/return_payment_state_spec.rb +60 -0
  160. data/spec/features/admin/orders/shipments_spec.rb +7 -0
  161. data/spec/features/admin/products/edit/images_spec.rb +48 -9
  162. data/spec/features/admin/products/edit/variants_spec.rb +1 -1
  163. data/spec/features/admin/products/option_types_spec.rb +2 -2
  164. data/spec/features/admin/products/products_spec.rb +49 -3
  165. data/spec/features/admin/products/stock_management_spec.rb +1 -3
  166. data/spec/features/admin/products/variant_spec.rb +20 -0
  167. data/spec/features/admin/promotion_adjustments_spec.rb +35 -34
  168. data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -2
  169. data/spec/features/admin/promotions/product_rule_spec.rb +1 -1
  170. data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
  171. data/spec/features/admin/promotions/user_rule_spec.rb +2 -2
  172. data/spec/features/admin/stock_transfer_spec.rb +11 -8
  173. data/spec/helpers/admin/navigation_helper_spec.rb +23 -0
  174. metadata +26 -18
  175. data/app/assets/javascripts/spree/backend/images/new.js.coffee +0 -7
  176. data/app/assets/stylesheets/spree/backend/sections/_payments.scss +0 -14
  177. data/app/helpers/spree/admin/images_helper.rb +0 -17
  178. data/app/views/spree/admin/orders/_add_line_item.html.erb +0 -15
  179. data/app/views/spree/admin/prices/new.js.erb +0 -2
  180. data/app/views/spree/admin/products/_properties_form.erb +0 -10
  181. data/app/views/spree/admin/promotions/_tab.html.erb +0 -1
  182. data/app/views/spree/admin/shared/_report_criteria.html.erb +0 -17
  183. data/app/views/spree/admin/states/_new.html.erb +0 -7
  184. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +0 -38
  185. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +0 -27
  186. data/app/views/spree/admin/taxons/_taxon_table.html.erb +0 -23
@@ -0,0 +1,23 @@
1
+ //= require jquery.payment
2
+ Spree.Views.Payment.EditCreditCard = Backbone.View.extend({
3
+ initialize: function() {
4
+ this.$(".cardNumber").payment('formatCardNumber');
5
+ this.$(".cardExpiry").payment('formatCardExpiry');
6
+ this.$(".cardCode").payment('formatCardCVC');
7
+
8
+ this.render()
9
+ },
10
+
11
+ events: {
12
+ 'change [name=card]': 'render',
13
+ 'change .cardNumber': 'render'
14
+ },
15
+
16
+ render: function() {
17
+ var isNew = (this.$('[name=card]:checked').val() === 'new') || (this.$('[name=card]').length == 0);
18
+ this.$('.js-new-credit-card-form').toggleClass('hidden', !isNew)
19
+ this.$('.js-new-credit-card-form :input').prop('disabled', !isNew)
20
+
21
+ this.$(".ccType").val($.payment.cardType(this.$('.cardNumber').val()))
22
+ }
23
+ })
@@ -0,0 +1,25 @@
1
+ Spree.Views.Payment.New = Backbone.View.extend({
2
+ initialize: function() {
3
+ this.onSelectMethod()
4
+ },
5
+
6
+ events: {
7
+ 'change [name="payment[payment_method_id]"]': 'onSelectMethod',
8
+ 'change .cardNumber': 'onChangeCard'
9
+ },
10
+
11
+ onSelectMethod: function(e) {
12
+ this.selectedId = parseInt(this.$('input[name="payment[payment_method_id]"]:checked').val())
13
+ this.render();
14
+ },
15
+
16
+ render: function() {
17
+ var view = this;
18
+ this.$('.payment-method-settings .payment-methods').each(function() {
19
+ var $method = $(this);
20
+ var selected = $method.data("payment-method-id") === view.selectedId;
21
+ $method.toggleClass('hidden', !selected);
22
+ $method.find(':input').prop('disabled', !selected);
23
+ });
24
+ }
25
+ });
@@ -24,7 +24,7 @@ Spree.Views.StateSelect = Backbone.View.extend({
24
24
  onChange: function() {
25
25
  this.model.set({
26
26
  state_name: this.$state_input.val(),
27
- state_id: this.$state_select.select2("val")
27
+ state_id: this.$state_select.val()
28
28
  })
29
29
  },
30
30
 
@@ -39,11 +39,11 @@ Spree.Views.StateSelect = Backbone.View.extend({
39
39
  },
40
40
 
41
41
  render: function() {
42
- this.$state_select.empty().select2("destroy").hide();
42
+ this.$state_select.empty().hide();
43
43
  this.$state_input.hide();
44
44
 
45
45
  if (!this.states.fetched) {
46
- this.$state_select.show().select2().select2("disable");
46
+ this.$state_select.show().prop("disabled", true);
47
47
  } else if (this.states.length) {
48
48
  var $state_select = this.$state_select;
49
49
  this.states.each(function(state) {
@@ -52,7 +52,7 @@ Spree.Views.StateSelect = Backbone.View.extend({
52
52
  );
53
53
  })
54
54
  this.$state_select.val(this.model.get("state_id"))
55
- this.$state_select.show().select2().select2("enable");
55
+ this.$state_select.show().prop("disabled", false);
56
56
  } else {
57
57
  this.$state_input.prop('disabled', false).show();
58
58
  }
@@ -0,0 +1,14 @@
1
+ Spree.Views.Tables ||= {}
2
+
3
+ class Spree.Views.Tables.EditableTable
4
+ @add: ($el) ->
5
+ new Spree.Views.Tables.EditableTableRow el: $el
6
+
7
+ @append: (html) ->
8
+ $row = $(html)
9
+
10
+ $('#images-table').removeClass('hidden').find('tbody').append($row)
11
+ $row.find('.select2').select2()
12
+ $('.no-objects-found').hide()
13
+
14
+ @add($row)
@@ -0,0 +1,45 @@
1
+ Spree.Views.Tables.EditableTableRow = Backbone.View.extend
2
+ events:
3
+ "select2-open": "onEdit"
4
+ "focus input": "onEdit"
5
+ "click [data-action=save]": "onSave"
6
+ "click [data-action=cancel]": "onCancel"
7
+ 'keyup input': 'onKeypress'
8
+
9
+ onEdit: (e) ->
10
+ return if @$el.hasClass('editing')
11
+ @$el.addClass('editing')
12
+
13
+ @$el.find('input, select').each ->
14
+ $input = $(this)
15
+ $input.data 'original-value', $input.val()
16
+
17
+ onCancel: (e) ->
18
+ e.preventDefault()
19
+ @$el.removeClass("editing")
20
+
21
+ @$el.find('input, select').each ->
22
+ $input = $(this)
23
+ originalValue = $input.data('original-value')
24
+ $input.val(originalValue).change()
25
+
26
+ onSave: (e) ->
27
+ e.preventDefault()
28
+
29
+ Spree.ajax @$el.find('.actions [data-action=save]').attr('href'),
30
+ data: @$el.find('select, input').serialize()
31
+ dataType: 'json'
32
+ method: 'put'
33
+ success: (response) =>
34
+ @$el.removeClass("editing")
35
+ error: (response) =>
36
+ show_flash 'error', response.responseJSON.error
37
+
38
+ ENTER_KEY: 13
39
+ ESC_KEY: 27
40
+
41
+ onKeypress: (e) ->
42
+ key = e.keyCode || e.which
43
+ switch key
44
+ when @ENTER_KEY then @onSave(e)
45
+ when @ESC_KEY then @onCancel(e)
@@ -46,7 +46,6 @@
46
46
  }
47
47
 
48
48
  .ui-icon {
49
- @extend [class^="icon-"]:before;
50
49
  @extend .fa;
51
50
 
52
51
  background-image: none;
@@ -0,0 +1,37 @@
1
+ .inline-editable-table tr:not(:hover):not(.editing) {
2
+ input {
3
+ border: 1px solid transparent;
4
+ color: inherit;
5
+ background-color: transparent;
6
+ }
7
+
8
+ .select2-arrow {
9
+ display: none;
10
+ }
11
+
12
+ .select2-choice {
13
+ background-color: transparent;
14
+ border-color: transparent;
15
+ color: inherit;
16
+ }
17
+
18
+ .select2-chosen {
19
+ color: inherit;
20
+ }
21
+ }
22
+
23
+ .inline-editable-table tr {
24
+ .fa-check, .fa-cancel {
25
+ display: none !important;
26
+ }
27
+
28
+ &.editing {
29
+ .fa-check, .fa-cancel {
30
+ display: inline-block !important;
31
+ }
32
+
33
+ .fa {
34
+ display: none;
35
+ }
36
+ }
37
+ }
@@ -38,10 +38,10 @@
38
38
  &.action-edit, &.action-save, &.action-capture, &.action-add {
39
39
  @include bootstrap-tooltip-color($brand-success);
40
40
  }
41
- &.action-clone {
41
+ &.action-clone, &.action-cancel {
42
42
  @include bootstrap-tooltip-color($brand-warning);
43
43
  }
44
- &.action-void, &.action-failure, &.action-cancel, &.action-remove {
44
+ &.action-void, &.action-failure, &.action-remove {
45
45
  @include bootstrap-tooltip-color($brand-danger);
46
46
  }
47
47
  }
@@ -52,14 +52,6 @@ div[data-hook="admin_products_index_search_buttons"] {
52
52
  }
53
53
  }
54
54
 
55
- progress {
56
- width: 100%;
57
- }
58
-
59
- .margin-bottom-one {
60
- margin-bottom: 1rem;
61
- }
62
-
63
55
  .progress-card {
64
56
  height: 100%;
65
57
  padding: 1rem;
@@ -26,7 +26,8 @@
26
26
  flex: 1;
27
27
  }
28
28
 
29
- ul {
29
+ ul.example,
30
+ ul.example ul {
30
31
  list-style: none;
31
32
  padding-left: 0;
32
33
  }
@@ -64,10 +65,6 @@
64
65
  margin: 4rem 0;
65
66
  }
66
67
 
67
- &-section {
68
- @include clearfix;
69
- }
70
-
71
68
  &-section-header {
72
69
  @include margin(7rem 0 3rem);
73
70
  border-bottom: 1px solid darken($color-7, 10%);
@@ -88,13 +85,13 @@
88
85
  }
89
86
 
90
87
  .half {
91
- width: 50%;
92
- float: left;
88
+ display: inline-block;
89
+ width: 49%;
93
90
  padding-right: 1rem;
91
+ vertical-align: top;
94
92
 
95
93
  + .half {
96
- float: none;
97
- margin-left: 50%;
94
+ display: inline-block;
98
95
  padding-right: 0;
99
96
  padding-left: 1rem;
100
97
  }
@@ -106,6 +103,15 @@
106
103
  border: 1px solid darken($color-7, 10%);
107
104
  }
108
105
  }
106
+
107
+ table.with-actions-borders {
108
+ th, td {
109
+ &.actions {
110
+ border-right: 1px solid #cee1f4 !important;
111
+ border-bottom: 1px solid #cee1f4 !important;
112
+ }
113
+ }
114
+ }
109
115
  }
110
116
 
111
117
  .color-variables {
@@ -14,24 +14,24 @@
14
14
  }
15
15
  }
16
16
 
17
- .fa-email:before { @extend .fa-envelope:before }
18
- .fa-resume:before { @extend .fa-refresh:before }
19
- .fa-approve:before { @extend .fa-check:before }
17
+ .fa-email { @extend .fa-envelope }
18
+ .fa-resume { @extend .fa-refresh }
19
+ .fa-approve { @extend .fa-check }
20
20
 
21
- .fa-remove:before,
22
- .fa-cancel:before,
23
- .fa-void:before { @extend .fa-times:before }
21
+ .fa-remove,
22
+ .fa-cancel,
23
+ .fa-void { @extend .fa-times }
24
24
 
25
- .fa-failure:before { @extend .fa-thumbs-down:before }
25
+ .fa-failure { @extend .fa-thumbs-down }
26
26
 
27
- .fa-trash:before { @extend .fa-trash-o:before }
27
+ .fa-trash { @extend .fa-trash-o }
28
28
 
29
- .fa-capture:before { @extend .fa-check:before }
30
- .fa-credit:before { @extend .fa-check:before }
31
- .fa-approve:before { @extend .fa-check:before }
32
- .fa-icon-cogs:before { @extend .fa-cogs:before }
33
- .fa-ok:before,
34
- .fa-icon-ok:before { @extend .fa-check:before }
29
+ .fa-capture { @extend .fa-check }
30
+ .fa-credit { @extend .fa-check }
31
+ .fa-approve { @extend .fa-check }
32
+ .fa-icon-cogs { @extend .fa-cogs }
33
+ .fa-ok,
34
+ .fa-icon-ok { @extend .fa-check }
35
35
 
36
36
  button, a {
37
37
  &.fa:before {
@@ -40,7 +40,7 @@ table {
40
40
  font-size: $font-size-base;
41
41
  }
42
42
 
43
- [class*='fa-'].no-text {
43
+ .fa {
44
44
  font-size: 120%;
45
45
  background-color: very-light($color-3);
46
46
  border: 1px solid $color-border;
@@ -112,7 +112,6 @@ table {
112
112
  }
113
113
 
114
114
  .handle {
115
- @extend [class^="icon-"]:before;
116
115
  @extend .fa;
117
116
  @extend .fa-bars;
118
117
  cursor: move;
@@ -20,6 +20,19 @@
20
20
  display: none;
21
21
  }
22
22
 
23
+ /* hide and show elements based on editing */
24
+ .editing .editing-hide {
25
+ display: none;
26
+ }
27
+
28
+ .editing .editing-show {
29
+ display: block;
30
+ }
31
+
32
+ .editing-show {
33
+ display: none;
34
+ }
35
+
23
36
  // For block grids
24
37
  .frameless {
25
38
  margin-left: -10px;
@@ -35,6 +35,7 @@
35
35
  @import 'spree/backend/components/sidebar';
36
36
  @import 'spree/backend/components/number_field_update';
37
37
  @import 'spree/backend/components/stock_table';
38
+ @import 'spree/backend/components/editable_table';
38
39
  @import 'spree/backend/components/tabs';
39
40
 
40
41
  @import 'font-awesome';
@@ -56,4 +57,3 @@
56
57
  @import 'spree/backend/sections/transfer_items';
57
58
  @import 'spree/backend/sections/stock_transfers';
58
59
  @import 'spree/backend/sections/style_guide';
59
- @import 'spree/backend/sections/payments';
@@ -32,7 +32,7 @@ module Spree
32
32
  end
33
33
 
34
34
  def load_order
35
- @order = Spree::Order.find_by_number!(params[:order_id])
35
+ @order = Spree::Order.find_by!(number: params[:order_id])
36
36
  authorize! action, @order
37
37
  end
38
38
 
@@ -51,7 +51,7 @@ module Spree
51
51
  end
52
52
 
53
53
  def load_order
54
- @order = Spree::Order.includes(:adjustments).find_by_number!(params[:order_id])
54
+ @order = Spree::Order.includes(:adjustments).find_by!(number: params[:order_id])
55
55
  end
56
56
 
57
57
  def model_class
@@ -69,23 +69,16 @@ module Spree
69
69
  end
70
70
 
71
71
  def new
72
- user = Spree.user_class.find_by_id(params[:user_id]) if params[:user_id]
72
+ user = Spree.user_class.find_by(id: params[:user_id]) if params[:user_id]
73
73
  @order = Spree::Core::Importer::Order.import(user, order_params)
74
74
  redirect_to cart_admin_order_url(@order)
75
75
  end
76
76
 
77
77
  def edit
78
78
  require_ship_address
79
-
80
- unless @order.completed?
81
- @order.refresh_shipment_rates
82
- end
83
79
  end
84
80
 
85
81
  def cart
86
- unless @order.completed?
87
- @order.refresh_shipment_rates
88
- end
89
82
  if @order.shipped_shipments.count > 0
90
83
  redirect_to edit_admin_order_url(@order)
91
84
  end
@@ -145,7 +138,7 @@ module Spree
145
138
  end
146
139
 
147
140
  def resend
148
- OrderMailer.confirm_email(@order.id, true).deliver_later
141
+ OrderMailer.confirm_email(@order, true).deliver_later
149
142
  flash[:success] = Spree.t(:order_email_resent)
150
143
 
151
144
  redirect_to(spree.edit_admin_order_path(@order))
@@ -178,7 +171,7 @@ module Spree
178
171
  end
179
172
 
180
173
  def load_order
181
- @order = Spree::Order.includes(:adjustments).find_by_number!(params[:id])
174
+ @order = Spree::Order.includes(:adjustments).find_by!(number: params[:id])
182
175
  authorize! action, @order
183
176
  end
184
177
 
@@ -2,8 +2,8 @@ module Spree
2
2
  module Admin
3
3
  class PaymentMethodsController < ResourceController
4
4
  skip_before_action :load_resource, only: :create
5
- before_action :load_providers
6
- before_action :validate_payment_method_provider, only: [:create, :update]
5
+ before_action :load_payment_method_types, except: [:index]
6
+ before_action :validate_payment_method_type, only: [:create, :update]
7
7
 
8
8
  respond_to :html
9
9
 
@@ -49,16 +49,29 @@ module Spree
49
49
  end
50
50
 
51
51
  def load_providers
52
- @providers = Spree::PaymentMethod.providers.sort_by(&:name)
52
+ load_payment_method_types
53
53
  end
54
+ deprecate load_providers: :load_payment_method_types, deprecator: Spree::Deprecation
54
55
 
55
- def validate_payment_method_provider
56
+ def load_payment_method_types
57
+ @payment_method_types = Rails.application.config.spree.payment_methods.sort_by(&:name)
58
+ # TODO: Remove `@providers` instance var once `load_providers` gets removed.
59
+ @providers = @payment_method_types
60
+ end
61
+
62
+ def validate_payment_provider
63
+ validate_payment_method_type
64
+ end
65
+ deprecate validate_payment_provider: :validate_payment_method_type,
66
+ deprecator: Spree::Deprecation
67
+
68
+ def validate_payment_method_type
56
69
  requested_type = params[:payment_method].delete(:type)
57
- @payment_method_type = @providers.detect do |klass|
70
+ @payment_method_type = @payment_method_types.detect do |klass|
58
71
  klass.name == requested_type
59
72
  end
60
73
  if !@payment_method_type
61
- flash[:error] = Spree.t(:invalid_payment_provider)
74
+ flash[:error] = Spree.t(:invalid_payment_method_type)
62
75
  redirect_to new_admin_payment_method_path
63
76
  end
64
77
  end