solidus_backend 3.1.5 → 3.2.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -6
  3. data/app/assets/javascripts/spree/backend/components/sortable_table.js +9 -1
  4. data/app/assets/javascripts/spree/backend/namespaces.js +1 -0
  5. data/app/assets/javascripts/spree/backend/products/index.js +7 -0
  6. data/app/assets/javascripts/spree/backend/shipments.js +1 -1
  7. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +1 -3
  8. data/app/assets/javascripts/spree/backend/views/index.js +1 -0
  9. data/app/assets/javascripts/spree/backend/views/product/search.js +44 -0
  10. data/app/assets/javascripts/spree/backend.js +1 -0
  11. data/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss +1 -0
  12. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +9 -8
  13. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -32
  14. data/app/concerns/spree/admin/sets_user_language_locale_key.rb +9 -0
  15. data/app/controllers/spree/admin/base_controller.rb +2 -4
  16. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  17. data/app/controllers/spree/admin/locale_controller.rb +2 -0
  18. data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
  19. data/app/controllers/spree/admin/orders_controller.rb +3 -3
  20. data/app/controllers/spree/admin/prices_controller.rb +1 -1
  21. data/app/controllers/spree/admin/reimbursements_controller.rb +2 -2
  22. data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
  23. data/app/controllers/spree/admin/store_credits_controller.rb +6 -6
  24. data/app/controllers/spree/admin/tax_rates_controller.rb +11 -0
  25. data/app/controllers/spree/admin/users_controller.rb +3 -3
  26. data/app/helpers/spree/admin/products_helper.rb +4 -0
  27. data/app/helpers/spree/admin/stock_locations_helper.rb +1 -3
  28. data/app/views/spree/admin/adjustment_reasons/index.html.erb +8 -4
  29. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  30. data/app/views/spree/admin/adjustments/index.html.erb +1 -1
  31. data/app/views/spree/admin/orders/index.html.erb +6 -8
  32. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  33. data/app/views/spree/admin/prices/_master_variant_table.html.erb +5 -6
  34. data/app/views/spree/admin/prices/_table.html.erb +5 -6
  35. data/app/views/spree/admin/products/edit.html.erb +2 -2
  36. data/app/views/spree/admin/products/index.html.erb +9 -3
  37. data/app/views/spree/admin/promotions/_rules.html.erb +9 -7
  38. data/app/views/spree/admin/promotions/index.html.erb +2 -2
  39. data/app/views/spree/admin/refunds/edit.html.erb +1 -1
  40. data/app/views/spree/admin/refunds/new.html.erb +6 -6
  41. data/app/views/spree/admin/shared/_head.html.erb +1 -1
  42. data/app/views/spree/admin/shared/_navigation.html.erb +5 -1
  43. data/app/views/spree/admin/shared/{_navigation_footer.html.erb → _navigation_footer_fallback.html.erb} +5 -5
  44. data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
  45. data/app/views/spree/admin/store_credit_reasons/index.html.erb +5 -3
  46. data/app/views/spree/admin/store_credits/index.html.erb +1 -1
  47. data/app/views/spree/admin/store_credits/show.html.erb +4 -3
  48. data/app/views/spree/admin/tax_rates/index.html.erb +31 -1
  49. data/app/views/spree/admin/users/_form.html.erb +1 -0
  50. data/app/views/spree/admin/users/edit.html.erb +1 -1
  51. data/app/views/spree/admin/users/index.html.erb +3 -3
  52. data/app/views/spree/admin/variants/_form.html.erb +7 -4
  53. data/app/views/spree/admin/variants/_table.html.erb +8 -7
  54. data/app/views/spree/admin/variants/_table_filter.html.erb +8 -9
  55. data/app/views/spree/admin/variants/index.html.erb +1 -1
  56. data/app/views/spree/admin/variants/new.html.erb +1 -0
  57. data/config/routes.rb +3 -3
  58. data/lib/spree/backend.rb +0 -1
  59. data/lib/spree/backend_configuration.rb +10 -0
  60. data/solidus_backend.gemspec +2 -1
  61. data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-CA.js +10 -0
  62. data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_lists.scss +35 -0
  63. metadata +13 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5b088e16cfee1de5d36ce4f17da058e9f25be203a93c75cda6e7397694b118c
4
- data.tar.gz: b4fad25b4fd46ce59a610ace192cedc106ba156cb079199f352e2c7bc5f7e0ad
3
+ metadata.gz: 7f40b6a70c46a2ad49195d9bfd9642172fea9ec7375b9253adab0f9eaf2bb3c0
4
+ data.tar.gz: 90b8118323724ba9953ca65dbf44139349a6dafdb59c4e9d7823a8fdff47ef92
5
5
  SHA512:
6
- metadata.gz: 687f8770cb2e5498a34779685f4c701213572ea613e4410b914aec80f1d5f4c6a69037d1315c8676e165201e85379e8f42eb6837ef63f533888bc7807c4510d0
7
- data.tar.gz: 87f18a8756ee2e06993499ea781f38c0d1fce8b75ea3e1b9f1e423edddbece8e44dbd07c5e420d460708c28c83ed48f57309d81b445d88eed533b521c4cecc08
6
+ metadata.gz: 2145cf1b419208c84b5a671b67eecde34b56c3cc9efdcd40d43271489855368dcf35268c64fe2d1c08e7977aa81b4eb6472c37eb184d86197b760a3b08a9be6a
7
+ data.tar.gz: c5e1b38dc22dc6a654dd8e05f3445e8c725ea7d6df2b27544f16dc95a25307e646f8d282e7139c925b83f07d72fc1b2d65c0f8050789e80230f3e91fe4db4ef6
data/README.md CHANGED
@@ -8,12 +8,7 @@ Backend contains the controllers, views, and assets making up the admin interfac
8
8
 
9
9
  Can be found in [app/assets/javascripts/spree/backend/](./app/assets/javascripts/spree/backend/)
10
10
 
11
- Our scripts are written in a mix of CoffeeScript and JavaScript (ES5). We can't
12
- easily use a transpiler for ECMAScript >= 6 without adding additional steps for
13
- applications using solidus\_admin.
14
-
15
- Though we have existing CoffeeScript files, any new files should be in
16
- JavaScript (ES5).
11
+ Any new files should be in JavaScript (ES5).
17
12
 
18
13
  ### Stylesheets
19
14
 
@@ -1,6 +1,14 @@
1
1
  //= require solidus_admin/Sortable
2
2
  /* eslint no-unused-vars: "off" */
3
3
 
4
+ /* Check if string is valid UUID */
5
+ function isAValidUUID(str) {
6
+ // https://stackoverflow.com/a/13653180/8170555
7
+ const regexExp = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
8
+
9
+ return regexExp.test(str);
10
+ }
11
+
4
12
  Spree.SortableTable = {
5
13
  refresh: function() {
6
14
  var sortable_tables = document.querySelectorAll('table.sortable');
@@ -16,7 +24,7 @@ Spree.SortableTable = {
16
24
  var idAttr = el.id;
17
25
  if (idAttr) {
18
26
  var objId = idAttr.split('_').slice(-1);
19
- if (!isNaN(objId)) {
27
+ if (!isNaN(objId) || isAValidUUID(objId)) {
20
28
  positions['positions['+objId+']'] = index + 1;
21
29
  }
22
30
  }
@@ -8,6 +8,7 @@ _.extend(window.Spree, {
8
8
  Cart: {},
9
9
  Zones: {},
10
10
  Payment: {},
11
+ Product: {},
11
12
  Promotions: {},
12
13
  Stock: {},
13
14
  Tables: {}
@@ -0,0 +1,7 @@
1
+ Spree.ready(function() {
2
+ if ($('[data-hook="admin_products_index_search"]').length) {
3
+ new Spree.Views.Product.Search({
4
+ el: $('[data-hook="admin_products_index_search"]')
5
+ })
6
+ }
7
+ });
@@ -180,7 +180,7 @@ var ShipmentItemView = Backbone.View.extend({
180
180
  Spree.ajax({
181
181
  type: "GET",
182
182
  url: Spree.pathFor('api/variants/' + this.variant_id),
183
- }).success(function(variant){
183
+ }).done(function(variant){
184
184
  var split = new ShipmentSplitItemView({
185
185
  shipmentItemView: _this,
186
186
  shipment_number: _this.shipment_number,
@@ -31,9 +31,7 @@
31
31
  },
32
32
  data: function(term, page) {
33
33
  var searchData = {
34
- q: {
35
- product_name_or_sku_cont: term
36
- },
34
+ variant_search_term: term,
37
35
  token: Spree.api_key
38
36
  };
39
37
  return _.extend(searchData, searchOptions);
@@ -21,6 +21,7 @@
21
21
  //= require 'spree/backend/views/payment/new'
22
22
  //= require 'spree/backend/views/payment/payment_row'
23
23
  //= require 'spree/backend/views/payment/edit_credit_card'
24
+ //= require 'spree/backend/views/product/search'
24
25
  //= require 'spree/backend/views/promotions/option_values_rule'
25
26
  //= require 'spree/backend/views/tables/editable_table'
26
27
  //= require 'spree/backend/views/tables/editable_table_row'
@@ -0,0 +1,44 @@
1
+ Spree.Views.Product.Search = Backbone.View.extend({
2
+ initialize: function() {
3
+ this.render();
4
+ },
5
+
6
+ events: {
7
+ "change .js-with-discarded-input": "onChange"
8
+ },
9
+
10
+ onChange: function(e) {
11
+ const withDiscarded = $(e.target).is(":checked");
12
+
13
+ var keptInput = this.$el.find(".js-kept-variant-sku-input input");
14
+ var allInput = this.$el.find(".js-all-variant-sku-input input");
15
+
16
+ if (withDiscarded) {
17
+ allInput.val(keptInput.val());
18
+ keptInput.val("");
19
+ } else {
20
+ keptInput.val(allInput.val());
21
+ allInput.val("");
22
+ }
23
+
24
+ allInput.prop("disabled", !withDiscarded)
25
+ keptInput.prop("disabled", withDiscarded)
26
+
27
+ this.render();
28
+ },
29
+
30
+ render: function() {
31
+ var withDiscarded = this.$el.find(".js-with-discarded-input").is(":checked");
32
+
33
+ var keptContainer = this.$el.find(".js-kept-variant-sku-input");
34
+ var allContainer = this.$el.find(".js-all-variant-sku-input");
35
+
36
+ if (withDiscarded) {
37
+ keptContainer.hide();
38
+ allContainer.show();
39
+ } else {
40
+ keptContainer.show();
41
+ allContainer.hide();
42
+ }
43
+ },
44
+ });
@@ -47,6 +47,7 @@
47
47
  //= require spree/backend/orders
48
48
  //= require spree/backend/payments/edit
49
49
  //= require spree/backend/payments/new
50
+ //= require spree/backend/products/index
50
51
  //= require spree/backend/product_picker
51
52
  //= require spree/backend/progress
52
53
  //= require spree/backend/promotions
@@ -1,5 +1,6 @@
1
1
  .number-with-currency {
2
2
  $currency-width: 5.5rem;
3
+ flex-wrap: nowrap;
3
4
 
4
5
  &-symbol {
5
6
  min-width: 2.5em;
@@ -147,16 +147,17 @@ span.info {
147
147
  }
148
148
  }
149
149
 
150
- &.withError {
151
- .field_with_errors {
152
- label {
153
- color: theme-color("danger");
154
- }
150
+ .field_with_errors {
151
+ label {
152
+ color: theme-color("danger");
153
+ }
155
154
 
156
- input {
157
- border-color: theme-color("danger");
158
- }
155
+ input {
156
+ border-color: theme-color("danger");
159
157
  }
158
+ }
159
+
160
+ &.withError {
160
161
  .formError {
161
162
  color: lighten(theme-color("danger"), 15);
162
163
  font-style: italic;
@@ -57,38 +57,6 @@ ul.text_list {
57
57
  padding-left: 0;
58
58
  }
59
59
 
60
- dl {
61
- width: 100%;
62
- overflow: hidden;
63
- margin: 5px 0;
64
- color: lighten($body-color, 15);
65
-
66
- dt, dd {
67
- float: left;
68
- line-height: 16px;
69
- padding: 5px;
70
- }
71
-
72
- dt {
73
- width: 40%;
74
- font-weight: $font-weight-bold;
75
- padding-left: 0;
76
- clear: left;
77
- }
78
-
79
- dd {
80
- width: 60%;
81
- padding-right: 0;
82
- margin-left: 0;
83
- }
84
- }
85
-
86
- .dl-collapse {
87
- dt, dd {
88
- width: auto;
89
- }
90
- }
91
-
92
60
  // Helpers
93
61
  .align-center { text-align: center }
94
62
  .align-right { text-align: right }
@@ -0,0 +1,9 @@
1
+ module Spree
2
+ module Admin
3
+ module SetsUserLanguageLocaleKey
4
+ def set_user_language_locale_key
5
+ :admin_locale
6
+ end
7
+ end
8
+ end
9
+ end
@@ -12,9 +12,7 @@ module Spree
12
12
 
13
13
  # Overrides ControllerHelpers::Common
14
14
  # We want the admin's locale selection to be different than that on the frontend
15
- def set_user_language_locale_key
16
- :admin_locale
17
- end
15
+ include SetsUserLanguageLocaleKey
18
16
 
19
17
  def action
20
18
  params[:action].to_sym
@@ -33,7 +31,7 @@ module Spree
33
31
  # Need to generate an API key for a user due to some backend actions
34
32
  # requiring authentication to the Spree API
35
33
  def generate_admin_api_key
36
- if (user = try_spree_current_user) && user.spree_api_key.blank?
34
+ if (user = spree_current_user) && user.spree_api_key.blank?
37
35
  user.generate_spree_api_key!
38
36
  end
39
37
  end
@@ -30,7 +30,7 @@ module Spree
30
30
  private
31
31
 
32
32
  def created_by
33
- try_spree_current_user.try(:email)
33
+ spree_current_user.try(:email)
34
34
  end
35
35
 
36
36
  def load_order
@@ -3,6 +3,8 @@
3
3
  module Spree
4
4
  module Admin
5
5
  class LocaleController < Spree::Admin::BaseController
6
+ skip_before_action :authorize_admin, only: [:set]
7
+
6
8
  def set
7
9
  requested_locale = params[:switch_to_locale].to_s.presence
8
10
 
@@ -31,7 +31,7 @@ module Spree
31
31
  end
32
32
 
33
33
  unless @order.completed?
34
- @order.next
34
+ @order.contents.advance
35
35
  @order.refresh_shipment_rates
36
36
  end
37
37
 
@@ -112,7 +112,7 @@ module Spree
112
112
  end
113
113
 
114
114
  def cancel
115
- @order.canceled_by(try_spree_current_user)
115
+ @order.canceled_by(spree_current_user)
116
116
  flash[:success] = t('spree.order_canceled')
117
117
  redirect_to(spree.edit_admin_order_path(@order))
118
118
  end
@@ -124,7 +124,7 @@ module Spree
124
124
  end
125
125
 
126
126
  def approve
127
- @order.contents.approve(user: try_spree_current_user)
127
+ @order.contents.approve(user: spree_current_user)
128
128
  flash[:success] = t('spree.order_approved')
129
129
  redirect_to(spree.edit_admin_order_path(@order))
130
130
  end
@@ -156,7 +156,7 @@ module Spree
156
156
 
157
157
  def order_params
158
158
  {
159
- created_by_id: try_spree_current_user.try(:id),
159
+ created_by_id: spree_current_user.try(:id),
160
160
  frontend_viewable: false,
161
161
  store_id: current_store.try(:id)
162
162
  }.with_indifferent_access
@@ -18,7 +18,7 @@ module Spree
18
18
  .currently_valid
19
19
  .for_variant
20
20
  .order(:variant_id, :country_iso, :currency)
21
- .page(params[:page]).per(Spree::Config.admin_variants_per_page)
21
+ .page(params[:variants_page]).per(Spree::Config.admin_variants_per_page)
22
22
  end
23
23
 
24
24
  def edit
@@ -14,7 +14,7 @@ module Spree
14
14
  rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error
15
15
 
16
16
  def perform
17
- @reimbursement.perform!(created_by: try_spree_current_user)
17
+ @reimbursement.perform!(created_by: spree_current_user)
18
18
  redirect_to location_after_save
19
19
  end
20
20
 
@@ -62,7 +62,7 @@ module Spree
62
62
  end
63
63
 
64
64
  def load_simulated_refunds
65
- @reimbursement_objects = @reimbursement.simulate(created_by: try_spree_current_user)
65
+ @reimbursement_objects = @reimbursement.simulate(created_by: spree_current_user)
66
66
  end
67
67
 
68
68
  def spree_core_gateway_error(error)
@@ -18,7 +18,7 @@ module Spree
18
18
  variant = Spree::Variant.accessible_by(current_ability, :show).find(params[:variant_id])
19
19
  stock_location = Spree::StockLocation.accessible_by(current_ability, :show).find(params[:stock_location_id])
20
20
  stock_location.stock_movements.build(stock_movement_params).tap do |stock_movement|
21
- stock_movement.originator = try_spree_current_user
21
+ stock_movement.originator = spree_current_user
22
22
  stock_movement.stock_item = stock_location.set_up_stock_item(variant)
23
23
  end
24
24
  end
@@ -17,8 +17,8 @@ module Spree
17
17
  def create
18
18
  @store_credit = @user.store_credits.build(
19
19
  permitted_resource_params.merge({
20
- created_by: try_spree_current_user,
21
- action_originator: try_spree_current_user
20
+ created_by: spree_current_user,
21
+ action_originator: spree_current_user
22
22
  })
23
23
  )
24
24
 
@@ -34,7 +34,7 @@ module Spree
34
34
 
35
35
  def update
36
36
  @store_credit.assign_attributes(permitted_resource_params)
37
- @store_credit.created_by = try_spree_current_user
37
+ @store_credit.created_by = spree_current_user
38
38
 
39
39
  if @store_credit.save
40
40
  respond_to do |format|
@@ -50,7 +50,7 @@ module Spree
50
50
  def update_amount
51
51
  @store_credit = @user.store_credits.find(params[:id])
52
52
  amount = params.require(:store_credit).require(:amount)
53
- if @store_credit.update_amount(amount, @store_credit_reason, try_spree_current_user)
53
+ if @store_credit.update_amount(amount, @store_credit_reason, spree_current_user)
54
54
  flash[:success] = flash_message_for(@store_credit, :successfully_updated)
55
55
  redirect_to admin_user_store_credit_path(@user, @store_credit)
56
56
  else
@@ -60,7 +60,7 @@ module Spree
60
60
 
61
61
  def invalidate
62
62
  @store_credit = @user.store_credits.find(params[:id])
63
- if @store_credit.invalidate(@store_credit_reason, try_spree_current_user)
63
+ if @store_credit.invalidate(@store_credit_reason, spree_current_user)
64
64
  redirect_to admin_user_store_credit_path(@user, @store_credit)
65
65
  else
66
66
  render_edit_page
@@ -71,7 +71,7 @@ module Spree
71
71
 
72
72
  def permitted_resource_params
73
73
  params.require(:store_credit).permit([:amount, :currency, :category_id, :memo]).
74
- merge(created_by: try_spree_current_user)
74
+ merge(created_by: spree_current_user)
75
75
  end
76
76
 
77
77
  def collection
@@ -12,6 +12,17 @@ module Spree
12
12
  @available_categories = Spree::TaxCategory.order(:name)
13
13
  @calculators = Rails.application.config.spree.calculators.tax_rates
14
14
  end
15
+
16
+ def collection
17
+ @search = Spree::TaxRate.ransack(params[:q])
18
+ @collection = @search.result
19
+ @collection = @collection
20
+ .includes(:tax_categories)
21
+ .order(:zone_id)
22
+ @collection = @collection
23
+ .page(params[:page])
24
+ .per(Spree::Config[:admin_products_per_page])
25
+ end
15
26
  end
16
27
  end
17
28
  end
@@ -92,7 +92,7 @@ module Spree
92
92
 
93
93
  @search = super.ransack(params[:q])
94
94
  @collection = @search.result.includes(:spree_roles)
95
- @collection = @collection.includes(:spree_orders)
95
+ @collection = @collection.includes(:orders)
96
96
  @collection = @collection.page(params[:page]).per(Spree::Config[:admin_products_per_page])
97
97
  end
98
98
 
@@ -121,11 +121,11 @@ module Spree
121
121
  # handling raise from Spree::Admin::ResourceController#destroy
122
122
  def user_destroy_with_orders_error
123
123
  invoke_callbacks(:destroy, :fails)
124
- render status: :forbidden, text: t('spree.error_user_destroy_with_orders')
124
+ render status: :forbidden, plain: t("spree.error_user_destroy_with_orders")
125
125
  end
126
126
 
127
127
  def sign_in_if_change_own_password
128
- if try_spree_current_user == @user && @user.password.present?
128
+ if spree_current_user == @user && @user.password.present?
129
129
  sign_in(@user, event: :authentication, bypass: true)
130
130
  end
131
131
  end
@@ -3,6 +3,10 @@
3
3
  module Spree
4
4
  module Admin
5
5
  module ProductsHelper
6
+ def frontend_product_path(product)
7
+ Spree::Backend::Config[:frontend_product_path].call(self, product)
8
+ end
9
+
6
10
  def show_rebuild_vat_checkbox?
7
11
  Spree::TaxRate.included_in_price.exists?
8
12
  end
@@ -4,9 +4,7 @@ module Spree
4
4
  module Admin
5
5
  module StockLocationsHelper
6
6
  def admin_stock_location_display_name(stock_location)
7
- name_parts = [stock_location.admin_name, stock_location.name]
8
- name_parts.delete_if(&:blank?)
9
- name_parts.join(' / ')
7
+ [stock_location.admin_name, stock_location.name].reject(&:blank?).join(' / ')
10
8
  end
11
9
  end
12
10
  end
@@ -6,9 +6,11 @@
6
6
 
7
7
  <% content_for :page_actions do %>
8
8
  <ul class="actions inline-menu">
9
- <li>
10
- <%= link_to t('spree.new_adjustment_reason'), new_object_url, id: 'admin_new_named_type', class: 'btn btn-primary' %>
11
- </li>
9
+ <% if can?(:create, Spree::AdjustmentReason) %>
10
+ <li>
11
+ <%= link_to t('spree.new_adjustment_reason'), new_object_url, id: 'admin_new_named_type', class: 'btn btn-primary' %>
12
+ </li>
13
+ <% end %>
12
14
  </ul>
13
15
  <% end %>
14
16
 
@@ -38,7 +40,9 @@
38
40
  </span>
39
41
  </td>
40
42
  <td class="actions">
41
- <%= link_to_edit adjustment_reason, no_text: true %>
43
+ <% if can? :edit, adjustment_reason %>
44
+ <%= link_to_edit adjustment_reason, no_text: true %>
45
+ <% end %>
42
46
  </td>
43
47
  </tr>
44
48
  <% end %>
@@ -13,12 +13,12 @@
13
13
  <tr data-hook="adjustment_buttons">
14
14
  <td class="align-right" colspan="2" style="width: 50%">
15
15
  <% if can? :update, Spree::Adjustment %>
16
- <%= button_to t('spree.unfinalize_all_adjustments'), adjustments_unfinalize_admin_order_path(@order), method: :get %>
16
+ <%= button_to t('spree.unfinalize_all_adjustments'), adjustments_unfinalize_admin_order_path(@order), method: :put %>
17
17
  <% end %>
18
18
  </td>
19
19
  <td colspan="2" style="width: 50%">
20
20
  <% if can? :update, Spree::Adjustment %>
21
- <%= button_to t('spree.finalize_all_adjustments'), adjustments_finalize_admin_order_path(@order), method: :get %>
21
+ <%= button_to t('spree.finalize_all_adjustments'), adjustments_finalize_admin_order_path(@order), method: :put %>
22
22
  <% end %>
23
23
  </td>
24
24
  <td class='actions'>&nbsp;</td>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <%= render partial: 'adjustments_table' %>
14
14
 
15
- <% if @order.can_add_coupon? %>
15
+ <% if @order.can_add_coupon? && can?(:update, @order) %>
16
16
  <div data-hook="adjustments_new_coupon_code">
17
17
  <%= text_field_tag "coupon_code", "", placeholder: t('spree.coupon_code') %>
18
18
  <%= button_tag t('spree.add_coupon_code'), id: "add_coupon_code", class: 'btn btn-primary' %>
@@ -7,7 +7,7 @@
7
7
  <li>
8
8
  <%= link_to t('spree.new_order'), new_admin_order_url, id: 'admin_new_order', class: 'btn btn-primary' %>
9
9
  </li>
10
- <% end if can? :manage, Spree::Order %>
10
+ <% end if can? :create, Spree::Order %>
11
11
 
12
12
  <% content_for :table_filter_title do %>
13
13
  <%= t('spree.filter') %>
@@ -70,8 +70,8 @@
70
70
 
71
71
  <div class="col-12 col-xl-6">
72
72
  <div class="field">
73
- <%= label_tag :q_bill_address_name_start, t('spree.name_contains') %>
74
- <%= f.text_field :bill_address_name_start, size: 25 %>
73
+ <%= label_tag :q_bill_address_name_cont, t('spree.name_contains') %>
74
+ <%= f.text_field :bill_address_name_cont, size: 25 %>
75
75
  </div>
76
76
  </div>
77
77
 
@@ -191,11 +191,9 @@
191
191
  </table>
192
192
  <% else %>
193
193
  <div class="no-objects-found">
194
- <% if can? :manage, Spree::Order %>
195
- <%= render 'spree/admin/shared/no_objects_found',
196
- resource: Spree::Order,
197
- new_resource_url: spree.new_admin_order_path %>
198
- <% end %>
194
+ <%= render 'spree/admin/shared/no_objects_found',
195
+ resource: Spree::Order,
196
+ new_resource_url: spree.new_admin_order_path %>
199
197
  </div>
200
198
  <% end %>
201
199
 
@@ -58,7 +58,7 @@
58
58
  <% allowed_actions = payment.actions.select { |a| can?(a.to_sym, payment) } %>
59
59
  <% allowed_actions.each do |action| %>
60
60
  <% if action == 'credit' %>
61
- <%= link_to_with_icon 'reply', t('spree.refund'), new_admin_order_payment_refund_path(@order, payment), no_text: true %>
61
+ <%= link_to_with_icon 'mail-reply', t('spree.actions.refund'), new_admin_order_payment_refund_path(@order, payment), no_text: true %>
62
62
  <% elsif action == 'capture' && !@order.completed? %>
63
63
  <%# no capture prior to completion. payments get captured when the order completes. %>
64
64
  <% else %>
@@ -1,9 +1,9 @@
1
- <%= paginate master_prices, theme: "solidus_admin" %>
2
-
3
1
  <fieldset class="no-border-bottom <%= "no-border-top" if !variants %>">
4
2
  <% if variants %>
5
- <legend align="center"><%= I18n.t(:master_variant, scope: :spree) %> <%= admin_hint I18n.t(:master_variant, scope: :spree), I18n.t(:master_variant, scope: [:spree, :hints, "spree/price"]) %></legend>
3
+ <legend align="center"><%= t(".master_variant") %> <%= admin_hint t(".master_variant"), I18n.t(:master_variant, scope: [:spree, :hints, "spree/price"]) %></legend>
6
4
  <% end %>
5
+
6
+ <%= paginate master_prices, theme: "solidus_admin" %>
7
7
  <table class="index master_prices">
8
8
  <colgroup>
9
9
  <col style="width: 30%">
@@ -25,7 +25,7 @@
25
25
  <td><%= price.currency %></td>
26
26
  <td><%= price.money.to_html %></td>
27
27
  <td class="actions">
28
- <% if can?(:update, price) %>
28
+ <% if can?(:edit, price) %>
29
29
  <%= link_to_edit(price, no_text: true) unless price.discarded? %>
30
30
  <% end %>
31
31
  <% if can?(:destroy, price) %>
@@ -36,6 +36,5 @@
36
36
  </tr>
37
37
  <% end %>
38
38
  </table>
39
+ <%= paginate master_prices, theme: "solidus_admin" %>
39
40
  </fieldset>
40
-
41
- <%= paginate master_prices, theme: "solidus_admin" %>
@@ -1,7 +1,7 @@
1
- <%= paginate variant_prices, theme: "solidus_admin" %>
1
+ <fieldset class="no-border-bottom" data-hook="variant_prices_table">
2
+ <legend align="center"><%= t(".variant_pricing") %></legend>
2
3
 
3
- <fieldset class="no-border-bottom">
4
- <legend align="center"><%= I18n.t(:variant_pricing, scope: :spree) %></legend>
4
+ <%= paginate variant_prices, theme: "solidus_admin", param_name: :variants_page %>
5
5
  <table class="index prices">
6
6
  <thead data-hook="prices_header">
7
7
  <tr>
@@ -20,7 +20,7 @@
20
20
  <td><%= price.currency %></td>
21
21
  <td><%= price.money.to_html %></td>
22
22
  <td class="actions">
23
- <% if can?(:update, price) %>
23
+ <% if can?(:edit, price) %>
24
24
  <%= link_to_edit(price, no_text: true) unless price.discarded? %>
25
25
  <% end %>
26
26
  <% if can?(:destroy, price) %>
@@ -32,6 +32,5 @@
32
32
  <% end %>
33
33
  </tbody>
34
34
  </table>
35
+ <%= paginate variant_prices, theme: "solidus_admin", param_name: :variants_page %>
35
36
  </fieldset>
36
-
37
- <%= paginate variant_prices, theme: "solidus_admin" %>
@@ -4,9 +4,9 @@
4
4
  <%= link_to t('spree.new_product'), new_object_url, id: 'admin_new_product', class: 'btn btn-primary' %>
5
5
  </li>
6
6
  <% end %>
7
- <% if defined?(Spree::Frontend::Engine) %>
7
+ <% if frontend_product_path(@product) %>
8
8
  <li id="view_product_link">
9
- <%= link_to t('spree.view_product'), spree.product_path(@product), id: 'admin_view_product', class: 'btn btn-default ml-2' %>
9
+ <%= link_to t('spree.view_product'), frontend_product_path(@product), id: 'admin_view_product', class: 'btn btn-default ml-2' %>
10
10
  </li>
11
11
  <% end %>
12
12
  <% end %>