solidus_backend 2.7.4 → 2.8.0

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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -8
  3. data/app/assets/images/favicon.ico +0 -0
  4. data/app/assets/javascripts/spree/backend.js +0 -2
  5. data/app/assets/javascripts/spree/backend/adjustments.js +1 -1
  6. data/app/assets/javascripts/spree/backend/components/tooltips.js +21 -17
  7. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
  8. data/app/assets/javascripts/spree/backend/product_picker.js +1 -1
  9. data/app/assets/javascripts/spree/backend/shipments.js +6 -1
  10. data/app/assets/javascripts/spree/backend/stock_management.js +9 -0
  11. data/app/assets/javascripts/spree/backend/store_credits.js +18 -2
  12. data/app/assets/javascripts/spree/backend/taxons.js +1 -1
  13. data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +24 -25
  14. data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
  15. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +1 -1
  16. data/app/assets/javascripts/spree/backend/views/order/customer_select.js +1 -1
  17. data/app/assets/javascripts/spree/backend/views/order/summary.js +2 -2
  18. data/app/assets/javascripts/spree/backend/views/stock/add_stock_item.js +15 -4
  19. data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +30 -10
  20. data/app/assets/stylesheets/spree/backend/globals/_functions.scss +1 -2
  21. data/app/assets/stylesheets/spree/backend/sections/_orders.scss +8 -0
  22. data/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +77 -2
  23. data/app/assets/stylesheets/spree/backend/spree_admin.scss +0 -1
  24. data/app/controllers/spree/admin/cancellations_controller.rb +2 -2
  25. data/app/controllers/spree/admin/locale_controller.rb +1 -1
  26. data/app/controllers/spree/admin/orders/customer_details_controller.rb +8 -1
  27. data/app/controllers/spree/admin/orders_controller.rb +1 -11
  28. data/app/controllers/spree/admin/products_controller.rb +10 -6
  29. data/app/controllers/spree/admin/promotion_codes_controller.rb +19 -1
  30. data/app/controllers/spree/admin/promotions_controller.rb +1 -1
  31. data/app/controllers/spree/admin/reimbursements_controller.rb +7 -2
  32. data/app/controllers/spree/admin/resource_controller.rb +1 -0
  33. data/app/controllers/spree/admin/store_credit_reasons_controller.rb +8 -0
  34. data/app/controllers/spree/admin/store_credits_controller.rb +11 -11
  35. data/app/helpers/spree/admin/navigation_helper.rb +1 -1
  36. data/app/models/spree/backend_configuration.rb +38 -21
  37. data/app/views/spree/admin/cancellations/index.html.erb +3 -1
  38. data/app/views/spree/admin/images/_image_row.html.erb +1 -1
  39. data/app/views/spree/admin/images/edit.html.erb +3 -3
  40. data/app/views/spree/admin/images/index.html.erb +2 -2
  41. data/app/views/spree/admin/log_entries/index.html.erb +2 -2
  42. data/app/views/spree/admin/orders/_carton_manifest.html.erb +3 -1
  43. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +3 -1
  44. data/app/views/spree/admin/orders/confirm/_line_items.html.erb +3 -2
  45. data/app/views/spree/admin/orders/confirm/_shipment_manifest.html.erb +3 -1
  46. data/app/views/spree/admin/orders/index.html.erb +1 -1
  47. data/app/views/spree/admin/products/_form.html.erb +7 -7
  48. data/app/views/spree/admin/products/edit.html.erb +5 -0
  49. data/app/views/spree/admin/products/index.html.erb +3 -1
  50. data/app/views/spree/admin/promotion_categories/index.html.erb +1 -1
  51. data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
  52. data/app/views/spree/admin/promotion_codes/index.html.erb +5 -1
  53. data/app/views/spree/admin/promotion_codes/new.html.erb +31 -0
  54. data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
  55. data/app/views/spree/admin/promotions/_activations_edit.html.erb +1 -1
  56. data/app/views/spree/admin/promotions/_form.html.erb +4 -3
  57. data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
  58. data/app/views/spree/admin/promotions/edit.html.erb +3 -1
  59. data/app/views/spree/admin/refunds/new.html.erb +1 -1
  60. data/app/views/spree/admin/shared/_address_form.html.erb +10 -3
  61. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +1 -1
  62. data/app/views/spree/admin/shared/_head.html.erb +1 -0
  63. data/app/views/spree/admin/shared/_image.html.erb +2 -2
  64. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +1 -1
  65. data/app/views/spree/admin/shared/_settings_checkout_tabs.html.erb +4 -0
  66. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +3 -3
  67. data/app/views/spree/admin/shared/_tabs.html.erb +3 -2
  68. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  69. data/app/views/spree/admin/stock_items/_stock_management.html.erb +56 -38
  70. data/app/views/spree/admin/stock_locations/_form.html.erb +133 -121
  71. data/app/views/spree/admin/stock_locations/edit.html.erb +4 -2
  72. data/app/views/spree/admin/store_credit_reasons/edit.html.erb +15 -0
  73. data/app/views/spree/admin/store_credit_reasons/index.html.erb +56 -0
  74. data/app/views/spree/admin/store_credit_reasons/new.html.erb +18 -0
  75. data/app/views/spree/admin/store_credit_reasons/shared/_form.html.erb +15 -0
  76. data/app/views/spree/admin/store_credits/_store_credit_reason_field.html.erb +7 -0
  77. data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -1
  78. data/app/views/spree/admin/store_credits/edit_validity.html.erb +1 -1
  79. data/app/views/spree/admin/store_credits/show.html.erb +2 -2
  80. data/app/views/spree/admin/users/items.html.erb +3 -1
  81. data/app/views/spree/admin/users/orders.html.erb +1 -1
  82. data/config/routes.rb +2 -8
  83. data/lib/spree/backend.rb +1 -1
  84. data/solidus_backend.gemspec +3 -4
  85. data/spec/controllers/spree/admin/base_controller_spec.rb +1 -1
  86. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +7 -3
  87. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +50 -2
  88. data/spec/controllers/spree/admin/orders_controller_spec.rb +23 -11
  89. data/spec/controllers/spree/admin/payments_controller_spec.rb +1 -1
  90. data/spec/controllers/spree/admin/products_controller_spec.rb +72 -0
  91. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +13 -1
  92. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +11 -0
  93. data/spec/controllers/spree/admin/resource_controller_spec.rb +22 -0
  94. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +1 -1
  95. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +7 -7
  96. data/spec/features/admin/configuration/payment_methods_spec.rb +2 -2
  97. data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -2
  98. data/spec/features/admin/homepage_spec.rb +1 -6
  99. data/spec/features/admin/orders/listing_spec.rb +1 -1
  100. data/spec/features/admin/orders/new_order_spec.rb +117 -0
  101. data/spec/features/admin/orders/new_refund_spec.rb +35 -0
  102. data/spec/features/admin/orders/order_details_spec.rb +2 -2
  103. data/spec/features/admin/orders/payments_spec.rb +2 -2
  104. data/spec/features/admin/orders/return_payment_state_spec.rb +3 -0
  105. data/spec/features/admin/orders/shipments_spec.rb +28 -0
  106. data/spec/features/admin/products/products_spec.rb +1 -1
  107. data/spec/features/admin/products/stock_management_spec.rb +10 -13
  108. data/spec/features/admin/promotion_adjustments_spec.rb +12 -12
  109. data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -2
  110. data/spec/features/admin/promotions/product_rule_spec.rb +1 -1
  111. data/spec/features/admin/promotions/tiered_calculator_spec.rb +1 -1
  112. data/spec/features/admin/promotions/user_rule_spec.rb +2 -2
  113. data/spec/features/admin/reimbursements_spec.rb +1 -1
  114. data/spec/features/admin/store_credits_spec.rb +51 -2
  115. data/spec/features/admin/taxons_spec.rb +35 -0
  116. data/spec/features/admin/users_spec.rb +22 -11
  117. data/spec/helpers/admin/navigation_helper_spec.rb +4 -2
  118. data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -2
  119. data/spec/javascripts/spec_helper.js +2 -0
  120. data/spec/models/spree/backend_configuration/menu_item_spec.rb +17 -0
  121. data/spec/models/spree/backend_configuration_spec.rb +22 -0
  122. data/spec/spec_helper.rb +1 -0
  123. data/spec/support/feature/order_feature_helper.rb +1 -1
  124. data/spec/views/spree/admin/shared/navigation_footer_spec.rb +1 -1
  125. data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-US.js +10 -0
  126. metadata +26 -34
  127. data/app/controllers/spree/admin/reports_controller.rb +0 -82
  128. data/app/views/spree/admin/reports/index.html.erb +0 -19
  129. data/app/views/spree/admin/reports/sales_total.html.erb +0 -35
  130. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +0 -19
  131. data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +0 -7
  132. data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -133
  133. data/spec/features/admin/reports_spec.rb +0 -63
@@ -1,34 +1,37 @@
1
+ <% admin_layout "full-width" %>
2
+
1
3
  <%= paginate @variants, theme: "solidus_admin" %>
2
4
 
3
5
  <table class="index stock-table" id="listing_product_stock">
4
6
  <colgroup>
5
- <col style="width: 50%" />
6
- <col style="width: 20%" />
7
- <col style="width: 10%" />
8
- <col style="width: 5%" />
9
- <col style="width: 5%" />
10
- <col style="width: 10%" />
7
+ <col style="width: 30%">
8
+ <col style="width: 15%">
9
+ <col style="width: 14%">
10
+ <col style="width: 11%">
11
+ <col style="width: 11%">
12
+ <col style="width: 10%">
13
+ <col style="width: 9%">
11
14
  </colgroup>
12
15
  <thead>
13
16
  <tr>
14
17
  <th><%= t('spree.item') %></th>
15
- <th><%= t('spree.options') %></th>
18
+ <th><%= Spree::Variant.model_name.human %></th>
16
19
  <th><%= Spree::StockLocation.model_name.human %></th>
17
- <th><%= t('spree.backorderable_header') %></th>
18
- <th><%= t('spree.count_on_hand') %></th>
20
+ <th class="align-center"><%= t('spree.backorderable_header') %></th>
21
+ <th class="align-center"><%= t('spree.count_on_hand') %></th>
22
+ <th><%= t('spree.modify_stock_count') %></th>
19
23
  <th class="actions"></th>
20
24
  </tr>
21
25
  </thead>
22
26
  <% variants.each do |variant| %>
23
- <%- locations_without_items = @stock_item_stock_locations - variant.stock_items.flat_map(&:stock_location) %>
24
- <%- display_add_row = locations_without_items.any? && can?(:create, Spree::StockItem) %>
25
- <%- row_count = @stock_item_stock_locations.count + 2 %>
26
27
  <tbody class="variant-stock-items">
27
28
  <tr id="<%= spree_dom_id variant %>">
28
- <td class="no-padding" rowspan="<%= row_count %>">
29
+ <td>
29
30
  <div class='variant-container'>
30
31
  <div class='variant-image'>
31
- <%= render 'spree/admin/shared/image', image: variant.display_image(fallback: false), size: :small %>
32
+ <%= render 'spree/admin/shared/image',
33
+ image: variant.gallery.images.first,
34
+ size: :small %>
32
35
  </div>
33
36
  <div class='variant-details'>
34
37
  <table class='stock-variant-field-table'>
@@ -46,7 +49,7 @@
46
49
  </div>
47
50
  </div>
48
51
  </td>
49
- <td rowspan="<%= row_count %>">
52
+ <td class="align-center">
50
53
  <table class='stock-variant-field-table'>
51
54
  <% variant.option_values.sort_by(&:option_type_name).each do |option_value| %>
52
55
  <tr>
@@ -58,30 +61,45 @@
58
61
  <% end %>
59
62
  </table>
60
63
  </td>
64
+ <td class="stock-location-items-cell" colspan="5">
65
+ <table class="stock-location-items-table">
66
+ <colgroup>
67
+ <col style="width: 25%" />
68
+ <col style="width: 20%" />
69
+ <col style="width: 20%" />
70
+ <col style="width: 20%" />
71
+ <col style="width: 15%" />
72
+ </colgroup>
73
+ <% variant.stock_items.each do |item| %>
74
+ <% if @stock_item_stock_locations.include?(item.stock_location) %>
75
+ <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>">
76
+ <%# This is rendered in JS %>
77
+ </tr>
78
+ <% end %>
79
+ <% end %>
80
+ <% locations_without_items = @stock_item_stock_locations - variant.stock_items.flat_map(&:stock_location) %>
81
+ <% if locations_without_items.any? && can?(:create, Spree::StockItem) %>
82
+ <tr class="js-add-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>">
83
+ <form>
84
+ <td class='location-name-cell'>
85
+ <%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), class: 'custom-select', prompt: t('spree.add_to_stock_location'), id: "variant-stock-location-#{variant.id}" %>
86
+ </td>
87
+ <td class="align-center">
88
+ <%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %>
89
+ </td>
90
+ <td>
91
+ <%= number_field_tag :count_on_hand, "", class: 'fullwidth', id: "variant-count-on-hand-#{variant.id}" %>
92
+ </td>
93
+ <td></td>
94
+ <td class="actions">
95
+ <%= link_to_with_icon 'plus', t('spree.actions.create'), '#', no_text: true, data: { action: 'add' }, class: "submit" %>
96
+ </td>
97
+ </form>
98
+ </tr>
99
+ <% end %>
100
+ </table>
101
+ </td>
61
102
  </tr>
62
- <% variant.stock_items.each do |item| %>
63
- <% if @stock_item_stock_locations.include?(item.stock_location) %>
64
- <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>">
65
- <%# This is rendered in JS %>
66
- </tr>
67
- <% end %>
68
- <% end %>
69
- <% if display_add_row %>
70
- <tr class="js-add-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>">
71
- <td class='location-name-cell'>
72
- <%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), { include_blank: true, class: 'custom-select', "data-placeholder" => t('spree.add_to_stock_location'), id: "variant-stock-location-#{variant.id}" } %>
73
- </td>
74
- <td class="align-center">
75
- <%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %>
76
- </td>
77
- <td class="align-center">
78
- <%= number_field_tag :count_on_hand, "", class: 'fullwidth', id: "variant-count-on-hand-#{variant.id}" %>
79
- </td>
80
- <td class="actions">
81
- <%= link_to_with_icon 'plus', t('spree.actions.create'), '#', no_text: true, data: { action: 'add' }, class: "submit" %>
82
- </td>
83
- </tr>
84
- <% end %>
85
103
  </tbody>
86
104
  <% end %>
87
105
  </table>
@@ -1,122 +1,134 @@
1
- <div data-hook="admin_stock_locations_form_fields" class="js-addresses-form">
2
- <fieldset class="no-border-bottom">
3
- <legend><%= t('.general') %></legend>
4
-
5
- <%= f.field_container :name do %>
6
- <%= f.label :name, class: 'required' %><br />
7
- <%= f.text_field :name, class: 'fullwidth', required: true %>
8
- <% end %>
9
-
10
- <%= f.field_container :code do %>
11
- <%= f.label :code %>
12
- <%= f.text_field :code, :class => 'fullwidth', :label => false %>
13
- <% end %>
14
-
15
- <%= f.field_container :admin_name do %>
16
- <%= f.label :admin_name %>
17
- <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
18
- <% end %>
19
- </fieldset>
20
-
21
- <fieldset class="no-border-bottom">
22
- <legend><%= t('.settings') %></legend>
23
-
24
- <%= f.field_container :active do %>
25
- <label>
26
- <%= f.check_box :active %>
27
- <%= Spree::StockLocation.human_attribute_name :active %>
28
- <%= f.field_hint :active %>
29
- </label>
30
- <% end %>
31
-
32
- <%= f.field_container :default do %>
33
- <label>
34
- <%= f.check_box :default %>
35
- <%= Spree::StockLocation.human_attribute_name :default %>
36
- </label>
37
- <% end %>
38
-
39
- <%= f.field_container :backorderable_default do %>
40
- <label>
41
- <%= f.check_box :backorderable_default %>
42
- <%= Spree::StockLocation.human_attribute_name :backorderable_default %>
43
- <%= f.field_hint :backorderable_default %>
44
- </label>
45
- <% end %>
46
-
47
- <%= f.field_container :propagate_all_variants do %>
48
- <label>
49
- <%= f.check_box :propagate_all_variants %>
50
- <%= Spree::StockLocation.human_attribute_name :propagate_all_variants %>
51
- <%= f.field_hint :propagate_all_variants %>
52
- </label>
53
- <% end %>
54
-
55
- <%= f.field_container :restock_inventory do %>
56
- <label>
57
- <%= f.check_box :restock_inventory %>
58
- <%= Spree::StockLocation.human_attribute_name :restock_inventory %>
59
- <%= f.field_hint :restock_inventory %>
60
- </label>
61
- <% end %>
62
-
63
- <%= f.field_container :fulfillable do %>
64
- <label>
65
- <%= f.check_box :fulfillable %>
66
- <%= Spree::StockLocation.human_attribute_name :fulfillable %>
67
- <%= f.field_hint :fulfillable %>
68
- </label>
69
- <% end %>
70
-
71
- <%= f.field_container :check_stock_on_transfer do %>
72
- <label>
73
- <%= f.check_box :check_stock_on_transfer %>
74
- <%= Spree::StockLocation.human_attribute_name :check_stock_on_transfer %>
75
- <%= f.field_hint :check_stock_on_transfer %>
76
- </label>
77
- <% end %>
78
- </fieldset>
79
-
80
- <fieldset>
81
- <legend><%= t('.address') %></legend>
82
-
83
- <%= f.field_container :check_stock_on_transfer do %>
84
- <%= f.label :address1 %>
85
- <%= f.text_field :address1, class: 'fullwidth' %>
86
- <% end %>
87
-
88
- <%= f.field_container :address2 do %>
89
- <%= f.label :address2 %>
90
- <%= f.text_field :address2, class: 'fullwidth' %>
91
- <% end %>
92
-
93
- <%= f.field_container :city do %>
94
- <%= f.label :city %>
95
- <%= f.text_field :city, class: 'fullwidth' %>
96
- <% end %>
97
-
98
- <%= f.field_container :zipcode do %>
99
- <%= f.label :zipcode %>
100
- <%= f.text_field :zipcode, class: 'fullwidth' %>
101
- <% end %>
102
-
103
- <%= f.field_container :phone do %>
104
- <%= f.label :phone %>
105
- <%= f.phone_field :phone, class: 'fullwidth' %>
106
- <% end %>
107
-
108
- <%= f.field_container :country_id do %>
109
- <%= f.label :country_id %>
110
- <span id="country"><%= f.collection_select :country_id, available_countries(restrict_to_zone: nil), :id, :name, { include_blank: true }, { class: 'custom-select js-country_id fullwidth' } %></span>
111
- <% end %>
112
-
113
- <%= f.field_container :state do %>
114
- <% country = f.object.country %>
115
- <%= f.label :state_id %>
116
- <span id="state" class="region">
117
- <%= f.text_field :state_name, style: "display: none", class: 'fullwidth state_name js-state_name' %>
118
- <%= f.collection_select :state_id, country ? country.states.sort : [], :id, :name, { include_blank: true }, {class: 'custom-select fullwidth js-state_id', style: "display: none" } %>
119
- </span>
120
- <% end %>
121
- </fieldset>
1
+ <div data-hook="admin_stock_locations_form_fields" class="js-addresses-form row">
2
+ <div class="col-md-6">
3
+ <fieldset class="no-border-bottom">
4
+ <legend><%= t('.general') %></legend>
5
+
6
+ <%= f.field_container :name do %>
7
+ <%= f.label :name, class: 'required' %><br />
8
+ <%= f.text_field :name, class: 'fullwidth', required: true %>
9
+ <% end %>
10
+
11
+ <%= f.field_container :code do %>
12
+ <%= f.label :code %>
13
+ <%= f.text_field :code, :class => 'fullwidth', :label => false %>
14
+ <% end %>
15
+
16
+ <%= f.field_container :admin_name do %>
17
+ <%= f.label :admin_name %>
18
+ <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
19
+ <% end %>
20
+ </fieldset>
21
+ </div>
22
+
23
+ <div class="col-md-6">
24
+ <fieldset class="no-border-bottom">
25
+ <legend><%= t('.address') %></legend>
26
+
27
+ <%= f.field_container :check_stock_on_transfer do %>
28
+ <%= f.label :address1 %>
29
+ <%= f.text_field :address1, class: 'fullwidth' %>
30
+ <% end %>
31
+
32
+ <%= f.field_container :address2 do %>
33
+ <%= f.label :address2 %>
34
+ <%= f.text_field :address2, class: 'fullwidth' %>
35
+ <% end %>
36
+
37
+ <%= f.field_container :city do %>
38
+ <%= f.label :city %>
39
+ <%= f.text_field :city, class: 'fullwidth' %>
40
+ <% end %>
41
+
42
+ <%= f.field_container :zipcode do %>
43
+ <%= f.label :zipcode %>
44
+ <%= f.text_field :zipcode, class: 'fullwidth' %>
45
+ <% end %>
46
+
47
+ <%= f.field_container :phone do %>
48
+ <%= f.label :phone %>
49
+ <%= f.phone_field :phone, class: 'fullwidth' %>
50
+ <% end %>
51
+
52
+ <%= f.field_container :country_id do %>
53
+ <%= f.label :country_id %>
54
+ <span id="country"><%= f.collection_select :country_id, available_countries(restrict_to_zone: nil), :id, :name, { include_blank: true }, { class: 'custom-select js-country_id fullwidth' } %></span>
55
+ <% end %>
56
+
57
+ <%= f.field_container :state do %>
58
+ <% country = f.object.country %>
59
+ <%= f.label :state_id %>
60
+ <span id="state" class="region">
61
+ <%= f.text_field :state_name, style: "display: none", class: 'fullwidth state_name js-state_name' %>
62
+ <%= f.collection_select :state_id, country ? country.states.sort : [], :id, :name, { include_blank: true }, {class: 'custom-select fullwidth js-state_id', style: "display: none" } %>
63
+ </span>
64
+ <% end %>
65
+ </fieldset>
66
+ </div>
67
+
68
+ <div class="col-md-12">
69
+ <fieldset class="no-border-bottom">
70
+ <legend><%= t('.settings') %></legend>
71
+
72
+ <div class="row">
73
+ <div class="col-md-6">
74
+ <%= f.field_container :active do %>
75
+ <label>
76
+ <%= f.check_box :active %>
77
+ <%= Spree::StockLocation.human_attribute_name :active %>
78
+ <%= f.field_hint :active %>
79
+ </label>
80
+ <% end %>
81
+
82
+ <%= f.field_container :default do %>
83
+ <label>
84
+ <%= f.check_box :default %>
85
+ <%= Spree::StockLocation.human_attribute_name :default %>
86
+ </label>
87
+ <% end %>
88
+
89
+ <%= f.field_container :backorderable_default do %>
90
+ <label>
91
+ <%= f.check_box :backorderable_default %>
92
+ <%= Spree::StockLocation.human_attribute_name :backorderable_default %>
93
+ <%= f.field_hint :backorderable_default %>
94
+ </label>
95
+ <% end %>
96
+ </div>
97
+
98
+ <div class="col-md-6">
99
+ <%= f.field_container :propagate_all_variants do %>
100
+ <label>
101
+ <%= f.check_box :propagate_all_variants %>
102
+ <%= Spree::StockLocation.human_attribute_name :propagate_all_variants %>
103
+ <%= f.field_hint :propagate_all_variants %>
104
+ </label>
105
+ <% end %>
106
+
107
+ <%= f.field_container :restock_inventory do %>
108
+ <label>
109
+ <%= f.check_box :restock_inventory %>
110
+ <%= Spree::StockLocation.human_attribute_name :restock_inventory %>
111
+ <%= f.field_hint :restock_inventory %>
112
+ </label>
113
+ <% end %>
114
+
115
+ <%= f.field_container :fulfillable do %>
116
+ <label>
117
+ <%= f.check_box :fulfillable %>
118
+ <%= Spree::StockLocation.human_attribute_name :fulfillable %>
119
+ <%= f.field_hint :fulfillable %>
120
+ </label>
121
+ <% end %>
122
+
123
+ <%= f.field_container :check_stock_on_transfer do %>
124
+ <label>
125
+ <%= f.check_box :check_stock_on_transfer %>
126
+ <%= Spree::StockLocation.human_attribute_name :check_stock_on_transfer %>
127
+ <%= f.field_hint :check_stock_on_transfer %>
128
+ </label>
129
+ <% end %>
130
+ </div>
131
+ </div>
132
+ </fieldset>
133
+ </div>
122
134
  </div>
@@ -19,6 +19,8 @@
19
19
  <%= render partial: 'spree/shared/error_messages', locals: { target: @stock_location } %>
20
20
 
21
21
  <%= form_for [:admin, @stock_location] do |f| %>
22
- <%= render :partial => 'form', :locals => { :f => f } %>
23
- <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
22
+ <fieldset class="no-border-top">
23
+ <%= render 'form', f: f %>
24
+ <%= render 'spree/admin/shared/edit_resource_links' %>
25
+ </fieldset>
24
26
  <% end %>
@@ -0,0 +1,15 @@
1
+ <%= render 'spree/admin/shared/settings_checkout_tabs' %>
2
+
3
+ <% admin_breadcrumb t('spree.settings') %>
4
+ <% admin_breadcrumb t('spree.admin.tab.checkout') %>
5
+ <% admin_breadcrumb link_to plural_resource_name(Spree::StoreCreditReason), spree.admin_store_credit_reasons_path %>
6
+ <% admin_breadcrumb @object.name %>
7
+
8
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @object } %>
9
+
10
+ <%= form_for [:admin, @object] do |f| %>
11
+ <fieldset class='no-border-top' data-hook='edit_store_credit_reason'>
12
+ <%= render partial: 'spree/admin/store_credit_reasons/shared/form', locals: { f: f } %>
13
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
14
+ </fieldset>
15
+ <% end %>
@@ -0,0 +1,56 @@
1
+ <%= render 'spree/admin/shared/settings_checkout_tabs' %>
2
+
3
+ <% admin_breadcrumb(t('spree.settings')) %>
4
+ <% admin_breadcrumb(t('spree.admin.tab.checkout')) %>
5
+ <% admin_breadcrumb(plural_resource_name(Spree::StoreCreditReason)) %>
6
+
7
+ <% content_for :page_actions do %>
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>
12
+ </ul>
13
+ <% end %>
14
+
15
+ <% if @collection.any? %>
16
+ <table class='index' id='listing_store_credit_reasons'>
17
+ <colgroup>
18
+ <col style='width: 65%' />
19
+ <col style='width: 20%' />
20
+ <col style='width: 15%' />
21
+ </colgroup>
22
+ <thead>
23
+ <tr data-hook='store_credit_reasons_header'>
24
+ <th><%= Spree::StoreCreditReason.human_attribute_name(:name) %></th>
25
+ <th><%= Spree::StoreCreditReason.human_attribute_name(:state) %></th>
26
+ <th class='actions'></th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ <% @collection.each do |store_credit_reason| %>
31
+ <tr id='<%= spree_dom_id store_credit_reason %>' data-hook='store_credit_reason_row'>
32
+ <td>
33
+ <%= store_credit_reason.name %>
34
+ </td>
35
+ <td>
36
+ <span class="pill pill-<%= store_credit_reason.active? ? 'active' : 'inactive' %>">
37
+ <%= t(store_credit_reason.active? ? :active : :inactive, scope: 'spree') %>
38
+ </span>
39
+ </td>
40
+ <td class='actions'>
41
+ <%= link_to_edit store_credit_reason, no_text: true %>
42
+ <% if can?(:destroy, store_credit_reason) %>
43
+ <%= link_to_delete store_credit_reason, no_text: true %>
44
+ <% end %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ <% else %>
51
+ <div class='no-objects-found'>
52
+ <%= render 'spree/admin/shared/no_objects_found',
53
+ resource: Spree::StoreCreditReason,
54
+ new_resource_url: new_object_url %>
55
+ </div>
56
+ <% end %>