spree_backend 4.2.7 → 4.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) 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/large.png +0 -0
  24. data/app/assets/images/noimage/mini.png +0 -0
  25. data/app/assets/images/noimage/product.png +0 -0
  26. data/app/assets/images/noimage/small.png +0 -0
  27. data/app/assets/javascripts/spree/backend/address_states.es6 +44 -0
  28. data/app/assets/javascripts/spree/backend/admin.js +45 -307
  29. data/app/assets/javascripts/spree/backend/checkouts/edit.js +22 -13
  30. data/app/assets/javascripts/spree/backend/cms/_index.es6 +4 -0
  31. data/app/assets/javascripts/spree/backend/cms/links.es6 +25 -0
  32. data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +34 -0
  33. data/app/assets/javascripts/spree/backend/cms/page.es6 +133 -0
  34. data/app/assets/javascripts/spree/backend/cms/section.es6 +43 -0
  35. data/app/assets/javascripts/spree/backend/global/_index.js +11 -0
  36. data/app/assets/javascripts/spree/backend/global/alerts.es6 +66 -0
  37. data/app/assets/javascripts/spree/backend/global/api_functions.es6 +5 -0
  38. data/app/assets/javascripts/spree/backend/global/bootstrap.es6 +15 -0
  39. data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +22 -0
  40. data/app/assets/javascripts/spree/backend/global/info_alert.es6 +38 -0
  41. data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +18 -0
  42. data/app/assets/javascripts/spree/backend/global/ransack.es6 +108 -0
  43. data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +56 -0
  44. data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +143 -0
  45. data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +61 -0
  46. data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +137 -0
  47. data/app/assets/javascripts/spree/backend/global/sortable.es6 +35 -0
  48. data/app/assets/javascripts/spree/backend/global/tinymce.es6 +11 -0
  49. data/app/assets/javascripts/spree/backend/menus/_index.es6 +2 -0
  50. data/app/assets/javascripts/spree/backend/menus/menu.es6 +58 -0
  51. data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +26 -0
  52. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +7 -17
  53. data/app/assets/javascripts/spree/backend/option_value_picker.js +10 -22
  54. data/app/assets/javascripts/spree/backend/payments/edit.js +1 -1
  55. data/app/assets/javascripts/spree/backend/payments/new.js +18 -5
  56. data/app/assets/javascripts/spree/backend/spree-select2.js +19 -1
  57. data/app/assets/javascripts/spree/backend/stock_location.js +1 -2
  58. data/app/assets/javascripts/spree/backend/taxons.js +74 -73
  59. data/app/assets/javascripts/spree/backend/user_picker.js +7 -10
  60. data/app/assets/javascripts/spree/backend.js +28 -1
  61. data/app/assets/javascripts/spree.js +78 -0
  62. data/app/assets/stylesheets/spree/backend/components/_filters.scss +1 -3
  63. data/app/assets/stylesheets/spree/backend/components/_main.scss +0 -1
  64. data/app/assets/stylesheets/spree/backend/components/_navbar.scss +35 -0
  65. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +13 -0
  66. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +0 -1
  67. data/app/assets/stylesheets/spree/backend/components/_tables.scss +4 -5
  68. data/app/assets/stylesheets/spree/backend/global/_mixins.scss +59 -0
  69. data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +95 -0
  70. data/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss +100 -0
  71. data/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss +4 -0
  72. data/app/assets/stylesheets/spree/backend/shared/_base.scss +28 -26
  73. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +8 -0
  74. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +5 -0
  75. data/app/assets/stylesheets/spree/backend/views/_cms_pages.scss +148 -0
  76. data/app/assets/stylesheets/spree/backend/views/_menus.scss +61 -0
  77. data/app/controllers/concerns/spree/admin/order_concern.rb +24 -0
  78. data/app/controllers/concerns/spree/admin/product_concern.rb +11 -0
  79. data/app/controllers/spree/admin/base_controller.rb +63 -3
  80. data/app/controllers/spree/admin/cms_pages_controller.rb +29 -0
  81. data/app/controllers/spree/admin/cms_sections_controller.rb +15 -0
  82. data/app/controllers/spree/admin/customer_returns_controller.rb +4 -5
  83. data/app/controllers/spree/admin/errors_controller.rb +11 -0
  84. data/app/controllers/spree/admin/general_settings_controller.rb +1 -1
  85. data/app/controllers/spree/admin/images_controller.rb +8 -22
  86. data/app/controllers/spree/admin/log_entries_controller.rb +4 -3
  87. data/app/controllers/spree/admin/menu_items_controller.rb +33 -0
  88. data/app/controllers/spree/admin/menus_controller.rb +32 -0
  89. data/app/controllers/spree/admin/option_types_controller.rb +1 -1
  90. data/app/controllers/spree/admin/orders/customer_details_controller.rb +6 -11
  91. data/app/controllers/spree/admin/orders_controller.rb +22 -30
  92. data/app/controllers/spree/admin/payment_methods_controller.rb +17 -4
  93. data/app/controllers/spree/admin/payments_controller.rb +5 -10
  94. data/app/controllers/spree/admin/prices_controller.rb +2 -2
  95. data/app/controllers/spree/admin/products_controller.rb +21 -10
  96. data/app/controllers/spree/admin/promotion_actions_controller.rb +1 -1
  97. data/app/controllers/spree/admin/promotion_rules_controller.rb +1 -1
  98. data/app/controllers/spree/admin/promotions_controller.rb +3 -3
  99. data/app/controllers/spree/admin/prototypes_controller.rb +1 -1
  100. data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
  101. data/app/controllers/spree/admin/reports_controller.rb +5 -1
  102. data/app/controllers/spree/admin/resource_controller.rb +35 -5
  103. data/app/controllers/spree/admin/return_index_controller.rb +1 -1
  104. data/app/controllers/spree/admin/state_changes_controller.rb +2 -7
  105. data/app/controllers/spree/admin/stock_items_controller.rb +2 -2
  106. data/app/controllers/spree/admin/stock_locations_controller.rb +2 -2
  107. data/app/controllers/spree/admin/stock_movements_controller.rb +1 -1
  108. data/app/controllers/spree/admin/stock_transfers_controller.rb +1 -1
  109. data/app/controllers/spree/admin/store_credits_controller.rb +13 -8
  110. data/app/controllers/spree/admin/stores_controller.rb +14 -17
  111. data/app/controllers/spree/admin/taxons_controller.rb +9 -5
  112. data/app/controllers/spree/admin/users_controller.rb +9 -7
  113. data/app/controllers/spree/admin/variants_controller.rb +16 -15
  114. data/app/helpers/spree/admin/base_helper.rb +52 -14
  115. data/app/helpers/spree/admin/cms_helper.rb +15 -0
  116. data/app/helpers/spree/admin/menu_helper.rb +30 -0
  117. data/app/helpers/spree/admin/stores_helper.rb +21 -0
  118. data/app/models/spree/backend_configuration.rb +2 -0
  119. data/app/views/spree/admin/adjustments/_adjustment.html.erb +7 -5
  120. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  121. data/app/views/spree/admin/cms_pages/_form.html.erb +135 -0
  122. data/app/views/spree/admin/cms_pages/_live_preview_area.html.erb +61 -0
  123. data/app/views/spree/admin/cms_pages/_section_template.html.erb +16 -0
  124. data/app/views/spree/admin/cms_pages/edit.html.erb +21 -0
  125. data/app/views/spree/admin/cms_pages/index.html.erb +84 -0
  126. data/app/views/spree/admin/cms_pages/new.html.erb +8 -0
  127. data/app/views/spree/admin/cms_sections/_form.html.erb +69 -0
  128. data/app/views/spree/admin/cms_sections/edit.html.erb +19 -0
  129. data/app/views/spree/admin/cms_sections/new.html.erb +11 -0
  130. data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +50 -0
  131. data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +62 -0
  132. data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +177 -0
  133. data/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb +5 -0
  134. data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +4 -0
  135. data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +121 -0
  136. data/app/views/spree/admin/countries/index.html.erb +5 -3
  137. data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +6 -4
  138. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +9 -7
  139. data/app/views/spree/admin/customer_returns/index.html.erb +4 -2
  140. data/app/views/spree/admin/errors/forbidden.html.erb +0 -0
  141. data/app/views/spree/admin/images/index.html.erb +5 -3
  142. data/app/views/spree/admin/menu_items/_form.html.erb +115 -0
  143. data/app/views/spree/admin/menu_items/edit.html.erb +11 -0
  144. data/app/views/spree/admin/menu_items/new.html.erb +11 -0
  145. data/app/views/spree/admin/menus/_form.html.erb +19 -0
  146. data/app/views/spree/admin/menus/edit.html.erb +57 -0
  147. data/app/views/spree/admin/menus/index.html.erb +90 -0
  148. data/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb +30 -0
  149. data/app/views/spree/admin/menus/new.html.erb +22 -0
  150. data/app/views/spree/admin/option_types/_form.html.erb +3 -0
  151. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +5 -1
  152. data/app/views/spree/admin/option_types/index.html.erb +5 -3
  153. data/app/views/spree/admin/orders/_channel_form.html.erb +2 -2
  154. data/app/views/spree/admin/orders/_line_items.html.erb +9 -7
  155. data/app/views/spree/admin/orders/_shipment.html.erb +26 -18
  156. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +10 -8
  157. data/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb +2 -2
  158. data/app/views/spree/admin/orders/index.html.erb +100 -101
  159. data/app/views/spree/admin/payment_methods/_form.html.erb +6 -4
  160. data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
  161. data/app/views/spree/admin/payment_methods/index.html.erb +22 -3
  162. data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
  163. data/app/views/spree/admin/payments/_list.html.erb +9 -7
  164. data/app/views/spree/admin/prices/_variant_prices.html.erb +7 -14
  165. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +9 -7
  166. data/app/views/spree/admin/products/_autocomplete.js.erb +5 -5
  167. data/app/views/spree/admin/products/_form.html.erb +24 -5
  168. data/app/views/spree/admin/products/index.html.erb +14 -13
  169. data/app/views/spree/admin/products/new.html.erb +6 -1
  170. data/app/views/spree/admin/products/stock.html.erb +71 -68
  171. data/app/views/spree/admin/promotion_categories/index.html.erb +5 -3
  172. data/app/views/spree/admin/promotions/_form.html.erb +7 -0
  173. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +1 -0
  174. data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +2 -1
  175. data/app/views/spree/admin/promotions/index.html.erb +33 -34
  176. data/app/views/spree/admin/properties/_form.html.erb +6 -0
  177. data/app/views/spree/admin/properties/index.html.erb +9 -3
  178. data/app/views/spree/admin/prototypes/_form.html.erb +1 -1
  179. data/app/views/spree/admin/prototypes/_prototypes.html.erb +8 -6
  180. data/app/views/spree/admin/prototypes/index.html.erb +5 -3
  181. data/app/views/spree/admin/reimbursement_types/index.html.erb +5 -3
  182. data/app/views/spree/admin/reports/index.html.erb +1 -1
  183. data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
  184. data/app/views/spree/admin/return_authorizations/_form.html.erb +2 -2
  185. data/app/views/spree/admin/return_authorizations/index.html.erb +7 -5
  186. data/app/views/spree/admin/return_index/customer_returns.html.erb +4 -2
  187. data/app/views/spree/admin/return_index/return_authorizations.html.erb +5 -3
  188. data/app/views/spree/admin/roles/index.html.erb +5 -3
  189. data/app/views/spree/admin/shared/_account_nav.html.erb +5 -5
  190. data/app/views/spree/admin/shared/_address_form.html.erb +5 -4
  191. data/app/views/spree/admin/shared/_content_header.html.erb +20 -6
  192. data/app/views/spree/admin/shared/_head.html.erb +2 -1
  193. data/app/views/spree/admin/shared/_header.html.erb +7 -10
  194. data/app/views/spree/admin/shared/_link_fields.html.erb +22 -0
  195. data/app/views/spree/admin/shared/_main_menu.html.erb +19 -4
  196. data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -10
  197. data/app/views/spree/admin/shared/_paths.html.erb +8 -0
  198. data/app/views/spree/admin/shared/_refunds.html.erb +4 -2
  199. data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
  200. data/app/views/spree/admin/shared/_store_switcher.html.erb +23 -0
  201. data/app/views/spree/admin/shared/_table_filter.html.erb +6 -6
  202. data/app/views/spree/admin/shared/_translations.html.erb +2 -0
  203. data/app/views/spree/admin/shared/cms/_spree_product.html.erb +14 -0
  204. data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +14 -0
  205. data/app/views/spree/admin/shared/linkables/_home_page.html.erb +3 -0
  206. data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +28 -0
  207. data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +20 -0
  208. data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +22 -0
  209. data/app/views/spree/admin/shared/linkables/_url.html.erb +16 -0
  210. data/app/views/spree/admin/shared/named_types/_index.html.erb +7 -5
  211. data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +1 -3
  212. data/app/views/spree/admin/shared/sub_menu/_content.html.erb +4 -0
  213. data/app/views/spree/admin/shared/sub_menu/_stock.html.erb +4 -0
  214. data/app/views/spree/admin/shipping_categories/index.html.erb +5 -3
  215. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -3
  216. data/app/views/spree/admin/states/_state_list.html.erb +5 -3
  217. data/app/views/spree/admin/stock_locations/index.html.erb +5 -3
  218. data/app/views/spree/admin/stock_transfers/index.html.erb +5 -4
  219. data/app/views/spree/admin/stock_transfers/new.html.erb +9 -7
  220. data/app/views/spree/admin/store_credit_categories/index.html.erb +5 -3
  221. data/app/views/spree/admin/store_credits/index.html.erb +7 -5
  222. data/app/views/spree/admin/stores/_form.html.erb +12 -2
  223. data/app/views/spree/admin/stores/index.html.erb +12 -10
  224. data/app/views/spree/admin/tax_categories/index.html.erb +5 -3
  225. data/app/views/spree/admin/tax_rates/index.html.erb +5 -3
  226. data/app/views/spree/admin/taxonomies/_list.html.erb +5 -3
  227. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  228. data/app/views/spree/admin/users/_addresses_form.html.erb +2 -4
  229. data/app/views/spree/admin/users/index.html.erb +5 -3
  230. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +18 -12
  231. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +12 -8
  232. data/app/views/spree/admin/variants/_split.js.erb +9 -7
  233. data/app/views/spree/admin/variants/index.html.erb +8 -5
  234. data/app/views/spree/admin/zones/index.html.erb +5 -3
  235. data/app/views/spree/layouts/admin.html.erb +16 -16
  236. data/config/initializers/assets.rb +5 -1
  237. data/config/routes.rb +16 -4
  238. data/lib/generators/spree/backend/install/install_generator.rb +22 -0
  239. data/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js +8 -0
  240. data/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css +9 -0
  241. data/lib/spree/backend/engine.rb +4 -11
  242. data/lib/spree/backend.rb +7 -4
  243. data/lib/spree_backend.rb +0 -2
  244. data/spec/fixtures/files/favicon.ico +0 -0
  245. data/spec/fixtures/files/icon_512x512.png +0 -0
  246. data/spree_backend.gemspec +9 -4
  247. data/vendor/assets/javascripts/cleave.js +8 -0
  248. data/vendor/assets/javascripts/jsonapi-serializer.min.js +8 -0
  249. data/vendor/assets/javascripts/jsuri.js +458 -0
  250. data/vendor/assets/javascripts/sortable.js +2 -3709
  251. data/vendor/assets/javascripts/sweetalert2.js +2 -0
  252. metadata +193 -22
  253. data/app/assets/javascripts/spree/backend/address_states.js +0 -44
  254. data/app/assets/javascripts/spree/frontend/backend.js +0 -1
  255. data/app/assets/stylesheets/spree/frontend/backend.css +0 -1
  256. data/app/views/spree/admin/orders/_store_form.html.erb +0 -18
  257. /data/app/assets/stylesheets/spree/backend/plugins/{select2_bootstrap4.scss → _select2_bootstrap4.scss} +0 -0
@@ -22,7 +22,7 @@
22
22
  <div id='taxons' data-hook>
23
23
  <%= f.field_container :taxon_ids, class: ['form-group'] do %>
24
24
  <%= f.label :taxon_ids, Spree.t(:taxons) %><br>
25
- <%= f.select :taxon_ids, Spree::Taxon.all.map { |t| [t.name, t.id] }, {}, { multiple: true, class: "select2" } %>
25
+ <%= f.select :taxon_ids, current_store.taxons.pluck(:name, :id), {}, { multiple: true, class: "select2" } %>
26
26
  <% end %>
27
27
  </div>
28
28
  </div>
@@ -10,12 +10,14 @@
10
10
  <% @prototypes.each do |prototype| %>
11
11
  <tr id="row_<%= prototype.id %>" data-hook="available_row">
12
12
  <td><%= prototype.name %></td>
13
- <td class="actions actions-1">
14
- <%= link_to_with_icon 'save.svg',
15
- Spree.t(:select),
16
- select_admin_prototype_url(prototype),
17
- class: 'btn btn-success btn-sm ajax select_properties_from_prototype',
18
- no_text: true %>
13
+ <td class="actions">
14
+ <span class="d-flex justify-content-end">
15
+ <%= link_to_with_icon 'save.svg',
16
+ Spree.t(:select),
17
+ select_admin_prototype_url(prototype),
18
+ class: 'btn btn-success btn-sm ajax select_properties_from_prototype',
19
+ no_text: true %>
20
+ </span>
19
21
  </td>
20
22
  </tr>
21
23
  <% end %>
@@ -19,9 +19,11 @@
19
19
  <% @prototypes.each do |prototype| %>
20
20
  <tr id="<%= spree_dom_id prototype %>" data-hook="prototypes_row">
21
21
  <td><%= prototype.name %></td>
22
- <td class="actions actions-2 text-right">
23
- <%= link_to_edit(prototype, no_text: true, class: 'admin_edit_prototype') if can?(:edit, prototype) %>
24
- <%= link_to_delete(prototype, no_text: true) if can?(:delete, prototype) %>
22
+ <td class="actions">
23
+ <span class="d-flex justify-content-end">
24
+ <%= link_to_edit(prototype, no_text: true, class: 'admin_edit_prototype') if can?(:edit, prototype) %>
25
+ <%= link_to_delete(prototype, no_text: true) if can?(:delete, prototype) %>
26
+ </span>
25
27
  </td>
26
28
  </tr>
27
29
  <% end %>
@@ -25,9 +25,11 @@
25
25
  <td>
26
26
  <%= reimbursement_type.type.split('::', 3).last %>
27
27
  </td>
28
- <td class="actions actions-2 text-right">
29
- <%= link_to_edit reimbursement_type, no_text: true, class: 'edit' if can?(:edit, reimbursement_type) %>
30
- <%= link_to_delete reimbursement_type, no_text: true if can?(:delete, reimbursement_type) %>
28
+ <td class="actions">
29
+ <span class="d-flex justify-content-end">
30
+ <%= link_to_edit reimbursement_type, no_text: true, class: 'edit' if can?(:edit, reimbursement_type) %>
31
+ <%= link_to_delete reimbursement_type, no_text: true if can?(:delete, reimbursement_type) %>
32
+ </span>
31
33
  </td>
32
34
  </tr>
33
35
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_title do %>
2
- <%= Spree.t(:reports) %>
2
+ <%= Spree.t(:reports) %> <%= Spree.t('admin.reports.for', store_name: current_store.unique_name) %>
3
3
  <% end %>
4
4
  <div class="table-responsive">
5
5
  <table class="table">
@@ -1,6 +1,6 @@
1
1
  <% content_for :page_title do %>
2
2
  <%= link_to Spree.t(:reports), spree.admin_reports_url %> /
3
- <%= Spree.t(:sales_totals) %>
3
+ <%= Spree.t(:sales_totals) %> <%= Spree.t('admin.reports.for', store_name: current_store.unique_name) %>
4
4
  <% end %>
5
5
 
6
6
  <div class="card bg-light mb-3">
@@ -14,8 +14,8 @@
14
14
  <th><%= Spree.t(:status) %></th>
15
15
  <th><%= Spree.t(:charged) %></th>
16
16
  <th><%= Spree.t(:purchased_quantity) %></th>
17
- <th><%= Spree.t(:return_quantity) %></th>
18
- <th><%= Spree.t(:pre_tax_refund_amount) %></th>
17
+ <th style="min-width:130px;"><%= Spree.t(:return_quantity) %></th>
18
+ <th style="min-width:150px;"><%= Spree.t(:pre_tax_refund_amount) %></th>
19
19
  <th><%= Spree.t(:reimbursement_type) %></th>
20
20
  <th><%= Spree.t(:exchange_for) %></th>
21
21
  </tr>
@@ -33,11 +33,13 @@
33
33
  </td>
34
34
  <td><%= return_authorization.display_pre_tax_total.to_html %></td>
35
35
  <td><%= pretty_time(return_authorization.created_at) %></td>
36
- <td class="actions actions-2">
37
- <%= link_to_edit(return_authorization, no_text: true, class: 'edit') if can?(:edit, return_authorization) %>
38
- <% if can?(:delete, return_authorization) && !return_authorization.customer_returned_items? %>
39
- <%= link_to_delete return_authorization, no_text: true %>
40
- <% end %>
36
+ <td class="actions">
37
+ <span class="d-flex justify-content-end">
38
+ <%= link_to_edit(return_authorization, no_text: true, class: 'edit') if can?(:edit, return_authorization) %>
39
+ <% if can?(:delete, return_authorization) && !return_authorization.customer_returned_items? %>
40
+ <%= link_to_delete return_authorization, no_text: true %>
41
+ <% end %>
42
+ </span>
41
43
  </td>
42
44
  </tr>
43
45
  <% end %>
@@ -47,8 +47,10 @@
47
47
  <% end %>
48
48
  </td>
49
49
  <td><%= customer_return.display_pre_tax_total.to_html %></td>
50
- <td class="actions actions-1 text-right">
51
- <%= link_to_edit_url spree.edit_admin_order_customer_return_path(customer_return.order, customer_return), no_text: true if can?(:edit, customer_return) %>
50
+ <td class="actions">
51
+ <span class="d-flex justify-content-end">
52
+ <%= link_to_edit_url spree.edit_admin_order_customer_return_path(customer_return.order, customer_return), no_text: true if can?(:edit, customer_return) %>
53
+ </span>
52
54
  </td>
53
55
  </tr>
54
56
  <% end %>
@@ -26,7 +26,7 @@
26
26
  <div class="row">
27
27
  <div class="col-12 col-lg-6">
28
28
  <div class="form-group">
29
- <%= f.label :number_cont, Spree.t(:number) %>
29
+ <%= f.label :number_cont, Spree.t(:return_number) %>
30
30
  <%= f.text_field :number_cont, class: "form-control js-quick-search-target js-filterable" %>
31
31
  </div>
32
32
  </div>
@@ -65,8 +65,10 @@
65
65
  <td>
66
66
  <span class="badge badge-<%= return_authorization.state %> text-uppercase"><%= Spree.t("return_authorization_states.#{return_authorization.state}") %></span>
67
67
  </td>
68
- <td class="actions actions-1 text-right">
69
- <%= link_to_edit return_authorization, url: spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization), no_text: true if can?(:edit, return_authorization) %>
68
+ <td class="actions">
69
+ <span class="d-flex justify-content-end">
70
+ <%= link_to_edit return_authorization, url: spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization), no_text: true if can?(:edit, return_authorization) %>
71
+ </span>
70
72
  </td>
71
73
  </tr>
72
74
  <% end %>
@@ -19,9 +19,11 @@
19
19
  <% @roles.each do |role| %>
20
20
  <tr id="<%= spree_dom_id role %>" data-hook="admin_roles_index_rows">
21
21
  <td><%= role.name %></td>
22
- <td class="actions text-right">
23
- <%= link_to_edit(role, no_text: true) if can? :edit, role %>
24
- <%= link_to_delete(role, no_text: true) if can? :destroy, role %>
22
+ <td class="actions">
23
+ <span class="d-flex justify-content-end">
24
+ <%= link_to_edit(role, no_text: true) if can? :edit, role %>
25
+ <%= link_to_delete(role, no_text: true) if can? :destroy, role %>
26
+ </span>
25
27
  </td>
26
28
  </tr>
27
29
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <% if try_spree_current_user %>
2
2
  <div class="btn-group">
3
3
 
4
- <button id="accountNav" type="button" class="btn text-light" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5
- <%= svg_icon name: "user.svg", width: '24', height: '24' %>
4
+ <button id="accountNav" type="button" class="btn text-light px-3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5
+ <%= svg_icon name: "user.svg", width: '24', height: '24', classes: 'mb-0' %>
6
6
  </button>
7
7
 
8
8
  <div class="dropdown-menu dropdown-menu-right overflow-hidden mt-2 p-0 mr-2">
@@ -37,10 +37,10 @@
37
37
 
38
38
  <div class="dropdown-divider m-0"></div>
39
39
 
40
- <%= link_to 'http://guides.spreecommerce.org', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
40
+ <%= link_to 'http://guides.spreecommerce.org/support', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
41
41
  <%= svg_icon name: "info.svg", width: '18', height: '18' %>
42
42
  &nbsp;
43
- <%= Spree.t(:help_center) %>
43
+ <%= Spree.t(:support) %>
44
44
  <% end %>
45
45
 
46
46
  <%= link_to 'http://slack.spreecommerce.org', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
@@ -49,7 +49,7 @@
49
49
  <%= Spree.t(:join_slack) %>
50
50
  <% end %>
51
51
 
52
- <%= link_to 'https://github.com/spree-contrib', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
52
+ <%= link_to 'https://guides.spreecommerce.org/extensions', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
53
53
  <%= svg_icon name: "extensions.svg", width: '18', height: '18' %>
54
54
  &nbsp;
55
55
  <%= Spree.t(:extensions_directory) %>
@@ -5,7 +5,7 @@
5
5
  <%= field_container (s_or_b + '_' + field), nil, class: ["form-group", "#{type}-row"] do %>
6
6
  <%= f.label :country_id, Spree.t(:country) %>
7
7
  <div id="<%= s_or_b %>country">
8
- <%= f.collection_select :country_id, available_countries, :id, :name, {}, { class: 'select2 w-100' } %>
8
+ <%= f.collection_select :country_id, all_countries, :id, :name, {}, { class: 'select2 w-100' } %>
9
9
  </div>
10
10
  <% end %>
11
11
  <% elsif field == "state" %>
@@ -37,8 +37,9 @@
37
37
 
38
38
  <% content_for :head do %>
39
39
  <script>
40
- $(document).ready(function(){
41
- $('#<%= s_or_b %>country select').on('change', function() { update_state('<%= s_or_b %>'); });
42
- });
40
+ document.addEventListener('DOMContentLoaded', function() {
41
+ updateAddressState('<%= s_or_b %>');
42
+ $('#<%= s_or_b %>country select').on('change', function() { updateAddressState('<%= s_or_b %>'); });
43
+ })
43
44
  </script>
44
45
  <% end %>
@@ -1,7 +1,7 @@
1
- <div id="contentHeader" class="row mb-3">
1
+ <div id="contentHeader" class="row mb-0 pb-0">
2
2
  <% if content_for?(:page_title) || content_for?(:page_actions) %>
3
3
  <div class="content-header col <%= "with-page-tabs" if content_for?(:page_tabs) %> page-header">
4
- <div class="row align-items-center <%= if content_for?(:page_tabs) then "pb-0" else "border-bottom" end %>">
4
+ <div id="contentHeaderRow" class="row align-items-center <%= if content_for?(:page_tabs) then "border-bottom pb-2" else "border-bottom pb-2 mb-3" end %>">
5
5
 
6
6
  <% if content_for?(:page_title) %>
7
7
  <h1 class="contextual-title px-0 mb-0 col">
@@ -33,10 +33,24 @@
33
33
  </div>
34
34
 
35
35
  <% if content_for?(:page_tabs) %>
36
- <div class="row">
37
- <ul class="nav nav-tabs w-100 mt-4 px-0">
38
- <%= yield :page_tabs %>
39
- </ul>
36
+ <div class="row my-2 pb-1 pt-1 align-items-center" data-nav-x-wrapper>
37
+ <div data-nav-x-container>
38
+ <ul id="spreePageTabs" class="nav nav-pills flex-nowrap" data-nav-x-content>
39
+ <%= yield :page_tabs %>
40
+ </ul>
41
+ </div>
42
+
43
+ <button class="nav-x_Advancer nav-x_Advancer_Left" type="button">
44
+ <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">
45
+ <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
46
+ </svg>
47
+ </button>
48
+
49
+ <button class="nav-x_Advancer nav-x_Advancer_Right" type="button">
50
+ <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
51
+ <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
52
+ </svg>
53
+ </button>
40
54
  </div>
41
55
  <% end %>
42
56
 
@@ -15,13 +15,14 @@
15
15
 
16
16
  <%= stylesheet_link_tag 'spree/backend/all', media: :all %>
17
17
 
18
- <%= render 'spree/shared/paths' %>
18
+ <%= render 'spree/admin/shared/paths' %>
19
19
  <%= javascript_include_tag 'spree/backend/all' %>
20
20
  <%= render "spree/admin/shared/translations" %>
21
21
 
22
22
  <script>
23
23
  <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
24
24
  <%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
25
+ <%== "var OAUTH_TOKEN = '#{admin_oauth_token}';" if defined?(admin_oauth_token) %>
25
26
  <%== "var ADDRESS_FIELDS = #{Spree::Address::ADDRESS_FIELDS}" %>
26
27
  <% if Rails.env.test? %>
27
28
  jQuery.fx.off = false
@@ -1,24 +1,21 @@
1
1
  <header class="header logged-in">
2
- <nav class="navbar fixed-top navbar-dark align-items-middle">
3
- <div class="col-3 col-sm-4 p-0 d-lg-none">
2
+ <nav class="navbar fixed-top navbar-dark flex-nowrap">
3
+ <div class="col p-0 d-lg-none">
4
4
  <button
5
5
  id="sidebar-open"
6
- class="navbar-toggler h-100 text-light"
6
+ class="navbar-toggler h-100 text-light px-3"
7
7
  type="button"
8
8
  aria-expanded="false"
9
9
  aria-label="Toggle navigation">
10
10
  <%= svg_icon name: "menu.svg", width: '20', height: '20' %>
11
11
  </button>
12
12
  </div>
13
- <div class="col text-center text-lg-left">
14
- <%= link_to(
15
- image_tag(Spree::Config[:admin_interface_logo], id: 'logo', alt: current_store.name),
16
- spree.admin_path,
17
- class: "logo navbar-brand"
18
- ) %>
13
+
14
+ <div id="storeSwitcherDropdown" class="col-auto text-center text-lg-left px-0 px-lg-2 align-items-center dropdown">
15
+ <%= render partial: 'spree/admin/shared/store_switcher' %>
19
16
  </div>
20
17
 
21
- <div class="col-3 col-sm-4 text-right p-0">
18
+ <div class="col text-right p-0">
22
19
  <%= render partial: 'spree/admin/shared/account_nav' %>
23
20
  </div>
24
21
  </nav>
@@ -0,0 +1,22 @@
1
+ <% save_to = save_to || 'menu_item_link' %>
2
+ <% linked_type = linked_type || nil %>
3
+
4
+ <% if linked_type.present? %>
5
+ <div data-panel-type="<%= linked_type %>" data-panel-id="<%= save_to %>">
6
+ <%= render "spree/admin/shared/cms/#{spree_class_name_as_path(linked_type)}", resource: resource, save_to: save_to, f: f %>
7
+ </div>
8
+ <% elsif resource.linked_resource_type.present? %>
9
+ <div data-panel-type="<%= resource.linked_resource_type %>" data-panel-id="<%= save_to %>">
10
+ <%= render "spree/admin/shared/linkables/#{spree_class_name_as_path(resource.linked_resource_type)}", resource: resource, f: f %>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="d-none" data-target-message-pannel="<%= save_to %>">
15
+ <div class="alert alert-warning mt-3">
16
+ <% if %w[new create].include? controller.action_name %>
17
+ <%= raw Spree.t('admin.navigation.click_create_to_load_new_link') %>
18
+ <% else %>
19
+ <%= raw Spree.t('admin.navigation.click_update_to_load_new_link') %>
20
+ <% end %>
21
+ </div>
22
+ </div>
@@ -1,18 +1,21 @@
1
1
  <nav>
2
- <div class="text-right d-lg-none p-2 border-bottom">
2
+ <div class="text-right d-lg-none pl-3 py-2 border-bottom d-flex align-items-center">
3
+ <div class="d-flex flex-grow-1 text-primary">
4
+ <%= svg_icon name: "spree-logo.svg", width: '70', height: '30' %>
5
+ </div>
3
6
  <button
4
7
  id="sidebar-close"
5
- class="btn btn-link"
8
+ class="btn btn-link d-flex"
6
9
  type="button"
7
10
  aria-expanded="false"
8
11
  aria-label="Toggle navigation">
9
- <%= svg_icon name: "cancel.svg", width: '20', height: '20' %>
12
+ <%= svg_icon name: "cancel.svg", width: '20', height: '20', classes: 'p-0 m-0' %>
10
13
  </button>
11
14
  </div>
12
15
 
13
16
  <% if can? :admin, Spree::Order %>
14
17
  <ul class="nav nav-sidebar border-bottom" id="sidebarOrder">
15
- <%= tab *Spree::BackendConfiguration::ORDER_TABS, icon: 'list.svg' %>
18
+ <%= tab *Spree::BackendConfiguration::ORDER_TABS, url: admin_orders_path, icon: 'list.svg' %>
16
19
  </ul>
17
20
  <% end %>
18
21
 
@@ -28,6 +31,12 @@
28
31
  </ul>
29
32
  <% end %>
30
33
 
34
+ <% if can?(:admin, Spree::StockLocation) || can?(:admin, Spree::StockTransfer) %>
35
+ <ul class="nav nav-sidebar border-bottom" id="sidebarStock">
36
+ <%= main_menu_tree Spree.t(:stock), icon: "box.svg", sub_menu: "stock", url: "#sidebar-stock" %>
37
+ </ul>
38
+ <% end %>
39
+
31
40
  <% if can? :admin, Spree::Admin::ReportsController %>
32
41
  <ul class="nav nav-sidebar border-bottom" id="sidebarReport">
33
42
  <%= tab *Spree::BackendConfiguration::REPORT_TABS, icon: 'report.svg' %>
@@ -46,6 +55,12 @@
46
55
  </ul>
47
56
  <% end %>
48
57
 
58
+ <% if can? :admin, Spree::Menu %>
59
+ <ul class="nav nav-sidebar border-bottom" id="sidebarMenu">
60
+ <%= main_menu_tree Spree.t('admin.tab.content'), icon: "window-sidebar.svg", sub_menu: "content", url: "#sidebar-content" %>
61
+ </ul>
62
+ <% end %>
63
+
49
64
  <% if can? :admin, current_store %>
50
65
  <ul class="nav nav-sidebar border-bottom" id="sidebarConfiguration">
51
66
  <%= main_menu_tree Spree.t(:configurations), icon: "settings.svg", sub_menu: "configuration", url: "#sidebar-configuration" %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_title do %>
2
- <%= link_to Spree.t(:orders), admin_orders_path %> /
2
+ <%= link_to Spree.t(:orders), spree.admin_orders_path %> /
3
3
  <%= link_to @order.number, spree.edit_admin_order_path(@order) %>
4
4
  <% end %>
5
5
 
@@ -14,15 +14,6 @@
14
14
  </li>
15
15
  <% end %>
16
16
 
17
- <% if ((can?(:update, @order) && can?(:read, Spree::Store)) && (@order.shipments.size.zero? || @order.shipments.shipped.size.zero?)) %>
18
- <li data-hook='admin_order_tabs_store_details'>
19
- <%= link_to_with_icon 'store.svg',
20
- Spree.t(:store),
21
- store_admin_order_url(@order),
22
- class: "#{'active' if current == :store} nav-link" %>
23
- </li>
24
- <% end %>
25
-
26
17
  <% if can? :update, @order %>
27
18
  <li data-hook='admin_order_tabs_channel_details'>
28
19
  <%= link_to_with_icon 'split.svg',
@@ -0,0 +1,8 @@
1
+ <script>
2
+ SpreePaths = <%==
3
+ {
4
+ mounted_at: Rails.application.routes.url_helpers.spree_path(trailing_slash: true),
5
+ admin: Spree.admin_path.gsub(/\A(\/)?(.*[^\/])(\/)?\z/, '\\2/')
6
+ }.to_json
7
+ %>
8
+ </script>
@@ -23,8 +23,10 @@
23
23
  <td><%= refund.transaction_id %></td>
24
24
  <td><%= truncate(refund.reason.name, length: 100) %></td>
25
25
  <% if show_actions %>
26
- <td class="actions actions-1">
27
- <%= link_to_with_icon('edit.svg', Spree.t(:edit), edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:edit, refund) %>
26
+ <td class="actions">
27
+ <span class="d-flex justify-content-end">
28
+ <%= link_to_with_icon('edit.svg', Spree.t(:edit), edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:edit, refund) %>
29
+ </span>
28
30
  </td>
29
31
  <% end %>
30
32
  </tr>
@@ -17,7 +17,7 @@
17
17
  <% end %>
18
18
 
19
19
  <% if content_for?(:sidebar) %>
20
- <aside id="sidebar" class="main-right-sidebar px-2" data-hook>
20
+ <aside id="sidebar" class="main-right-sidebar px-0 pl-lg-2" data-hook>
21
21
  <%= yield :sidebar %>
22
22
  </aside>
23
23
  <% end %>
@@ -0,0 +1,23 @@
1
+ <% if can?(:admin, current_store) %>
2
+ <span class="d-none d-lg-inline text-light">
3
+ <%= svg_icon name: "spree-icon.svg", width: '35', height: '35' %>
4
+ </span>
5
+
6
+ <a class="px-0 py-1 btn text-light" id="storeSelectorDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
7
+ <span class="d-sm-none"><%= svg_icon name: "store.svg", width: '18', height: '18' %></span>
8
+ <span class="d-none d-sm-inline"><%= current_store.name %></span> (<%= current_store.code %>) <%= svg_icon name: "chevron-down.svg", width: '12', height: '12', classes: 'ml-1 mb-0' %>
9
+ </a>
10
+
11
+ <div class="dropdown-menu dropdown-menu-left overflow-hidden ml-lg-2 mt-2 py-0" aria-labelledby="storeSelectorDropdown">
12
+ <% @stores.each do |store| %>
13
+ <%= store_switcher_link(store) %>
14
+ <% end %>
15
+
16
+ <% if can?(:create, Spree::Store) %>
17
+ <div class="dropdown-divider m-0"></div>
18
+ <%= link_to spree.new_admin_store_path, class: 'text-dark p-3 dropdown-item', id: 'addNewStoreLink' do %>
19
+ <%= svg_icon name: "add.svg", width: '18', height: '18' %> <%= Spree.t(:add_new_store) %>
20
+ <% end %>
21
+ <% end %>
22
+ </div>
23
+ <% end %>
@@ -1,15 +1,15 @@
1
1
  <% if content_for?(:table_filter) %>
2
- <div class="filter-wrap row mb-4">
3
- <div class="col-12">
4
- <div class="input-group index-filter-button">
2
+ <div class="filter-wrap pb-1">
3
+ <div class="col-12 px-0">
4
+ <div class="input-group index-filter-button flex-nowrap">
5
5
  <span class="input-group-btn">
6
6
  <button class="btn js-show-index-filters m-0" type="button">
7
- <%= svg_icon name: "chevron-right.svg", width: '12', height: '12' %>
8
- <%= Spree.t(:filter) %>
7
+ <%= svg_icon name: "chevron-right.svg", width: '12', height: '12' %>
8
+ <span class="d-none d-sm-inline"><%= Spree.t(:filter) %></span>
9
9
  </button>
10
10
  </span>
11
11
  <%= form_tag request.fullpath, id: "quick-search", class: 'flex-grow-1' do %>
12
- <%= text_field_tag :quick_search, nil, class: "form-control js-quick-search", placeholder: Spree.t(:quick_search) %>
12
+ <%= text_field_tag :quick_search, nil, class: "form-control js-quick-search", placeholder: Spree.t(:search_by) %>
13
13
  <% end %>
14
14
  </div>
15
15
  <% unless defined?(simple) %>
@@ -18,6 +18,7 @@
18
18
  month_names: I18n.t(:month_names, scope: :date).instance_eval {|o|
19
19
  o.try(:reject, &:blank?) || o},
20
20
  more: Spree.t(:more),
21
+ move_could_not_be_saved: Spree.t('admin.navigation.move_could_not_be_saved'),
21
22
  name: Spree.t(:name),
22
23
  new_taxon: Spree.t(:new_taxon),
23
24
  next: Spree.t(:next),
@@ -28,6 +29,7 @@
28
29
  remove: Spree.t(:remove),
29
30
  rename: Spree.t(:rename),
30
31
  save: Spree.t(:save, scope: :actions),
32
+ search: Spree.t(:search),
31
33
  searching: Spree.t(:searching),
32
34
  server_error: Spree.t(:server_error),
33
35
  select_an_option: Spree.t(:select_an_option),
@@ -0,0 +1,14 @@
1
+ <%= f.field_container save_to, class: ['form-group'] do %>
2
+ <%= f.label save_to, Spree.t('admin.cms.link_to_product') %>
3
+ <%= f.select save_to,
4
+ options_from_collection_for_select([resource],
5
+ save_to, save_to, resource.send(save_to) || nil),
6
+ { include_blank: true },
7
+ class: 'select2autocomplete',
8
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_product'),
9
+ autocomplete_clear_value: true,
10
+ autocomplete_url_value: 'products_api_v2',
11
+ autocomplete_return_attr_value: 'name',
12
+ autocomplete_custom_return_id_value: 'slug' } %>
13
+ <%= f.error_message_on :save_to %>
14
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <%= f.field_container save_to, class: ['form-group'] do %>
2
+ <%= f.label save_to, Spree.t('admin.cms.link_to_taxon') %>
3
+ <%= f.select save_to,
4
+ options_from_collection_for_select([resource],
5
+ save_to, save_to, resource.send(save_to) || nil),
6
+ { include_blank: true },
7
+ class: 'select2autocomplete',
8
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
9
+ autocomplete_clear_value: true,
10
+ autocomplete_url_value: 'taxons_api_v2',
11
+ autocomplete_return_attr_value: 'permalink',
12
+ autocomplete_custom_return_id_value: 'permalink' } %>
13
+ <%= f.error_message_on :save_to %>
14
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <div class="alert alert-info mt-3">
2
+ <%= Spree.t('admin.navigation.this_link_takes_you_to_your_stores_home_page') %>
3
+ </div>
@@ -0,0 +1,28 @@
1
+ <% if resource.linked_resource %>
2
+ <% resorce_holder = [resource.linked_resource] %>
3
+ <% id_holder = :id %>
4
+ <% name_holder = :title %>
5
+ <% active_id_holder = resource.linked_resource.id %>
6
+ <% end %>
7
+ <%= f.field_container :linked_resource_id, class: ['form-group'] do %>
8
+ <%= f.label :linked_resource_id, Spree.t('page') %>
9
+ <%= f.select :linked_resource_id,
10
+ options_from_collection_for_select(resorce_holder || [],
11
+ id_holder, name_holder, active_id_holder || nil),
12
+ { include_blank: true },
13
+ class: 'select2autocomplete',
14
+ data: { autocomplete_placeholder_value: Spree.t('admin.linkable.seach_for_a_page'),
15
+ autocomplete_clear_value: true,
16
+ autocomplete_url_value: 'pages_api_v2',
17
+ autocomplete_return_attr_value: 'title',
18
+ autocomplete_search_query_value: 'title_i_cont',
19
+
20
+ # Hard coded additional filter to filter out homepages from
21
+ # the results. Homepages don't have a slug, and we already have
22
+ # a dedicated Home Page link_to type.
23
+ autocomplete_additional_query_value: 'type_not_eq',
24
+ autocomplete_additional_term_value: 'Spree::Cms::Pages::Homepage' } %>
25
+
26
+ <%= f.error_message_on :linked_resource_id %>
27
+ <small class="form-text text-muted"><%= resource.link %></small>
28
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% if resource.linked_resource %>
2
+ <% resorce_holder = [resource.linked_resource] %>
3
+ <% id_holder = :id %>
4
+ <% name_holder = :name %>
5
+ <% active_id_holder = resource.linked_resource.id %>
6
+ <% end %>
7
+ <%= f.field_container :linked_resource_id, class: ['form-group'] do %>
8
+ <%= f.label :linked_resource_id, Spree.t('product') %>
9
+ <%= f.select :linked_resource_id,
10
+ options_from_collection_for_select(resorce_holder || [],
11
+ id_holder, name_holder, active_id_holder || nil),
12
+ { include_blank: true },
13
+ class: 'select2autocomplete',
14
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_product'),
15
+ autocomplete_clear_value: true,
16
+ autocomplete_url_value: 'products_api_v2' } %>
17
+
18
+ <%= f.error_message_on :linked_resource_id %>
19
+ <small class="form-text text-muted"><%= resource.link %></small>
20
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <% if resource.linked_resource %>
2
+ <% resource_holder = [resource.linked_resource] %>
3
+ <% id_holder = :id %>
4
+ <% name_holder = :pretty_name %>
5
+ <% active_id_holder = resource.linked_resource.id %>
6
+ <% end %>
7
+
8
+ <%= f.field_container :linked_resource_field, class: ['form-group'] do %>
9
+ <%= f.label :linked_resource_id, Spree.t('taxon') %>
10
+ <%= f.select :linked_resource_id,
11
+ options_from_collection_for_select(resource_holder || [],
12
+ id_holder, name_holder, active_id_holder || nil),
13
+ { include_blank: true },
14
+ class: 'select2autocomplete',
15
+ data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
16
+ autocomplete_clear_value: true,
17
+ autocomplete_url_value: 'taxons_api_v2',
18
+ autocomplete_return_attr_value: 'pretty_name' } %>
19
+
20
+ <%= f.error_message_on :linked_resource_id %>
21
+ <small class="form-text text-muted"><%= resource.link %></small>
22
+ <% end %>