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
@@ -25,7 +25,9 @@
25
25
  <% @inventory_units.each do |inventory_unit| %>
26
26
  <tr class="inventory-unit">
27
27
  <td class="inventory-unit-image">
28
- <%= render 'spree/admin/shared/image', image: inventory_unit.variant.display_image, size: :mini %>
28
+ <%= render 'spree/admin/shared/image',
29
+ image: (inventory_unit.variant.gallery.images.first || inventory_unit.variant.product.gallery.images.first),
30
+ size: :mini %>
29
31
  </td>
30
32
  <td class="inventory-unit-name">
31
33
  <%= inventory_unit.variant.product.name %><br><%= "(" + variant_options(inventory_unit.variant) + ")" unless inventory_unit.variant.option_values.empty? %>
@@ -16,7 +16,7 @@
16
16
  title: image.alt,
17
17
  content: %{
18
18
  <div class='align-center'>
19
- #{image_tag(image.attachment.url(:large))}
19
+ #{image_tag(image.url(:large))}
20
20
  </div>
21
21
  }.html_safe
22
22
  ) %>
@@ -3,7 +3,7 @@
3
3
  <%= render partial: 'spree/shared/error_messages', locals: { target: @image } %>
4
4
 
5
5
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Image), admin_product_images_path(@product)) %>
6
- <% admin_breadcrumb(@image.attachment_file_name) %>
6
+ <% admin_breadcrumb(@image.filename) %>
7
7
 
8
8
 
9
9
  <% content_for :page_actions do %>
@@ -12,12 +12,12 @@
12
12
 
13
13
  <%= form_for [:admin, @product, @image], html: { multipart: true } do |f| %>
14
14
  <fieldset data-hook="edit_image">
15
- <legend align="center"><%= @image.attachment_file_name%></legend>
15
+ <legend align="center"><%= @image.filename %></legend>
16
16
 
17
17
  <div class="row">
18
18
  <div data-hook="thumbnail" class="field col-2 align-center">
19
19
  <%= f.label t('spree.thumbnail') %><br>
20
- <%= link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:product) %>
20
+ <%= link_to image_tag(@image.url(:small)), @image.url(:product) %>
21
21
  </div>
22
22
  <div class="col-10">
23
23
  <%= render partial: 'form', locals: { f: f } %>
@@ -37,7 +37,7 @@
37
37
  <div id="progress-zone" class="row"></div>
38
38
  </fieldset>
39
39
 
40
- <% no_images = @product.images.empty? && @product.variant_images.empty? %>
40
+ <% no_images = @product.gallery.images.empty? %>
41
41
 
42
42
  <table class="index sortable inline-editable-table <%= 'hidden' if no_images %>" id="images-table" data-hook="images_table" data-sortable-link="<%= update_positions_admin_product_images_url(@product) %>">
43
43
  <colgroup>
@@ -63,7 +63,7 @@
63
63
  </thead>
64
64
 
65
65
  <tbody>
66
- <%= render partial: 'image_row', collection: @product.variant_images, as: :image %>
66
+ <%= render partial: 'image_row', collection: @product.gallery.images, as: :image %>
67
67
  </tbody>
68
68
  </table>
69
69
 
@@ -13,13 +13,13 @@
13
13
  <thead>
14
14
  <tr class="log_entry <%= entry.parsed_details.success? ? 'success' : 'fail' %>">
15
15
  <td colspan='2'>
16
- <h4><i class='fa fa-<%= entry.parsed_details.success? ? 'ok-circle' : 'remove-sign' %>'></i> <%= pretty_time(entry.created_at) %></h4>
16
+ <h4><i class='fa fa-<%= entry.parsed_details.success? ? 'check' : 'remove' %>'></i> <%= pretty_time(entry.created_at) %></h4>
17
17
  </td>
18
18
  </tr>
19
19
  </thead>
20
20
  <tbody>
21
21
  <tr>
22
- <td>Message</td>
22
+ <td><%= Spree::LogEntry.human_attribute_name(:details) %></td>
23
23
  <td>
24
24
  <pre><%= entry.parsed_details.message %></pre>
25
25
  </td>
@@ -1,7 +1,9 @@
1
1
  <% carton.manifest_for_order(order).each do |item| %>
2
2
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
3
3
  <td class="item-image">
4
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
4
+ <%= render 'spree/admin/shared/image',
5
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
6
+ size: :mini %>
5
7
  </td>
6
8
  <td class="item-name">
7
9
  <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -4,7 +4,9 @@
4
4
  data-variant-id="<%= item.variant.id %>"
5
5
  >
6
6
  <td class="item-image align-center">
7
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
7
+ <%= render 'spree/admin/shared/image',
8
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
9
+ size: :mini %>
8
10
  </td>
9
11
  <td class="item-name">
10
12
  <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -9,10 +9,11 @@
9
9
 
10
10
  <tbody>
11
11
  <% order.line_items.each do |item| %>
12
-
13
12
  <tr class="line-item" id="line-item-<%= item.id %>">
14
13
  <td class="line-item-image">
15
- <%= mini_image(item.variant) %>
14
+ <%= render 'spree/admin/shared/image',
15
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
16
+ size: :mini %>
16
17
  </td>
17
18
  <td class="line-item-name">
18
19
  <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -1,7 +1,9 @@
1
1
  <% shipment.manifest.each do |item| %>
2
2
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
3
3
  <td class="item-image">
4
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
4
+ <%= render 'spree/admin/shared/image',
5
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
6
+ size: :mini %>
5
7
  </td>
6
8
  <td class="item-name">
7
9
  <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -10,7 +10,7 @@
10
10
  <% end if can? :create, Spree::Order %>
11
11
 
12
12
  <% content_for :table_filter_title do %>
13
- <%= t('spree.search') %>
13
+ <%= t('spree.filter') %>
14
14
  <% end %>
15
15
 
16
16
  <% content_for :table_filter do %>
@@ -82,6 +82,13 @@
82
82
  <% end %>
83
83
  </div>
84
84
 
85
+ <div data-hook="admin_product_form_sku">
86
+ <%= f.field_container :sku do %>
87
+ <%= f.label :sku, t('spree.master_sku') %>
88
+ <%= f.text_field :sku, size: 16 %>
89
+ <% end %>
90
+ </div>
91
+
85
92
  <% if @product.has_variants? %>
86
93
  <div data-hook="admin_product_form_multiple_variants">
87
94
  <%= f.label :skus, t('spree.skus') %>
@@ -102,13 +109,6 @@
102
109
  <% end %>
103
110
  </div>
104
111
  </div>
105
- <% else %>
106
- <div data-hook="admin_product_form_sku">
107
- <%= f.field_container :sku do %>
108
- <%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %>
109
- <%= f.text_field :sku, size: 16 %>
110
- <% end %>
111
- </div>
112
112
 
113
113
  <div id="shipping_specs" class="row">
114
114
  <% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
@@ -4,6 +4,11 @@
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) %>
8
+ <li id="view_product_link">
9
+ <%= link_to t('spree.view_product'), spree.product_path(@product), id: 'admin_view_product', class: 'btn btn-primary ml-2' %>
10
+ </li>
11
+ <% end %>
7
12
  <% end %>
8
13
 
9
14
  <%= render partial: 'spree/admin/shared/product_tabs', locals: { current: 'Product Details' } %>
@@ -74,7 +74,9 @@
74
74
  <% @collection.each do |product| %>
75
75
  <tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows">
76
76
  <td><%= product.sku %></td>
77
- <td class="align-center"><%= render 'spree/admin/shared/image', image: product.display_image, size: :mini %></td>
77
+ <td class="align-center">
78
+ <%= render 'spree/admin/shared/image', image: product.gallery.images.first, size: :mini %>
79
+ </td>
78
80
  <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
79
81
  <td class="align-right"><%= product.display_price.to_html %></td>
80
82
  <td class="actions" data-hook="admin_products_index_row_actions">
@@ -1,5 +1,5 @@
1
1
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path) %>
2
- <% admin_breadcrumb(Spree::PromotionCategory.model_name.human(count: :many)) %>
2
+ <% admin_breadcrumb(plural_resource_name(Spree::PromotionCategory)) %>
3
3
 
4
4
 
5
5
  <% content_for :page_actions do %>
@@ -37,7 +37,7 @@
37
37
  number_of_codes: promotion_code_batch.number_of_codes
38
38
  ) %>
39
39
  <%= link_to(
40
- t('spree.download_promotion_code_list'),
40
+ t('spree.download_promotion_codes_list'),
41
41
  admin_promotion_promotion_code_batch_download_path(
42
42
  promotion_code_batch_id: promotion_code_batch.id,
43
43
  format: :csv
@@ -4,7 +4,11 @@
4
4
 
5
5
  <% content_for :page_actions do %>
6
6
  <li>
7
- <%= link_to t('spree.download_promotion_code_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
7
+ <% if can?(:create, Spree::PromotionCode) %>
8
+ <%= link_to t('spree.create_promotion_code'), new_admin_promotion_promotion_code_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
9
+ <% end %>
10
+
11
+ <%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
8
12
  </li>
9
13
  <% end %>
10
14
 
@@ -0,0 +1,31 @@
1
+ <% admin_breadcrumb link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path %>
2
+ <% admin_breadcrumb link_to(@promotion.name, spree.edit_admin_promotion_path(@promotion)) %>
3
+ <% admin_breadcrumb plural_resource_name(Spree::PromotionCode) %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <li>
7
+ <%= link_to t('spree.view_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
8
+
9
+ <%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
10
+ </li>
11
+ <% end %>
12
+
13
+ <%= form_for [:admin, @promotion, @promotion_code], method: :post do |f| %>
14
+ <fieldset class="no-border-top">
15
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @promotion_code } %>
16
+
17
+ <div class="row">
18
+ <div class="col-4">
19
+ <%= f.field_container :value do %>
20
+ <%= f.label :value, class: 'required' %>
21
+ <%= f.text_field :value, class: 'fullwidth', required: true %>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
27
+ <%= button_tag t('spree.actions.create'), class: 'btn btn-primary' %>
28
+ <%= link_to t('spree.actions.cancel'), admin_promotion_promotion_codes_url(@promotion), class: 'button' %>
29
+ </div>
30
+ </fieldset>
31
+ <% end %>
@@ -6,7 +6,7 @@
6
6
  <legend align="center"><%= t('spree.promotion_actions') %></legend>
7
7
  <% if can?(:update, @promotion) %>
8
8
  <div class="field">
9
- <%= label_tag :action_type, t('spree.add_action_of_type')%>
9
+ <%= label_tag :action_type, t('spree.adjustment_type')%>
10
10
  <%= select_tag 'action_type', options, include_blank: t(:choose_promotion_action, scope: 'spree'), class: 'custom-select fullwidth' %>
11
11
  </div>
12
12
  <div class="filter-actions actions">
@@ -18,5 +18,5 @@
18
18
  <div class="field">
19
19
  <%= f.label :path %>
20
20
  <%= f.text_field :path, class: "fullwidth" %>
21
- </p>
21
+ </div>
22
22
  <% end %>
@@ -1,7 +1,5 @@
1
1
  <%= render partial: 'spree/shared/error_messages', locals: { target: @promotion } %>
2
- <fieldset class="form-group no-border-bottom">
3
- <legend><%= t '.general' %></legend>
4
-
2
+ <fieldset class="form-group no-border-bottom no-border-top">
5
3
  <div class="row">
6
4
  <div id="general_fields" class="col-9">
7
5
  <div class="row">
@@ -14,6 +12,9 @@
14
12
  <%= f.field_container :description do %>
15
13
  <%= f.label :description %><br />
16
14
  <%= f.text_area :description, rows: 7, class: 'fullwidth' %>
15
+ <span class="info">
16
+ <%= t('spree.character_limit') %>
17
+ </span>
17
18
  <% end %>
18
19
 
19
20
  <%= f.field_container :category do %>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% if can?(:update, @promotion) %>
8
8
  <div class="field">
9
- <%= label_tag :promotion_rule_type, t('spree.add_rule_of_type') %>
9
+ <%= label_tag :promotion_rule_type, t('spree.discount_rules') %>
10
10
  <%= select_tag('promotion_rule[type]', options_for_promotion_rule_types(@promotion), include_blank: t(:choose_promotion_rule, scope: 'spree'), class: 'custom-select fullwidth') %>
11
11
  </div>
12
12
  <div class="filter-actions actions">
@@ -6,7 +6,9 @@
6
6
  <% content_for :page_actions do %>
7
7
  <li>
8
8
  <% if can?(:display, Spree::PromotionCode) %>
9
- <%= link_to t('spree.download_promotion_code_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
9
+ <%= link_to t('spree.view_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
10
+
11
+ <%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
10
12
  <% end %>
11
13
 
12
14
  <% if can?(:display, Spree::PromotionCodeBatch) %>
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
 
37
37
  <div class="form-buttons filter-actions actions" data-hook="buttons">
38
- <%= button_tag Spree::Refund.model_name.human, class: 'btn btn-primary' %>
38
+ <%= f.submit Spree::Refund.model_name.human, class: 'btn btn-primary' %>
39
39
  <%= link_to t('spree.actions.cancel'), admin_order_payments_url(@refund.payment.order), class: 'btn btn-primary' %>
40
40
  </div>
41
41
  </fieldset>
@@ -49,11 +49,18 @@
49
49
  <%= f.label :state_id, Spree::State.model_name.human %>
50
50
  <span id="<%= s_or_b %>state">
51
51
  <%= f.hidden_field :state_name, value: nil %>
52
+ <% states = f.object.country.try(:states).nil? ? [] : f.object.country.states %>
52
53
  <%= f.text_field :state_name,
53
- style: "display: #{f.object.country.states.empty? ? 'block' : 'none' };",
54
- disabled: !f.object.country.states.empty?, class: 'fullwidth state_name js-state_name' %>
54
+ style: "display: #{states.empty? ? 'block' : 'none' };",
55
+ disabled: !states.empty?, class: 'fullwidth state_name js-state_name' %>
55
56
  <%= f.hidden_field :state_id, value: nil %>
56
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, {include_blank: true}, {class: 'custom-select fullwidth js-state_id', style: "display: #{f.object.country.states.empty? ? 'none' : 'block' };", disabled: f.object.country.states.empty?} %>
57
+ <%= f.collection_select :state_id,
58
+ states.sort,
59
+ :id, :name,
60
+ { include_blank: true },
61
+ { class: 'custom-select fullwidth js-state_id',
62
+ style: "display: #{states.empty? ? 'none' : 'block' };",
63
+ disabled: states.empty? } %>
57
64
  </span>
58
65
  </div>
59
66
 
@@ -1,4 +1,4 @@
1
1
  <div class="form-buttons filter-actions actions" data-hook="buttons">
2
2
  <%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
3
- <%= link_to t('spree.actions.cancel'), collection_url, class: 'btn btn-primary' %>
3
+ <%= link_to t('spree.actions.cancel'), collection_url, class: 'button' %>
4
4
  </div>
@@ -8,6 +8,7 @@
8
8
  <!-- Get "Open Sans" font from Google -->
9
9
  <link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'>
10
10
 
11
+ <%= favicon_link_tag 'favicon.ico' %>
11
12
  <%= stylesheet_link_tag 'spree/backend/all', media: 'all', data: {turbolinks_track: 'reload'} %>
12
13
  <%= javascript_include_tag 'spree/backend/all', data: {turbolinks_track: 'reload'} %>
13
14
 
@@ -1,7 +1,7 @@
1
1
  <% size ||= :mini %>
2
2
 
3
- <% if image && image.attachment? %>
4
- <%= image_tag image.attachment(size) %>
3
+ <% if image_url = image.try(:url, size) %>
4
+ <%= image_tag image_url %>
5
5
  <% else %>
6
6
  <span class="image-placeholder <%= size %>"></span>
7
7
  <% end %>
@@ -12,6 +12,6 @@
12
12
  <%= tab :taxonomies %>
13
13
  <% end %>
14
14
  <% if can? :admin, Spree::Taxon %>
15
- <%= tab :taxons, label: :display_order %>
15
+ <%= tab :taxons, label: :display_order, match_path: '/taxons' %>
16
16
  <% end %>
17
17
  </ul>
@@ -16,6 +16,10 @@
16
16
  <% if can?(:display, Spree::AdjustmentReason) %>
17
17
  <%= settings_tab_item plural_resource_name(Spree::AdjustmentReason), spree.admin_adjustment_reasons_path %>
18
18
  <% end %>
19
+
20
+ <% if can?(:display, Spree::StoreCreditReason) %>
21
+ <%= settings_tab_item plural_resource_name(Spree::StoreCreditReason), spree.admin_store_credit_reasons_path %>
22
+ <% end %>
19
23
  </ul>
20
24
  </nav>
21
25
  <% end %>
@@ -8,12 +8,12 @@
8
8
  <% end %>
9
9
 
10
10
  <% if can?(:display, Spree::TaxCategory) || can?(:display, Spree::TaxRate) %>
11
- <%= tab :taxes, url: spree.admin_tax_categories_path %>
11
+ <%= tab :taxes, url: spree.admin_tax_categories_path, match_path: %r(tax_categories|tax_rates) %>
12
12
  <% end %>
13
13
 
14
14
  <% if can?(:display, Spree::RefundReason) || can?(:display, Spree::ReimbursementType) ||
15
- can?(:display, Spree::ReturnReason) || can?(:display, Spree::AdjustmentReason) %>
16
- <%= tab :checkout, url: spree.admin_refund_reasons_path %>
15
+ can?(:display, Spree::ReturnReason) || can?(:display, Spree::AdjustmentReason) %>
16
+ <%= tab :checkout, url: spree.admin_refund_reasons_path, match_path: %r(refund_reasons|reimbursement_types|return_reasons|adjustment_reasons) %>
17
17
  <% end %>
18
18
 
19
19
  <% if can?(:display, Spree::ShippingMethod) || can?(:display, Spree::ShippingCategory) || can?(:display, Spree::StockLocation) %>
@@ -1,11 +1,12 @@
1
- <% Spree::Backend::Config.menu_items.each do |menu_item| %>
1
+ <% Spree::Backend::Config.menu_items.sort_by { |item| item.position || Float::INFINITY }.each do |menu_item| %>
2
2
  <% if instance_exec(&menu_item.condition) %>
3
3
  <%=
4
4
  tab(
5
5
  *menu_item.sections,
6
6
  icon: menu_item.icon,
7
7
  label: menu_item.label,
8
- url: menu_item.url.is_a?(Symbol) ? spree.public_send(menu_item.url) : menu_item.url
8
+ url: menu_item.url.is_a?(Symbol) ? spree.public_send(menu_item.url) : menu_item.url,
9
+ match_path: menu_item.match_path,
9
10
  ) do
10
11
  %>
11
12
  <%- render partial: menu_item.partial if menu_item.partial %>
@@ -4,7 +4,7 @@
4
4
  <div class="field-block col-3">
5
5
  <div class="field">
6
6
  <%= label_tag nil, Spree::StockLocation.model_name.human %>
7
- <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { include_blank: true, class: 'custom-select fullwidth', "data-placeholder" => t('spree.select_a_stock_location') } %>
7
+ <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { include_blank: t('spree.all'), class: 'custom-select fullwidth', "data-placeholder" => t('spree.select_a_stock_location') } %>
8
8
  </div>
9
9
  </div>
10
10
  <div class="<%= if content_for?(:sidebar) then 'col-6' else 'col-9' end %>">