spree_backend 4.2.4 → 4.3.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/config/spree_backend_manifest.js +129 -0
  4. data/app/assets/images/backend-arrows-fullscreen.svg +3 -0
  5. data/app/assets/images/backend-box.svg +3 -0
  6. data/app/assets/images/backend-circle-fill.svg +3 -0
  7. data/app/assets/images/backend-circle.svg +3 -0
  8. data/app/assets/images/backend-default-layout.svg +6 -0
  9. data/app/assets/images/backend-eye-slash-fill.svg +4 -0
  10. data/app/assets/images/backend-file-richtext.svg +4 -0
  11. data/app/assets/images/backend-fullscreen-exit.svg +3 -0
  12. data/app/assets/images/backend-fullscreen.svg +3 -0
  13. data/app/assets/images/backend-mobile.svg +5 -0
  14. data/app/assets/images/backend-pages.svg +10 -0
  15. data/app/assets/images/backend-phone.svg +4 -0
  16. data/app/assets/images/backend-reversed-layout.svg +6 -0
  17. data/app/assets/images/backend-spree-icon.svg +1 -0
  18. data/app/assets/images/backend-spree-logo.svg +6 -0
  19. data/app/assets/images/backend-store.svg +2 -13
  20. data/app/assets/images/backend-translate.svg +4 -0
  21. data/app/assets/images/backend-users.svg +2 -5
  22. data/app/assets/images/backend-window-sidebar.svg +4 -0
  23. data/app/assets/images/noimage/backend-missing-image.svg +4 -0
  24. data/app/assets/images/noimage/large.png +0 -0
  25. data/app/assets/images/noimage/mini.png +0 -0
  26. data/app/assets/images/noimage/product.png +0 -0
  27. data/app/assets/images/noimage/small.png +0 -0
  28. data/app/assets/javascripts/spree/backend/address_states.es6 +44 -0
  29. data/app/assets/javascripts/spree/backend/admin.js +45 -307
  30. data/app/assets/javascripts/spree/backend/checkouts/edit.js +22 -13
  31. data/app/assets/javascripts/spree/backend/cms/_index.es6 +4 -0
  32. data/app/assets/javascripts/spree/backend/cms/links.es6 +25 -0
  33. data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +34 -0
  34. data/app/assets/javascripts/spree/backend/cms/page.es6 +133 -0
  35. data/app/assets/javascripts/spree/backend/cms/section.es6 +43 -0
  36. data/app/assets/javascripts/spree/backend/global/_index.js +11 -0
  37. data/app/assets/javascripts/spree/backend/global/alerts.es6 +66 -0
  38. data/app/assets/javascripts/spree/backend/global/api_functions.es6 +5 -0
  39. data/app/assets/javascripts/spree/backend/global/bootstrap.es6 +15 -0
  40. data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +22 -0
  41. data/app/assets/javascripts/spree/backend/global/info_alert.es6 +38 -0
  42. data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +18 -0
  43. data/app/assets/javascripts/spree/backend/global/ransack.es6 +108 -0
  44. data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +56 -0
  45. data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +156 -0
  46. data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +61 -0
  47. data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +137 -0
  48. data/app/assets/javascripts/spree/backend/global/sortable.es6 +35 -0
  49. data/app/assets/javascripts/spree/backend/global/tinymce.es6 +11 -0
  50. data/app/assets/javascripts/spree/backend/menus/_index.es6 +2 -0
  51. data/app/assets/javascripts/spree/backend/menus/menu.es6 +57 -0
  52. data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +26 -0
  53. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +13 -17
  54. data/app/assets/javascripts/spree/backend/option_value_picker.js +10 -22
  55. data/app/assets/javascripts/spree/backend/payments/edit.js +1 -1
  56. data/app/assets/javascripts/spree/backend/payments/new.js +18 -5
  57. data/app/assets/javascripts/spree/backend/spree-select2.js +19 -1
  58. data/app/assets/javascripts/spree/backend/stock_location.js +1 -2
  59. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +7 -1
  60. data/app/assets/javascripts/spree/backend/taxons.js +74 -73
  61. data/app/assets/javascripts/spree/backend/user_picker.js +7 -10
  62. data/app/assets/javascripts/spree/backend.js +28 -1
  63. data/app/assets/javascripts/spree.js +78 -0
  64. data/app/assets/stylesheets/spree/backend/components/_filters.scss +1 -3
  65. data/app/assets/stylesheets/spree/backend/components/_main.scss +0 -1
  66. data/app/assets/stylesheets/spree/backend/components/_navbar.scss +35 -0
  67. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +13 -0
  68. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +0 -1
  69. data/app/assets/stylesheets/spree/backend/components/_tables.scss +4 -5
  70. data/app/assets/stylesheets/spree/backend/global/_mixins.scss +59 -0
  71. data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +95 -0
  72. data/app/assets/stylesheets/spree/backend/plugins/{select2_bootstrap4.scss → _select2_bootstrap4.scss} +0 -0
  73. data/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss +100 -0
  74. data/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss +4 -0
  75. data/app/assets/stylesheets/spree/backend/shared/_base.scss +75 -25
  76. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +8 -0
  77. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +5 -0
  78. data/app/assets/stylesheets/spree/backend/views/_cms_pages.scss +148 -0
  79. data/app/assets/stylesheets/spree/backend/views/_menus.scss +61 -0
  80. data/app/controllers/concerns/spree/admin/order_concern.rb +24 -0
  81. data/app/controllers/concerns/spree/admin/product_concern.rb +11 -0
  82. data/app/controllers/spree/admin/base_controller.rb +63 -3
  83. data/app/controllers/spree/admin/cms_pages_controller.rb +29 -0
  84. data/app/controllers/spree/admin/cms_sections_controller.rb +15 -0
  85. data/app/controllers/spree/admin/customer_returns_controller.rb +4 -5
  86. data/app/controllers/spree/admin/errors_controller.rb +11 -0
  87. data/app/controllers/spree/admin/general_settings_controller.rb +1 -1
  88. data/app/controllers/spree/admin/images_controller.rb +8 -22
  89. data/app/controllers/spree/admin/log_entries_controller.rb +4 -3
  90. data/app/controllers/spree/admin/menu_items_controller.rb +33 -0
  91. data/app/controllers/spree/admin/menus_controller.rb +32 -0
  92. data/app/controllers/spree/admin/option_types_controller.rb +1 -1
  93. data/app/controllers/spree/admin/orders/customer_details_controller.rb +6 -11
  94. data/app/controllers/spree/admin/orders_controller.rb +23 -31
  95. data/app/controllers/spree/admin/payment_methods_controller.rb +17 -4
  96. data/app/controllers/spree/admin/payments_controller.rb +5 -10
  97. data/app/controllers/spree/admin/prices_controller.rb +2 -2
  98. data/app/controllers/spree/admin/products_controller.rb +21 -10
  99. data/app/controllers/spree/admin/promotion_actions_controller.rb +1 -1
  100. data/app/controllers/spree/admin/promotion_rules_controller.rb +1 -1
  101. data/app/controllers/spree/admin/promotions_controller.rb +3 -3
  102. data/app/controllers/spree/admin/prototypes_controller.rb +1 -1
  103. data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
  104. data/app/controllers/spree/admin/reports_controller.rb +5 -1
  105. data/app/controllers/spree/admin/resource_controller.rb +32 -5
  106. data/app/controllers/spree/admin/return_index_controller.rb +1 -1
  107. data/app/controllers/spree/admin/state_changes_controller.rb +2 -7
  108. data/app/controllers/spree/admin/stock_items_controller.rb +2 -2
  109. data/app/controllers/spree/admin/stock_locations_controller.rb +2 -2
  110. data/app/controllers/spree/admin/stock_movements_controller.rb +1 -1
  111. data/app/controllers/spree/admin/stock_transfers_controller.rb +1 -1
  112. data/app/controllers/spree/admin/store_credits_controller.rb +13 -8
  113. data/app/controllers/spree/admin/stores_controller.rb +14 -17
  114. data/app/controllers/spree/admin/taxons_controller.rb +9 -5
  115. data/app/controllers/spree/admin/users_controller.rb +9 -7
  116. data/app/controllers/spree/admin/variants_controller.rb +16 -15
  117. data/app/helpers/spree/admin/base_helper.rb +52 -14
  118. data/app/helpers/spree/admin/cms_helper.rb +15 -0
  119. data/app/helpers/spree/admin/menu_helper.rb +30 -0
  120. data/app/helpers/spree/admin/stores_helper.rb +21 -0
  121. data/app/models/spree/backend_configuration.rb +2 -0
  122. data/app/views/spree/admin/adjustments/_adjustment.html.erb +7 -5
  123. data/app/views/spree/admin/cms_pages/_form.html.erb +135 -0
  124. data/app/views/spree/admin/cms_pages/_live_preview_area.html.erb +61 -0
  125. data/app/views/spree/admin/cms_pages/_section_template.html.erb +16 -0
  126. data/app/views/spree/admin/cms_pages/edit.html.erb +21 -0
  127. data/app/views/spree/admin/cms_pages/index.html.erb +84 -0
  128. data/app/views/spree/admin/cms_pages/new.html.erb +8 -0
  129. data/app/views/spree/admin/cms_sections/_form.html.erb +69 -0
  130. data/app/views/spree/admin/cms_sections/edit.html.erb +19 -0
  131. data/app/views/spree/admin/cms_sections/new.html.erb +11 -0
  132. data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +50 -0
  133. data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +62 -0
  134. data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +177 -0
  135. data/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb +5 -0
  136. data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +4 -0
  137. data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +121 -0
  138. data/app/views/spree/admin/countries/index.html.erb +5 -3
  139. data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +6 -4
  140. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +9 -7
  141. data/app/views/spree/admin/customer_returns/index.html.erb +4 -2
  142. data/app/views/spree/admin/errors/forbidden.html.erb +0 -0
  143. data/app/views/spree/admin/images/index.html.erb +8 -4
  144. data/app/views/spree/admin/menu_items/_form.html.erb +115 -0
  145. data/app/views/spree/admin/menu_items/edit.html.erb +11 -0
  146. data/app/views/spree/admin/menu_items/new.html.erb +11 -0
  147. data/app/views/spree/admin/menus/_form.html.erb +19 -0
  148. data/app/views/spree/admin/menus/edit.html.erb +57 -0
  149. data/app/views/spree/admin/menus/index.html.erb +90 -0
  150. data/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb +30 -0
  151. data/app/views/spree/admin/menus/new.html.erb +22 -0
  152. data/app/views/spree/admin/option_types/_form.html.erb +3 -0
  153. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +5 -1
  154. data/app/views/spree/admin/option_types/index.html.erb +5 -3
  155. data/app/views/spree/admin/orders/_channel_form.html.erb +2 -2
  156. data/app/views/spree/admin/orders/_line_items.html.erb +10 -8
  157. data/app/views/spree/admin/orders/_shipment.html.erb +26 -18
  158. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +11 -9
  159. data/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb +2 -2
  160. data/app/views/spree/admin/orders/index.html.erb +100 -101
  161. data/app/views/spree/admin/payment_methods/_form.html.erb +6 -4
  162. data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
  163. data/app/views/spree/admin/payment_methods/index.html.erb +22 -3
  164. data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
  165. data/app/views/spree/admin/payments/_list.html.erb +9 -7
  166. data/app/views/spree/admin/prices/_variant_prices.html.erb +7 -14
  167. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +9 -7
  168. data/app/views/spree/admin/products/_autocomplete.js.erb +10 -6
  169. data/app/views/spree/admin/products/_form.html.erb +35 -5
  170. data/app/views/spree/admin/products/index.html.erb +15 -14
  171. data/app/views/spree/admin/products/new.html.erb +6 -1
  172. data/app/views/spree/admin/products/stock.html.erb +71 -68
  173. data/app/views/spree/admin/promotion_categories/index.html.erb +5 -3
  174. data/app/views/spree/admin/promotions/_form.html.erb +7 -0
  175. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +1 -0
  176. data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +2 -1
  177. data/app/views/spree/admin/promotions/index.html.erb +33 -34
  178. data/app/views/spree/admin/properties/_form.html.erb +6 -0
  179. data/app/views/spree/admin/properties/index.html.erb +19 -3
  180. data/app/views/spree/admin/prototypes/_form.html.erb +1 -1
  181. data/app/views/spree/admin/prototypes/_prototypes.html.erb +8 -6
  182. data/app/views/spree/admin/prototypes/index.html.erb +5 -3
  183. data/app/views/spree/admin/reimbursement_types/index.html.erb +5 -3
  184. data/app/views/spree/admin/reports/index.html.erb +1 -1
  185. data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
  186. data/app/views/spree/admin/return_authorizations/_form.html.erb +2 -2
  187. data/app/views/spree/admin/return_authorizations/index.html.erb +7 -5
  188. data/app/views/spree/admin/return_index/customer_returns.html.erb +4 -2
  189. data/app/views/spree/admin/return_index/return_authorizations.html.erb +5 -3
  190. data/app/views/spree/admin/roles/index.html.erb +5 -3
  191. data/app/views/spree/admin/shared/_account_nav.html.erb +5 -5
  192. data/app/views/spree/admin/shared/_address_form.html.erb +5 -4
  193. data/app/views/spree/admin/shared/_content_header.html.erb +20 -6
  194. data/app/views/spree/admin/shared/_head.html.erb +2 -1
  195. data/app/views/spree/admin/shared/_header.html.erb +7 -10
  196. data/app/views/spree/admin/shared/_link_fields.html.erb +22 -0
  197. data/app/views/spree/admin/shared/_main_menu.html.erb +19 -4
  198. data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -10
  199. data/app/views/spree/admin/shared/_paths.html.erb +8 -0
  200. data/app/views/spree/admin/shared/_refunds.html.erb +4 -2
  201. data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
  202. data/app/views/spree/admin/shared/_store_switcher.html.erb +23 -0
  203. data/app/views/spree/admin/shared/_table_filter.html.erb +6 -6
  204. data/app/views/spree/admin/shared/_translations.html.erb +2 -0
  205. data/app/views/spree/admin/shared/cms/_spree_product.html.erb +14 -0
  206. data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +14 -0
  207. data/app/views/spree/admin/shared/linkables/_home_page.html.erb +3 -0
  208. data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +28 -0
  209. data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +20 -0
  210. data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +22 -0
  211. data/app/views/spree/admin/shared/linkables/_url.html.erb +16 -0
  212. data/app/views/spree/admin/shared/named_types/_index.html.erb +7 -5
  213. data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +1 -3
  214. data/app/views/spree/admin/shared/sub_menu/_content.html.erb +4 -0
  215. data/app/views/spree/admin/shared/sub_menu/_stock.html.erb +4 -0
  216. data/app/views/spree/admin/shipping_categories/index.html.erb +5 -3
  217. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -3
  218. data/app/views/spree/admin/states/_state_list.html.erb +5 -3
  219. data/app/views/spree/admin/stock_locations/index.html.erb +5 -3
  220. data/app/views/spree/admin/stock_transfers/index.html.erb +5 -4
  221. data/app/views/spree/admin/stock_transfers/new.html.erb +9 -7
  222. data/app/views/spree/admin/store_credit_categories/index.html.erb +5 -3
  223. data/app/views/spree/admin/store_credits/index.html.erb +7 -5
  224. data/app/views/spree/admin/stores/_form.html.erb +12 -2
  225. data/app/views/spree/admin/stores/index.html.erb +12 -10
  226. data/app/views/spree/admin/tax_categories/index.html.erb +5 -3
  227. data/app/views/spree/admin/tax_rates/index.html.erb +5 -3
  228. data/app/views/spree/admin/taxonomies/_list.html.erb +5 -3
  229. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  230. data/app/views/spree/admin/users/_addresses_form.html.erb +2 -4
  231. data/app/views/spree/admin/users/_lifetime_stats.html.erb +16 -4
  232. data/app/views/spree/admin/users/index.html.erb +5 -3
  233. data/app/views/spree/admin/users/items.html.erb +1 -1
  234. data/app/views/spree/admin/variants/_autocomplete.js.erb +6 -2
  235. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +18 -12
  236. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +12 -8
  237. data/app/views/spree/admin/variants/_split.js.erb +9 -7
  238. data/app/views/spree/admin/variants/index.html.erb +8 -5
  239. data/app/views/spree/admin/zones/index.html.erb +5 -3
  240. data/app/views/spree/layouts/admin.html.erb +16 -16
  241. data/config/initializers/assets.rb +5 -1
  242. data/config/routes.rb +14 -2
  243. data/lib/generators/spree/backend/install/install_generator.rb +22 -0
  244. data/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js +8 -0
  245. data/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css +9 -0
  246. data/lib/spree/backend/engine.rb +4 -11
  247. data/lib/spree/backend.rb +7 -4
  248. data/lib/spree_backend.rb +0 -2
  249. data/spec/fixtures/files/favicon.ico +0 -0
  250. data/spec/fixtures/files/icon_512x512.png +0 -0
  251. data/spree_backend.gemspec +16 -11
  252. data/vendor/assets/javascripts/cleave.js +8 -0
  253. data/vendor/assets/javascripts/jsonapi-serializer.min.js +8 -0
  254. data/vendor/assets/javascripts/jsuri.js +458 -0
  255. data/vendor/assets/javascripts/sortable.js +2 -3709
  256. data/vendor/assets/javascripts/sweetalert2.js +2 -0
  257. metadata +208 -42
  258. data/app/assets/javascripts/spree/backend/address_states.js +0 -44
  259. data/app/assets/javascripts/spree/frontend/backend.js +0 -1
  260. data/app/assets/stylesheets/spree/frontend/backend.css +0 -1
  261. data/app/views/spree/admin/orders/_store_form.html.erb +0 -18
@@ -24,10 +24,12 @@
24
24
  <%= text_area :payment_method, :description, { cols: 60, rows: 6, class: 'form-control' } %>
25
25
  <% end %>
26
26
 
27
- <div data-hook="store" class="form-group">
28
- <%= label_tag :payment_method_stores, Spree.t(:stores) %>
29
- <%= collection_select(:payment_method, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
30
- </div>
27
+ <% if @stores.count > 1 %>
28
+ <div data-hook="store" class="form-group">
29
+ <%= label_tag :payment_method_stores, Spree.t(:stores) %>
30
+ <%= collection_select(:payment_method, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
31
+ </div>
32
+ <% end %>
31
33
 
32
34
  <div data-hook="display" class="form-group">
33
35
  <%= label_tag :payment_method_display_on, Spree.t(:display) %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_title do %>
2
- <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_url %> /
2
+ <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_path %> /
3
3
  <%= @payment_method.name %>
4
4
  <% end %>
5
5
 
@@ -6,6 +6,23 @@
6
6
  <%= button_link_to Spree.t(:new_payment_method), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_payment_methods_link' %>
7
7
  <% end if can? :create, Spree::PaymentMethod %>
8
8
 
9
+ <% content_for :table_filter do %>
10
+ <div data-hook="admin_payment_methods_filter_table">
11
+ <%= search_form_for [:admin, @search] do |f| %>
12
+ <%- locals = {f: f} %>
13
+ <div data-hook="admin_payment_methods_index_search" class="row">
14
+ <div class="form-group">
15
+ <%= f.label :name_cont, Spree.t('name') %>
16
+ <%= f.text_field :name_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
17
+ </div>
18
+ </div>
19
+ <div data-hook="admin_products_index_search_buttons" class="form-actions">
20
+ <%= button Spree.t(:search), 'search.svg' %>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ <% end %>
25
+
9
26
  <% if @payment_methods.any? %>
10
27
  <div class="table-responsive">
11
28
  <table class="table sortable" id='listing_payment_methods' data-hook data-sortable-link="<%= update_positions_admin_payment_methods_url %>">
@@ -31,9 +48,11 @@
31
48
  <td><%= method.type.split('::', 3).last %></td>
32
49
  <td class="text-center"><%= Spree.t(method.display_on) %></td>
33
50
  <td class="text-center"><%= active_badge(method.active) %></td>
34
- <td data-hook="admin_payment_methods_index_row_actions" class="actions actions-2 text-right">
35
- <%= link_to_edit(method, no_text: true) if can? :edit, method %>
36
- <%= link_to_delete(method, no_text: true) if can? :delete, method %>
51
+ <td data-hook="admin_payment_methods_index_row_actions" class="actions">
52
+ <span class="d-flex justify-content-end">
53
+ <%= link_to_edit(method, no_text: true) if can? :edit, method %>
54
+ <%= link_to_delete(method, no_text: true) if can? :delete, method %>
55
+ </span>
37
56
  </td>
38
57
  </tr>
39
58
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_title do %>
2
- <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_url %> /
2
+ <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_path %> /
3
3
  <%= Spree.t(:new_payment_method) %>
4
4
  <% end %>
5
5
 
@@ -24,14 +24,16 @@
24
24
  <%= Spree.t(payment.state, scope: :payment_states, default: payment.state.capitalize) %>
25
25
  </span>
26
26
  </td>
27
- <td class="actions actions-2 text-center no-wrap">
28
- <% payment.actions.each do |action| %>
29
- <% if action == 'credit' %>
30
- <%= link_to_with_icon('exit.svg', Spree.t(:refund), new_admin_order_payment_refund_path(@order, payment), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:create, Spree::Refund) %>
31
- <% else %>
32
- <%= link_to_with_icon(action + '.svg', Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: { action: action }, class: "btn btn-outline-secondary btn-sm") if can?(action.to_sym, payment) %>
27
+ <td class="actions">
28
+ <span class="d-flex justify-content-center payment-action-buttons">
29
+ <% payment.actions.each do |action| %>
30
+ <% if action == 'credit' %>
31
+ <%= link_to_with_icon('exit.svg', Spree.t(:refund), new_admin_order_payment_refund_path(@order, payment), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:create, Spree::Refund) %>
32
+ <% else %>
33
+ <%= link_to_with_icon(action + '.svg', Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: { action: action }, class: "btn btn-outline-secondary btn-sm") if can?(action.to_sym, payment) %>
34
+ <% end %>
33
35
  <% end %>
34
- <% end %>
36
+ </span>
35
37
  </td>
36
38
  </tr>
37
39
  <% end %>
@@ -1,20 +1,13 @@
1
- <div class="panel-body no-padding-bottom panel-default table-responsive">
1
+ <div class="table-responsive">
2
2
  <div id="variant_prices-table-wrapper">
3
- <table class="table sortable">
4
- <colgroup>
5
- <col style="width: 15%">
6
- <col style="width: 30%">
7
- <col style="width: 15%">
8
- <col style="width: 20%">
9
- <col style="width: 20%">
10
- </colgroup>
3
+ <table class="table">
11
4
  <thead>
12
5
  <tr data-hook="variant_prices_header">
13
- <th><%= Spree.t(:options) %></th>
14
- <th><%= Spree.t(:sku) %></th>
15
- <th><%= Spree.t(:currency) %></th>
16
- <th><%= Spree.t(:price) %></th>
17
- <th><%= Spree.t(:compare_at_price) %></th>
6
+ <th scope="col"><%= Spree.t(:options) %></th>
7
+ <th scope="col"><%= Spree.t(:sku) %></th>
8
+ <th scope="col"><%= Spree.t(:currency) %></th>
9
+ <th scope="col" style="min-width: 150px;"><%= Spree.t(:price) %></th>
10
+ <th scope="col" style="min-width: 150px;"><%= Spree.t(:compare_at_price) %></th>
18
11
  </tr>
19
12
  </thead>
20
13
  <tbody id="variant-prices" data-hook="variant_prices_body">
@@ -19,13 +19,15 @@
19
19
  <td class="show_property">
20
20
  <%= f.check_box :show_property %>
21
21
  </td>
22
- <td class="actions actions-1">
23
- <% if f.object.persisted? && can?(:destroy, f.object) %>
24
- <%= link_to_delete f.object, no_text: true %>
25
- <% else %>
26
- <span class="btn btn-danger btn-sm icon-link disabled" style="opacity:0.2;">
27
- <%= svg_icon name: "delete.svg", width: '18', height: '18' %>
22
+ <td class="actions">
23
+ <span class="d-flex justify-content-end">
24
+ <% if f.object.persisted? && can?(:destroy, f.object) %>
25
+ <%= link_to_delete f.object, no_text: true %>
26
+ <% else %>
27
+ <span class="btn btn-danger btn-sm icon-link disabled" style="opacity:0.2;">
28
+ <%= svg_icon name: "delete.svg", width: '18', height: '18' %>
29
+ </span>
30
+ <% end %>
28
31
  </span>
29
- <% end %>
30
32
  </td>
31
33
  </tr>
@@ -1,5 +1,5 @@
1
1
  <script type='text/template' id='product_template'>
2
- <li id="product_{{ product.id }}" data-product-id='{{ product.id }}' data-taxons="{{ product.taxon_ids }}" class="product p-2 col-6 col-md-3 col-lg-2">
2
+ <li id="product_{{ product.id }}" data-classification-id='{{ classification.id }}' data-product-id='{{ product.id }}' class="product p-2 col-6 col-md-3 col-lg-2">
3
3
  <div class="m-1 p-2 card bg-light">
4
4
  <nav class="navbar navbar-light bg-light justify-content-between px-0 pt-0" style="background-color:transparent !important;">
5
5
  <a class=" sort-handle js-sort-handle">
@@ -16,15 +16,19 @@
16
16
  </div>
17
17
  </nav>
18
18
  <div class='image'>
19
- {{#if product.image }}
20
- <img src='{{product.image}}' alt='{{ product.name }}' class='thumbnail rounded border border' />
19
+ {{#if image }}
20
+ <div class="admin-product-image-container small-img">
21
+ <img src='{{image}}' alt='{{ product.attributes.name }}' class='thumbnail rounded border border' />
22
+ </div>
21
23
  {{ else }}
22
- <img src='<%= image_path("noimage/small.png") %>' alt='{{product.name }}' class='thumbnail' />
24
+ <div class="admin-product-image-container small-img">
25
+ <%= inline_svg_tag "noimage/backend-missing-image.svg", class: "noimage", size: "60%*60%" %>
26
+ </div>
23
27
  {{/if}}
24
28
  </div>
25
29
  <div class="p-0 pt-1 text-center product-info">
26
- <p class="name card-text">{{ product.name }}</p>
27
- <p class="price card-text">{{ product.display_current_currency_price }}</p>
30
+ <p class="name card-text">{{ product.attributes.name }}</p>
31
+ <p class="price card-text">{{ product.attributes.display_price }}</p>
28
32
  </div>
29
33
  </div>
30
34
  </li>
@@ -21,7 +21,7 @@
21
21
  <div data-hook="admin_product_form_description">
22
22
  <%= f.field_container :description, class: ['form-group'] do %>
23
23
  <%= f.label :description, Spree.t(:description) %>
24
- <%= f.text_area :description, { rows: "#{unless @product.has_variants? then '20' else '13' end}", class: 'form-control' } %>
24
+ <%= f.text_area :description, { rows: "#{unless @product.has_variants? then '29' else '30' end}", class: "form-control #{"spree-rte" if product_wysiwyg_editor_enabled? }" } %>
25
25
  <%= f.error_message_on :description %>
26
26
  <% end %>
27
27
  </div>
@@ -31,7 +31,12 @@
31
31
  <div data-hook="admin_product_form_price">
32
32
  <%= f.field_container :price, class: ['form-group'] do %>
33
33
  <%= f.label :price, raw(Spree.t(:master_price) + required_span_tag) %>
34
- <%= f.text_field :price, value: number_to_currency(@product.price, unit: ''), class: 'form-control', disabled: (cannot? :update, @product.master.default_price) %>
34
+ <div class="input-group">
35
+ <div class="input-group-prepend">
36
+ <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
37
+ </div>
38
+ <%= f.text_field :price, value: number_to_currency(@product.amount_in(current_currency), unit: ''), class: 'form-control', disabled: (cannot? :update, @product.master.default_price) %>
39
+ </div>
35
40
  <%= f.error_message_on :price %>
36
41
  <% end %>
37
42
  </div>
@@ -39,7 +44,12 @@
39
44
  <div>
40
45
  <%= f.field_container :compare_at_price, class: ['form-group'] do %>
41
46
  <%= f.label :compare_at_price, Spree.t(:compare_at_price) %>
42
- <%= f.text_field :compare_at_price, value: number_to_currency(@product.compare_at_price, unit: ''), class: 'form-control' %>
47
+ <div class="input-group">
48
+ <div class="input-group-prepend">
49
+ <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
50
+ </div>
51
+ <%= f.text_field :compare_at_price, value: number_to_currency(@product.compare_at_amount_in(current_currency), unit: ''), class: 'form-control' %>
52
+ </div>
43
53
  <%= f.error_message_on :compare_at_price %>
44
54
  <% end %>
45
55
  </div>
@@ -194,7 +204,12 @@
194
204
  <%= f.label :taxon_ids, Spree.t(:taxons) %>
195
205
 
196
206
  <% if can? :modify, Spree::Classification %>
197
- <%= f.select :taxon_ids, options_from_collection_for_select(@product.taxons, :id, :pretty_name, @product.taxons.pluck(:id)), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %>
207
+ <%= f.select :taxon_ids, options_from_collection_for_select(@product.taxons, :id, :pretty_name, @product.taxon_ids),
208
+ { include_hidden: true },
209
+ multiple: true,
210
+ data: { autocomplete_url_value: 'taxons_api_v2',
211
+ autocomplete_return_attr_value: 'pretty_name',
212
+ autocomplete_multiple_value: true } %>
198
213
  <% elsif @product.taxons.any? %>
199
214
  <ul class="text_list">
200
215
  <% @product.taxons.each do |taxon| %>
@@ -213,7 +228,13 @@
213
228
  <%= f.label :option_type_ids, Spree.t(:option_types) %>
214
229
 
215
230
  <% if can? :modify, Spree::ProductOptionType %>
216
- <%= f.select :option_type_ids, options_from_collection_for_select(Spree::OptionType.all, :id, :name, @product.option_types.pluck(:id)), { include_hidden: true }, multiple: true, class: 'select2-hidden-accessible' %>
231
+ <%= f.select :option_type_ids, options_from_collection_for_select(@product.option_types, :id, :name, @product.option_type_ids),
232
+ { include_hidden: true },
233
+ multiple: true,
234
+ class: 'select2-hidden-accessible',
235
+ data: { autocomplete_url_value: 'option_types_api_v2',
236
+ autocomplete_return_attr_value: 'name',
237
+ autocomplete_multiple_value: true } %>
217
238
  <% elsif @product.option_types.any? %>
218
239
  <ul class="text_list">
219
240
  <% @product.option_types.each do |type| %>
@@ -227,6 +248,15 @@
227
248
  <% end %>
228
249
  </div>
229
250
 
251
+ <% if @stores.count > 1 %>
252
+ <div data-hook="admin_product_form_stores">
253
+ <%= f.field_container :stores, class: ['form-group'] do %>
254
+ <%= f.label :product_stores, Spree.t(:stores) %>
255
+ <%= collection_select(:product, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
256
+ <% end %>
257
+ </div>
258
+ <% end %>
259
+
230
260
  <div data-hook="admin_product_form_meta">
231
261
  <div data-hook="admin_product_form_meta_title">
232
262
  <%= f.field_container :meta_title, class: ['form-group'] do %>
@@ -14,7 +14,7 @@
14
14
  <div data-hook="admin_products_index_search" class="row">
15
15
  <div class="col-12 col-lg-6">
16
16
  <div class="form-group">
17
- <%= f.label :search_by_name, Spree.t(:name) %>
17
+ <%= f.label :search_by_name, Spree.t(:product_name) %>
18
18
  <%= f.text_field :search_by_name, size: 15, class: "form-control js-quick-search-target js-filterable" %>
19
19
  </div>
20
20
  </div>
@@ -25,19 +25,19 @@
25
25
  </div>
26
26
  </div>
27
27
  <div class="col-12">
28
- <div class="field checkbox mb-2">
29
- <label>
30
- <%= f.check_box :deleted_at_null, {checked: params[:q][:deleted_at_null] == '0'}, '0', '1' %>
31
- <%= Spree.t(:show_deleted) %>
32
- </label>
33
- </div>
28
+ <%= f.field_container :deleted_at_null do %>
29
+ <div class="custom-control custom-checkbox">
30
+ <%= f.check_box :deleted_at_null, {checked: params[:q][:deleted_at_null] == '0', class: 'custom-control-input'}, '0', '1' %>
31
+ <%= f.label :deleted_at_null, Spree.t(:show_deleted), class: 'custom-control-label' %>
32
+ </div>
33
+ <% end %>
34
34
 
35
- <div class="field checkbox mb-2">
36
- <label>
37
- <%= f.check_box :not_discontinued, {checked: params[:q][:not_discontinued] == '0'}, '0', '1' %>
38
- <%= Spree.t(:show_discontinued ) %>
39
- </label>
40
- </div>
35
+ <%= f.field_container :not_discontinued do %>
36
+ <div class="custom-control custom-checkbox">
37
+ <%= f.check_box :not_discontinued, {checked: params[:q][:not_discontinued] == '0', class: 'custom-control-input'}, '0', '1' %>
38
+ <%= f.label :not_discontinued, Spree.t(:show_discontinued ), class: 'custom-control-label' %>
39
+ </div>
40
+ <% end %>
41
41
  </div>
42
42
  </div>
43
43
  <div data-hook="admin_products_index_search_buttons" class="form-actions">
@@ -68,13 +68,14 @@
68
68
  <tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>">
69
69
  <td scope="row" class="image">
70
70
  <%= link_to edit_admin_product_path(product) do %>
71
- <%= mini_image product %>
71
+ <%= small_image product %>
72
72
  <% end %>
73
73
  </td>
74
74
  <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
75
75
  <td class="sku"><%= product.sku rescue '' %></td>
76
76
  <td class="status"><%= active_badge(available_status == Spree.t(:available), label: available_status) %></td>
77
77
  <td class="text-center"><%= display_price(product) %></td>
78
+
78
79
  <td class="actions " data-hook="admin_products_index_row_actions">
79
80
  <span class="d-flex justify-content-end">
80
81
  <%= link_to_edit product, no_text: true, class: 'edit' if can?(:edit, product) && !product.deleted? %>
@@ -33,8 +33,13 @@
33
33
 
34
34
  <div data-hook="new_product_price" class="col-12 col-md-4">
35
35
  <%= f.field_container :price, class: ['form-group'] do %>
36
- <%= f.label :price, Spree.t(:master_price) %> <span class="required">*</span>
36
+ <%= f.label :price, Spree.t(:master_price) %> <span class="required">*</span>
37
+ <div class="input-group">
38
+ <div class="input-group-prepend">
39
+ <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
40
+ </div>
37
41
  <%= f.text_field :price, value: number_to_currency(@product.price, unit: ''), class: 'form-control', required: :required %>
42
+ </div>
38
43
  <%= f.error_message_on :price %>
39
44
  <% end %>
40
45
  </div>
@@ -6,73 +6,76 @@
6
6
  <%= render 'add_stock_form' %>
7
7
  </div>
8
8
  <% end %>
9
-
10
- <div class="card mb-3 table-responsive">
11
- <table class="table" id="listing_product_stock">
12
- <thead>
13
- <tr data-hook="admin_product_stock_management_index_headers">
14
- <th colspan="2"><%= Spree.t(:variant) %></th>
15
- <th colspan="3"><%= Spree.t(:stock_location_info) %></th>
16
- </tr>
17
- </thead>
18
- <tbody>
19
- <% @variants.each do |variant| %>
20
- <% if variant.stock_items.present? %>
21
- <tr id="<%= spree_dom_id variant %>" data-hook="admin_product_stock_management_index_rows">
22
- <td class="image text-center">
23
- <% if variant.images.present? %>
24
- <%= image_tag main_app.url_for(variant.images.first.url(:mini)) %>
25
- <% end %>
26
- </td>
27
- <td>
28
- <%= variant.sku_and_options_text %>
29
- <%= form_tag admin_product_variants_including_master_path(@product, variant, format: :js), method: :put, class: 'toggle_variant_track_inventory' do %>
30
- <div class="checkbox">
31
- <%= label_tag "track_inventory_#{ variant.id }" do %>
32
- <%= check_box_tag 'track_inventory', 1, variant.track_inventory?,
33
- class: 'track_inventory_checkbox', id: "track_inventory_#{ variant.id }" %>
34
- <%= Spree.t(:track_inventory) %>
35
- <%= hidden_field_tag 'variant[track_inventory]', variant.track_inventory?,
36
- class: 'variant_track_inventory',
37
- id: "variant_track_inventory_#{variant.id}" %>
38
- <% end %>
39
- </div>
40
- <% end if can?(:update, @product) && can?(:update, variant) %>
41
- </td>
42
-
43
- <td colspan="3" class="stock_location_info">
44
- <table class="table table-bordered mb-0">
45
- <thead>
46
- <th><%= Spree.t(:stock_location) %></th>
47
- <th class="text-center"><%= Spree.t(:count_on_hand) %></th>
48
- <th class="text-center"><%= Spree.t(:backorderable) %></th>
49
- <th class="actions text-center"></th>
50
- </thead>
51
- <tbody>
52
- <% variant.stock_items.each do |item| %>
53
- <% next unless @stock_locations.include?(item.stock_location) %>
54
- <tr id="stock-item-<%= item.id %>">
55
- <td><%= item.stock_location.name %></td>
56
- <td class="text-center"><%= item.count_on_hand %></td>
57
- <td class="text-center">
58
- <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %>
59
- <%= check_box_tag 'stock_item[backorderable]', true,
60
- item.backorderable?,
61
- class: 'stock_item_backorderable',
62
- id: "stock_item_backorderable_#{item.stock_location.id}" %>
63
- <% end if can? :update, item %>
64
- </td>
65
- <td class="actions actions-1 text-center">
66
- <%= link_to_with_icon('delete.svg', Spree.t(:remove), [:admin, item], method: :delete, remote: true, class: 'icon_link btn btn-danger btn-sm', data: { action: :remove, confirm: Spree.t(:are_you_sure) }, no_text: true) if can? :destroy, item %>
67
- </td>
68
- </tr>
69
- <% end %>
70
- </tbody>
71
- </table>
72
- </td>
73
- <% end %>
9
+ <div class="card mb-3">
10
+ <div class="table-responsive">
11
+ <table class="table" id="listing_product_stock">
12
+ <thead>
13
+ <tr data-hook="admin_product_stock_management_index_headers">
14
+ <th colspan="2"><%= Spree.t(:variant) %></th>
15
+ <th colspan="3"><%= Spree.t(:stock_location_info) %></th>
74
16
  </tr>
75
- <% end %>
76
- </tbody>
77
- </table>
17
+ </thead>
18
+ <tbody>
19
+ <% @variants.each do |variant| %>
20
+ <% if variant.stock_items.present? %>
21
+ <tr id="<%= spree_dom_id variant %>" data-hook="admin_product_stock_management_index_rows">
22
+ <td class="image text-center">
23
+ <% if variant.images.present? %>
24
+ <%= image_tag main_app.url_for(variant.images.first.url(:mini)) %>
25
+ <% end %>
26
+ </td>
27
+ <td>
28
+ <%= variant.sku_and_options_text %>
29
+ <%= form_tag admin_product_variants_including_master_path(@product, variant, format: :js), method: :put, class: 'toggle_variant_track_inventory' do %>
30
+ <div class="checkbox">
31
+ <%= label_tag "track_inventory_#{ variant.id }" do %>
32
+ <%= check_box_tag 'track_inventory', 1, variant.track_inventory?,
33
+ class: 'track_inventory_checkbox', id: "track_inventory_#{ variant.id }" %>
34
+ <%= Spree.t(:track_inventory) %>
35
+ <%= hidden_field_tag 'variant[track_inventory]', variant.track_inventory?,
36
+ class: 'variant_track_inventory',
37
+ id: "variant_track_inventory_#{variant.id}" %>
38
+ <% end %>
39
+ </div>
40
+ <% end if can?(:update, @product) && can?(:update, variant) %>
41
+ </td>
42
+
43
+ <td colspan="3" class="stock_location_info">
44
+ <table class="table table-bordered mb-0">
45
+ <thead>
46
+ <th><%= Spree.t(:stock_location) %></th>
47
+ <th class="text-center"><%= Spree.t(:count_on_hand) %></th>
48
+ <th class="text-center"><%= Spree.t(:backorderable) %></th>
49
+ <th class="actions text-center"></th>
50
+ </thead>
51
+ <tbody>
52
+ <% variant.stock_items.each do |item| %>
53
+ <% next unless @stock_locations.include?(item.stock_location) %>
54
+ <tr id="stock-item-<%= item.id %>">
55
+ <td><%= item.stock_location.name %></td>
56
+ <td class="text-center"><%= item.count_on_hand %></td>
57
+ <td class="text-center">
58
+ <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %>
59
+ <%= check_box_tag 'stock_item[backorderable]', true,
60
+ item.backorderable?,
61
+ class: 'stock_item_backorderable',
62
+ id: "stock_item_backorderable_#{item.stock_location.id}" %>
63
+ <% end if can? :update, item %>
64
+ </td>
65
+ <td class="actions">
66
+ <span class="d-flex justify-content-center">
67
+ <%= link_to_with_icon('delete.svg', Spree.t(:remove), [:admin, item], method: :delete, remote: true, class: 'icon_link btn btn-danger btn-sm', data: { action: :remove, confirm: Spree.t(:are_you_sure) }, no_text: true) if can? :destroy, item %>
68
+ </span>
69
+ </td>
70
+ </tr>
71
+ <% end %>
72
+ </tbody>
73
+ </table>
74
+ </td>
75
+ <% end %>
76
+ </tr>
77
+ <% end %>
78
+ </tbody>
79
+ </table>
80
+ </div>
78
81
  </div>