spree_backend 4.3.3 → 4.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +222 -0
  3. data/.codeclimate.yml +36 -0
  4. data/.editorconfig +22 -0
  5. data/.eslintignore +7 -0
  6. data/.eslintrc.cjs +29 -0
  7. data/.gem_release.yml +4 -0
  8. data/.github/CONTRIBUTING.md +1 -0
  9. data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  10. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  11. data/.github/ISSUE_TEMPLATE.md +39 -0
  12. data/.github/dependabot.yml +7 -0
  13. data/.github/workflows/spelling_lint.yml +34 -0
  14. data/.gitignore +63 -0
  15. data/.rubocop.yml +197 -0
  16. data/.solargraph.yml +20 -0
  17. data/.stylelintignore +4 -0
  18. data/.stylelintrc +6 -0
  19. data/CODE_OF_CONDUCT.md +22 -0
  20. data/Gemfile +59 -3
  21. data/README.md +123 -0
  22. data/SECURITY.md +1 -0
  23. data/app/assets/config/spree_backend_manifest.js +1 -1
  24. data/app/assets/images/backend-cloud-arrow-up.svg +4 -0
  25. data/app/assets/images/backend-eye-open.svg +1 -1
  26. data/app/assets/images/backend-file-earmark-font.svg +4 -0
  27. data/app/assets/images/backend-file-earmark-image.svg +4 -0
  28. data/app/assets/images/backend-file-earmark-music.svg +4 -0
  29. data/app/assets/images/backend-file-earmark-pdf.svg +4 -0
  30. data/app/assets/images/backend-file-earmark-play.svg +4 -0
  31. data/app/assets/images/backend-file-earmark-spreadsheet.svg +3 -0
  32. data/app/assets/images/backend-file-earmark-zip.svg +4 -0
  33. data/app/assets/images/backend-file-earmark.svg +3 -0
  34. data/app/assets/images/backend-hdd.svg +4 -0
  35. data/app/assets/images/backend-link.svg +4 -0
  36. data/app/assets/images/backend-view.svg +1 -1
  37. data/app/assets/javascripts/spree/backend/adjustments.js +5 -5
  38. data/app/assets/javascripts/spree/backend/admin.js +4 -6
  39. data/app/assets/javascripts/spree/backend/calculator.js +1 -1
  40. data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -1
  41. data/app/assets/javascripts/spree/backend/cms/links.es6 +1 -1
  42. data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +1 -1
  43. data/app/assets/javascripts/spree/backend/cms/page.es6 +22 -40
  44. data/app/assets/javascripts/spree/backend/cms/section.es6 +1 -1
  45. data/app/assets/javascripts/spree/backend/gateway.js +1 -1
  46. data/app/assets/javascripts/spree/backend/general_settings.js +1 -1
  47. data/app/assets/javascripts/spree/backend/global/_index.js +3 -1
  48. data/app/assets/javascripts/spree/backend/global/alerts.es6 +1 -1
  49. data/app/assets/javascripts/spree/backend/global/animate_css.es6 +19 -0
  50. data/app/assets/javascripts/spree/backend/global/fetch_request_utility.es6 +114 -0
  51. data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +2 -1
  52. data/app/assets/javascripts/spree/backend/global/info_alert.es6 +1 -1
  53. data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +1 -1
  54. data/app/assets/javascripts/spree/backend/global/ransack.es6 +7 -5
  55. data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +1 -1
  56. data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +4 -4
  57. data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +2 -2
  58. data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +2 -2
  59. data/app/assets/javascripts/spree/backend/global/sortable.es6 +1 -1
  60. data/app/assets/javascripts/spree/backend/global/tinymce.es6 +3 -2
  61. data/app/assets/javascripts/spree/backend/line_items.js +7 -9
  62. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +23 -28
  63. data/app/assets/javascripts/spree/backend/menus/_index.es6 +0 -1
  64. data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +1 -1
  65. data/app/assets/javascripts/spree/backend/multi_currency.js +2 -2
  66. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
  67. data/app/assets/javascripts/spree/backend/orders/edit.js +1 -1
  68. data/app/assets/javascripts/spree/backend/payments/edit.js +32 -22
  69. data/app/assets/javascripts/spree/backend/payments/new.js +1 -1
  70. data/app/assets/javascripts/spree/backend/product_picker.js +16 -25
  71. data/app/assets/javascripts/spree/backend/progress.js +5 -3
  72. data/app/assets/javascripts/spree/backend/promotions.js +3 -1
  73. data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js +1 -1
  74. data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
  75. data/app/assets/javascripts/spree/backend/shipments.js +80 -79
  76. data/app/assets/javascripts/spree/backend/spree-select2.js +1 -1
  77. data/app/assets/javascripts/spree/backend/states.js +1 -1
  78. data/app/assets/javascripts/spree/backend/stock_location.js +1 -1
  79. data/app/assets/javascripts/spree/backend/stock_management.js +1 -1
  80. data/app/assets/javascripts/spree/backend/stock_movement.js +58 -13
  81. data/app/assets/javascripts/spree/backend/stock_transfer.js +62 -32
  82. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +9 -8
  83. data/app/assets/javascripts/spree/backend/taxons.js +17 -14
  84. data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
  85. data/app/assets/javascripts/spree/backend/users/edit.js +1 -1
  86. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +19 -11
  87. data/app/assets/javascripts/spree/backend/variant_management.js +1 -1
  88. data/app/assets/javascripts/spree/backend/zone.js +1 -1
  89. data/app/assets/javascripts/spree/backend.js +13 -33
  90. data/app/assets/javascripts/spree.js +2 -9
  91. data/app/assets/stylesheets/spree/backend/components/_main.scss +8 -0
  92. data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +1 -1
  93. data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +1 -1
  94. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +1 -1
  95. data/app/assets/stylesheets/spree/backend/shared/_sortable_tree.scss +62 -0
  96. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +3 -0
  97. data/app/assets/stylesheets/spree/backend/views/_digitals.scss +33 -0
  98. data/app/assets/stylesheets/spree/backend/views/_taxonomies.scss +3 -0
  99. data/app/controllers/spree/admin/base_controller.rb +4 -13
  100. data/app/controllers/spree/admin/digitals_controller.rb +33 -0
  101. data/app/controllers/spree/admin/general_settings_controller.rb +0 -5
  102. data/app/controllers/spree/admin/images_controller.rb +1 -1
  103. data/app/controllers/spree/admin/oauth_applications_controller.rb +17 -0
  104. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
  105. data/app/controllers/spree/admin/orders_controller.rb +10 -2
  106. data/app/controllers/spree/admin/payment_methods_controller.rb +2 -2
  107. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  108. data/app/controllers/spree/admin/products_controller.rb +4 -2
  109. data/app/controllers/spree/admin/promotions_controller.rb +1 -1
  110. data/app/controllers/spree/admin/properties_controller.rb +1 -1
  111. data/app/controllers/spree/admin/resource_controller.rb +9 -4
  112. data/app/controllers/spree/admin/return_index_controller.rb +1 -1
  113. data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -2
  114. data/app/controllers/spree/admin/store_credits_controller.rb +2 -2
  115. data/app/controllers/spree/admin/stores_controller.rb +2 -2
  116. data/app/controllers/spree/admin/taxons_controller.rb +23 -38
  117. data/app/controllers/spree/admin/users_controller.rb +6 -19
  118. data/app/controllers/spree/admin/variants_controller.rb +1 -2
  119. data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +48 -0
  120. data/app/helpers/spree/admin/base_helper.rb +27 -9
  121. data/app/helpers/spree/admin/digital_helper.rb +28 -0
  122. data/app/helpers/spree/admin/menu_helper.rb +0 -21
  123. data/app/helpers/spree/admin/navigation_helper.rb +19 -9
  124. data/app/helpers/spree/admin/sortable_tree_helper.rb +31 -0
  125. data/app/helpers/spree/admin/stores_helper.rb +1 -1
  126. data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +31 -0
  127. data/app/javascript/spree/dashboard/controllers/clipboard_controller.js +12 -0
  128. data/app/javascript/spree/dashboard/controllers/password_toggle_controller.js +14 -0
  129. data/app/javascript/spree/dashboard/controllers/sortable_tree_controller.js +55 -0
  130. data/app/javascript/spree/dashboard/controllers/spree_controller.js +25 -0
  131. data/app/javascript/spree/dashboard/controllers/upload_button_controller.js +13 -0
  132. data/app/javascript/spree/dashboard/controllers/webhooks_subscriber_events_controller.js +19 -0
  133. data/app/javascript/spree/dashboard/index.js +49 -0
  134. data/app/{assets/javascripts/spree/backend/global/bootstrap.es6 → javascript/spree/dashboard/utilities/bootstrap.js} +6 -2
  135. data/app/javascript/spree/dashboard/utilities/request_utility.js +54 -0
  136. data/app/models/spree/backend_configuration.rb +11 -0
  137. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  138. data/app/views/spree/admin/adjustments/_form.html.erb +2 -2
  139. data/app/views/spree/admin/adjustments/index.html.erb +1 -0
  140. data/app/views/spree/admin/cms_pages/_form.html.erb +8 -8
  141. data/app/views/spree/admin/cms_pages/edit.html.erb +1 -6
  142. data/app/views/spree/admin/cms_sections/_form.html.erb +2 -2
  143. data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +6 -6
  144. data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +6 -6
  145. data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +12 -12
  146. data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +1 -1
  147. data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +12 -12
  148. data/app/views/spree/admin/countries/_form.html.erb +4 -4
  149. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  150. data/app/views/spree/admin/digitals/_form.html.erb +35 -0
  151. data/app/views/spree/admin/digitals/index.html.erb +25 -0
  152. data/app/views/spree/admin/general_settings/edit.html.erb +1 -22
  153. data/app/views/spree/admin/menu_items/_form.html.erb +6 -6
  154. data/app/views/spree/admin/menus/_form.html.erb +3 -3
  155. data/app/views/spree/admin/menus/edit.html.erb +18 -18
  156. data/app/views/spree/admin/oauth_applications/_form.html.erb +22 -0
  157. data/app/views/spree/admin/oauth_applications/create.turbo_stream.erb +38 -0
  158. data/app/views/spree/admin/oauth_applications/edit.html.erb +13 -0
  159. data/app/views/spree/admin/oauth_applications/index.html.erb +51 -0
  160. data/app/views/spree/admin/oauth_applications/new.html.erb +15 -0
  161. data/app/views/spree/admin/option_types/_form.html.erb +3 -3
  162. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +2 -2
  163. data/app/views/spree/admin/orders/_channel_form.html.erb +1 -1
  164. data/app/views/spree/admin/orders/_form.html.erb +1 -0
  165. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -0
  166. data/app/views/spree/admin/orders/_order_actions.html.erb +6 -0
  167. data/app/views/spree/admin/orders/_search.html.erb +151 -0
  168. data/app/views/spree/admin/orders/index.html.erb +2 -151
  169. data/app/views/spree/admin/payment_methods/_form.html.erb +2 -2
  170. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  171. data/app/views/spree/admin/products/_form.html.erb +19 -19
  172. data/app/views/spree/admin/products/index.html.erb +2 -0
  173. data/app/views/spree/admin/products/new.html.erb +6 -6
  174. data/app/views/spree/admin/promotion_actions/create.js.erb +1 -1
  175. data/app/views/spree/admin/promotion_categories/_form.html.erb +2 -2
  176. data/app/views/spree/admin/promotions/_form.html.erb +5 -5
  177. data/app/views/spree/admin/properties/_form.html.erb +3 -3
  178. data/app/views/spree/admin/prototypes/_form.html.erb +4 -4
  179. data/app/views/spree/admin/refunds/new.html.erb +2 -2
  180. data/app/views/spree/admin/reimbursement_types/_form.html.erb +2 -2
  181. data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -3
  182. data/app/views/spree/admin/roles/_form.html.erb +1 -1
  183. data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
  184. data/app/views/spree/admin/shared/_address_form.html.erb +4 -4
  185. data/app/views/spree/admin/shared/_head.html.erb +4 -8
  186. data/app/views/spree/admin/shared/_main_menu.html.erb +12 -0
  187. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  188. data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -0
  189. data/app/views/spree/admin/shared/_version.html.erb +1 -1
  190. data/app/views/spree/admin/shared/cms/_spree_product.html.erb +2 -2
  191. data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +2 -2
  192. data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +2 -2
  193. data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +2 -2
  194. data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +2 -2
  195. data/app/views/spree/admin/shared/linkables/_url.html.erb +1 -1
  196. data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
  197. data/app/views/spree/admin/{menus/nested_menu_items/_item_bar.html.erb → shared/sortable_tree/_menu.html.erb} +10 -7
  198. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +34 -0
  199. data/app/views/spree/admin/shared/sub_menu/_apps.html.erb +3 -0
  200. data/app/views/spree/admin/shared/sub_menu/_integrations.html.erb +3 -0
  201. data/app/views/spree/admin/shipping_categories/_form.html.erb +1 -1
  202. data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -8
  203. data/app/views/spree/admin/states/_form.html.erb +2 -2
  204. data/app/views/spree/admin/stock_locations/_form.html.erb +2 -2
  205. data/app/views/spree/admin/stock_movements/_form.html.erb +3 -3
  206. data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
  207. data/app/views/spree/admin/store_credits/_form.html.erb +4 -4
  208. data/app/views/spree/admin/stores/_form.html.erb +280 -227
  209. data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
  210. data/app/views/spree/admin/tax_rates/_form.html.erb +4 -3
  211. data/app/views/spree/admin/taxonomies/_form.html.erb +2 -2
  212. data/app/views/spree/admin/taxonomies/edit.html.erb +34 -29
  213. data/app/views/spree/admin/taxons/_form.html.erb +101 -57
  214. data/app/views/spree/admin/taxons/edit.html.erb +6 -3
  215. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  216. data/app/views/spree/admin/taxons/new.html.erb +16 -0
  217. data/app/views/spree/admin/users/_form.html.erb +3 -3
  218. data/app/views/spree/admin/users/edit.html.erb +0 -40
  219. data/app/views/spree/admin/variants/_autocomplete.js.erb +5 -5
  220. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +2 -2
  221. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +6 -6
  222. data/app/views/spree/admin/variants/_split.js.erb +1 -1
  223. data/app/views/spree/admin/variants/index.html.erb +4 -1
  224. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +101 -0
  225. data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +13 -0
  226. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +47 -0
  227. data/app/views/spree/admin/webhooks_subscribers/new.html.erb +13 -0
  228. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +59 -0
  229. data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
  230. data/app/views/spree/admin/zones/_form.html.erb +2 -2
  231. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  232. data/app/views/spree/layouts/admin.html.erb +1 -11
  233. data/codespell.txt +8 -0
  234. data/config/locales/en.yml +273 -0
  235. data/config/routes.rb +8 -4
  236. data/lib/generators/spree/backend/install/install_generator.rb +4 -2
  237. data/lib/generators/spree/backend/install/templates/app/javascript/spree-dashboard.js +7 -0
  238. data/lib/spree/backend/engine.rb +2 -1
  239. data/lib/spree/backend/testing_support/capybara_utils.rb +53 -0
  240. data/lib/spree/backend/testing_support/flash.rb +38 -0
  241. data/lib/spree/backend/testing_support/flatpickr_capybara.rb +126 -0
  242. data/lib/spree/backend/version.rb +9 -0
  243. data/lib/spree/backend.rb +2 -1
  244. data/lib/spree_backend.rb +17 -0
  245. data/license.md +13 -0
  246. data/package.json +46 -0
  247. data/rollup.config.js +41 -0
  248. data/spree_backend.gemspec +17 -16
  249. data/vendor/assets/javascripts/purify.js +1 -1
  250. data/vendor/assets/stylesheets/animate.css +2 -4
  251. data/yarn.lock +959 -0
  252. metadata +120 -38
  253. data/app/assets/javascripts/spree/backend/menus/menu.es6 +0 -57
  254. data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +0 -11
  255. data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +0 -35
  256. data/app/assets/javascripts/spree/backend/taxonomy.js +0 -178
  257. data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -7
  258. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4564
  259. data/vendor/assets/javascripts/js.cookie.js +0 -163
  260. data/vendor/assets/javascripts/modernizr.js +0 -3
  261. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +0 -230
  262. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif +0 -0
  263. /data/app/assets/stylesheets/spree/backend/views/{prototypes.scss → _prototypes.scss} +0 -0
@@ -1,25 +1,25 @@
1
1
  <div class="row pb-0">
2
2
  <div class="col-12 col-md-6">
3
- <%= f.field_container :title, class: ['form-group'] do %>
3
+ <%= f.field_container :title do %>
4
4
  <%= f.label :title, Spree.t('admin.cms.title') %>
5
5
  <%= f.text_field :title, class: 'form-control' %>
6
6
  <%= f.error_message_on :title %>
7
7
  <% end %>
8
8
 
9
- <%= f.field_container :button_text, class: ['form-group'] do %>
9
+ <%= f.field_container :button_text do %>
10
10
  <%= f.label :button_text, Spree.t('admin.cms.button_text') %>
11
11
  <%= f.text_field :button_text, class: 'form-control' %>
12
12
  <%= f.error_message_on :button_text %>
13
13
  <% end %>
14
14
 
15
15
  <div class="row">
16
- <%= f.field_container :fit, class: ['form-group col-6'] do %>
16
+ <%= f.field_container :fit, class: ['col-6'] do %>
17
17
  <%= f.label :fit, Spree.t('admin.cms.fit') %>
18
18
  <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
19
19
  <%= f.error_message_on :fit %>
20
20
  <% end %>
21
21
 
22
- <%= f.field_container :gutters, class: ['form-group col-6'] do %>
22
+ <%= f.field_container :gutters, class: ['col-6'] do %>
23
23
  <%= f.label :gutters, Spree.t('admin.cms.gutters') %>
24
24
  <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
25
25
  <%= f.error_message_on :gutters %>
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </div>
29
29
  <div class="col-12 col-md-6 pt-4">
30
- <%= f.field_container :image_one, class: ['form-group'] do %>
30
+ <%= f.field_container :image_one do %>
31
31
  <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
32
32
  <figure class="admin-img-holder">
33
33
  <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
  <div class="col-12"><hr></div>
47
47
  <div class="col-12 col-md-6">
48
- <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
48
+ <%= f.field_container :linked_resource_type do %>
49
49
  <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
50
50
  <%= f.select(:linked_resource_type,
51
51
  spree_humanize_dropdown_values('Spree::Cms::Sections::HeroImage',
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  </div>
11
11
 
12
- <%= f.field_container :layout_style, class: ['form-group'] do %>
12
+ <%= f.field_container :layout_style do %>
13
13
  <%= f.label :layout_style, Spree.t('admin.cms.image_gallery.layout_style') %>
14
14
  <%= f.select(:layout_style,
15
15
  spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
@@ -25,7 +25,7 @@
25
25
  <div id="image_a_details" class="card p-3">
26
26
  <div class="text-center">
27
27
  <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_a') %></h4>
28
- <%= f.field_container :image_one, class: ['form-group'] do %>
28
+ <%= f.field_container :image_one do %>
29
29
  <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
30
30
  <figure class="admin-img-holder">
31
31
  <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
@@ -42,7 +42,7 @@
42
42
  </div>
43
43
  <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
44
44
 
45
- <%= f.field_container :title_one, class: ['form-group'] do %>
45
+ <%= f.field_container :title_one do %>
46
46
  <%= f.label :title_one, Spree.t('admin.cms.title') %>
47
47
  <%= f.text_field :title_one, class: 'form-control' %>
48
48
  <%= f.error_message_on :title_one %>
@@ -50,7 +50,7 @@
50
50
 
51
51
  <div class="col-12"><hr></div>
52
52
  <% unless rails_5? %>
53
- <%= f.field_container :link_type_one, class: ['form-group'] do %>
53
+ <%= f.field_container :link_type_one do %>
54
54
  <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
55
55
  <%= f.select(:link_type_one,
56
56
  spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
@@ -69,7 +69,7 @@
69
69
  <div id="image_b_details" class="card p-3">
70
70
  <div class="text-center">
71
71
  <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_b') %></h4>
72
- <%= f.field_container :image_two, class: ['form-group'] do %>
72
+ <%= f.field_container :image_two do %>
73
73
  <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
74
74
  <figure class="admin-img-holder">
75
75
  <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
@@ -86,7 +86,7 @@
86
86
  </div>
87
87
  <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.tall_image') %></small>
88
88
 
89
- <%= f.field_container :title_two, class: ['form-group'] do %>
89
+ <%= f.field_container :title_two do %>
90
90
  <%= f.label :title_two, Spree.t('admin.cms.title') %>
91
91
  <%= f.text_field :title_two, class: 'form-control' %>
92
92
  <%= f.error_message_on :title_two %>
@@ -94,7 +94,7 @@
94
94
 
95
95
  <div class="col-12"><hr></div>
96
96
  <% unless rails_5? %>
97
- <%= f.field_container :link_type_two, class: ['form-group'] do %>
97
+ <%= f.field_container :link_type_two do %>
98
98
  <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
99
99
  <%= f.select(:link_type_two,
100
100
  spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
@@ -113,7 +113,7 @@
113
113
  <div id="image_c_details" class="card p-3">
114
114
  <div class="text-center">
115
115
  <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_c') %></h4>
116
- <%= f.field_container :image_three, class: ['form-group'] do %>
116
+ <%= f.field_container :image_three do %>
117
117
  <% if @cms_section.image_three.attached? && @cms_section.image_three.variable? %>
118
118
  <figure class="admin-img-holder">
119
119
  <%= image_tag main_app.url_for(@cms_section.image_three.variant(resize: '244x104>')) %>
@@ -130,7 +130,7 @@
130
130
  </div>
131
131
  <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
132
132
 
133
- <%= f.field_container :title_three, class: ['form-group'] do %>
133
+ <%= f.field_container :title_three do %>
134
134
  <%= f.label :title_three, Spree.t('admin.cms.title') %>
135
135
  <%= f.text_field :title_three, class: 'form-control' %>
136
136
  <%= f.error_message_on :title_three %>
@@ -138,7 +138,7 @@
138
138
 
139
139
  <div class="col-12"><hr></div>
140
140
  <% unless rails_5? %>
141
- <%= f.field_container :link_type_three, class: ['form-group'] do %>
141
+ <%= f.field_container :link_type_three do %>
142
142
  <%= f.label :link_type_three, Spree.t('admin.navigation.link_to') %>
143
143
  <%= f.select(:link_type_three,
144
144
  spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
@@ -156,13 +156,13 @@
156
156
 
157
157
  <div class="row pb-0">
158
158
  <div class="col-12"> <hr></div>
159
- <%= f.field_container :fit, class: ['form-group col-6'] do %>
159
+ <%= f.field_container :fit, class: ['col-6'] do %>
160
160
  <%= f.label :fit, Spree.t('admin.cms.fit') %>
161
161
  <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
162
162
  <%= f.error_message_on :fit %>
163
163
  <% end %>
164
164
 
165
- <%= f.field_container :display_labels, class: ['form-group col-6'] do %>
165
+ <%= f.field_container :display_labels, class: ['col-6'] do %>
166
166
  <%= f.label :display_labels, Spree.t('admin.cms.image_gallery.display_labels') %>
167
167
  <%= f.select(:display_labels,
168
168
  spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
@@ -1,4 +1,4 @@
1
- <%= f.field_container :rte_content, class: ['form-group mb-0'] do %>
1
+ <%= f.field_container :rte_content, class: ['mb-0'] do %>
2
2
  <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
3
3
  <%= f.error_message_on :rte_content %>
4
4
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <div id="left_image_details" class="card p-3">
4
4
  <div class="text-center">
5
5
  <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.left_image') %></h4>
6
- <%= f.field_container :image_one, class: ['form-group'] do %>
6
+ <%= f.field_container :image_one do %>
7
7
  <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
8
8
  <figure class="admin-img-holder">
9
9
  <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
@@ -13,7 +13,7 @@
13
13
  <%= image_tag main_app.url_for(@cms_section.image_one) %>
14
14
  </figure>
15
15
  <% end %>
16
- <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
16
+ <%= f.field_container :image_one, class: ['mb-0'] do %>
17
17
  <%= f.file_field :image_one %>
18
18
  <%= f.error_message_on :image_one %>
19
19
  <% end %>
@@ -21,13 +21,13 @@
21
21
  <% end %>
22
22
  </div>
23
23
 
24
- <%= f.field_container :title_one, class: ['form-group'] do %>
24
+ <%= f.field_container :title_one do %>
25
25
  <%= f.label :title_one, Spree.t('admin.cms.title') %>
26
26
  <%= f.text_field :title_one, class: 'form-control' %>
27
27
  <%= f.error_message_on :title_one %>
28
28
  <% end %>
29
29
 
30
- <%= f.field_container :subtitle_one, class: ['form-group'] do %>
30
+ <%= f.field_container :subtitle_one do %>
31
31
  <%= f.label :subtitle_one, Spree.t('admin.cms.subtitle') %>
32
32
  <%= f.text_field :subtitle_one, class: 'form-control' %>
33
33
  <%= f.error_message_on :subtitle_one %>
@@ -35,7 +35,7 @@
35
35
 
36
36
  <div class="col-12"><hr></div>
37
37
  <% unless rails_5? %>
38
- <%= f.field_container :link_type_one, class: ['form-group'] do %>
38
+ <%= f.field_container :link_type_one do %>
39
39
  <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
40
40
  <%= f.select(:link_type_one,
41
41
  spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
@@ -54,7 +54,7 @@
54
54
  <div id="right_image_details" class="card p-3">
55
55
  <div class="text-center">
56
56
  <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.right_image') %></h4>
57
- <%= f.field_container :image_two, class: ['form-group'] do %>
57
+ <%= f.field_container :image_two do %>
58
58
  <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
59
59
  <figure class="admin-img-holder">
60
60
  <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
@@ -64,7 +64,7 @@
64
64
  <%= image_tag main_app.url_for(@cms_section.image_two) %>
65
65
  </figure>
66
66
  <% end %>
67
- <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
67
+ <%= f.field_container :image_two, class: ['mb-0'] do %>
68
68
  <%= f.file_field :image_two %>
69
69
  <%= f.error_message_on :image_two %>
70
70
  <% end %>
@@ -72,13 +72,13 @@
72
72
  <% end %>
73
73
  </div>
74
74
 
75
- <%= f.field_container :title_two, class: ['form-group'] do %>
75
+ <%= f.field_container :title_two do %>
76
76
  <%= f.label :title_two, Spree.t('admin.cms.title') %>
77
77
  <%= f.text_field :title_two, class: 'form-control' %>
78
78
  <%= f.error_message_on :title_two %>
79
79
  <% end %>
80
80
 
81
- <%= f.field_container :subtitle_two, class: ['form-group'] do %>
81
+ <%= f.field_container :subtitle_two do %>
82
82
  <%= f.label :subtitle_two, Spree.t('admin.cms.subtitle') %>
83
83
  <%= f.text_field :subtitle_two, class: 'form-control' %>
84
84
  <%= f.error_message_on :subtitle_two %>
@@ -87,7 +87,7 @@
87
87
  <div class="col-12"><hr></div>
88
88
 
89
89
  <% unless rails_5? %>
90
- <%= f.field_container :link_type_two, class: ['form-group'] do %>
90
+ <%= f.field_container :link_type_two do %>
91
91
  <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
92
92
  <%= f.select(:link_type_two,
93
93
  spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
@@ -104,7 +104,7 @@
104
104
 
105
105
  <div class="col-12"><hr></div>
106
106
  <div class="col-6">
107
- <%= f.field_container :fit, class: ['form-group'] do %>
107
+ <%= f.field_container :fit do %>
108
108
  <%= f.label :fit, Spree.t('admin.cms.fit') %>
109
109
  <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
110
110
  <%= f.error_message_on :fit %>
@@ -112,7 +112,7 @@
112
112
  </div>
113
113
 
114
114
  <div class="col-6">
115
- <%= f.field_container :gutters, class: ['form-group'] do %>
115
+ <%= f.field_container :gutters do %>
116
116
  <%= f.label :gutters, Spree.t('admin.cms.set_gutters') %>
117
117
  <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
118
118
  <%= f.error_message_on :gutters %>
@@ -1,23 +1,23 @@
1
1
  <div data-hook="admin_country_form_fields">
2
- <%= f.field_container :name, class: ['form-group'], 'data-hook' => 'name' do %>
2
+ <%= f.field_container :name, 'data-hook' => 'name' do %>
3
3
  <%= f.label :name, Spree.t(:name) %>
4
4
  <%= f.text_field :name, class: 'form-control' %>
5
5
  <%= f.error_message_on :name %>
6
6
  <% end %>
7
7
 
8
- <%= f.field_container :iso_name, class: ['form-group'], 'data-hook' => 'iso_name' do %>
8
+ <%= f.field_container :iso_name, 'data-hook' => 'iso_name' do %>
9
9
  <%= f.label :iso_name, Spree.t(:iso_name) %>
10
10
  <%= f.text_field :iso_name, class: 'form-control' %>
11
11
  <%= f.error_message_on :iso_name %>
12
12
  <% end %>
13
13
 
14
- <%= f.field_container :iso, class: ['form-group'], 'data-hook' => 'iso' do %>
14
+ <%= f.field_container :iso, 'data-hook' => 'iso' do %>
15
15
  <%= f.label :iso, Spree.t(:iso) %>
16
16
  <%= f.text_field :iso, class: 'form-control' %>
17
17
  <%= f.error_message_on :iso %>
18
18
  <% end %>
19
19
 
20
- <%= f.field_container :iso3, class: ['form-group'], 'data-hook' => 'iso3' do %>
20
+ <%= f.field_container :iso3, 'data-hook' => 'iso3' do %>
21
21
  <%= f.label :iso3, Spree.t(:iso3) %>
22
22
  <%= f.text_field :iso3, class: 'form-control' %>
23
23
  <%= f.error_message_on :iso3 %>
@@ -22,7 +22,7 @@
22
22
  <% end %>
23
23
  </fieldset>
24
24
 
25
- <%= f.field_container :stock_location, class: ['form-group'] do %>
25
+ <%= f.field_container :stock_location do %>
26
26
  <%= f.label :stock_location, Spree.t(:stock_location) %> <span class="required">*</span>
27
27
  <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name.humanize, l.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
28
28
  <%= f.error_message_on :stock_location %>
@@ -0,0 +1,35 @@
1
+ <%= form_for :digital, url: admin_product_digitals_path(@product) do |f| %>
2
+ <% if variant.digital? %>
3
+ <div class="row">
4
+ <% variant.digitals.each do |digital| %>
5
+ <div class="col-12 col-md-6 mb-3 removable-dom-element">
6
+ <div class="d-flex flex-row align-items-center digital-container border rounded">
7
+ <div class="col p-0 delete-digital-icon-container">
8
+ <%= asset_icon(digital) %>
9
+ </div>
10
+ <div class="col p-2 delete-digital-info-container">
11
+ <span>Name:</span> <span class="text-secondary"><%= digital.attachment.filename %></span><br>
12
+ <span>Size:</span> <span class="text-secondary"><%= number_to_human_size(digital.attachment.byte_size) %></span>
13
+ </div>
14
+ <div class="col p-2 text-right delete-digital-button-container">
15
+ <%= link_to (svg_icon name: "close.svg", width: '20', height: '20'), admin_product_digital_url(@product, digital), data: { confirm: Spree.t('admin.digitals.delete_file_confirmation', filename: digital.attachment.filename) }, method: :delete, class: 'btn delete-resource delete-digital-asset' %>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ <% end %>
20
+ </div>
21
+ <% else %>
22
+ <div class="alert alert-info no-objects-found">
23
+ <%= Spree.t('admin.digitals.no_digital_assets_added') %>
24
+ </div>
25
+ <% end %>
26
+
27
+ <%= f.field_container :attachment, data: {controller: "upload-button"} do %>
28
+ <%= f.label :file, Spree.t('admin.digitals.add_new_file'), id: "digital_attachment_#{variant.id}" %> <span class="required">*</span><br>
29
+ <%= f.file_field :attachment, id: "digital_attachment_#{variant.id}", required: true, data: { action: "input->upload-button#buttonState" } %>
30
+ <%= hidden_field_tag 'digital[variant_id]', variant.id %>
31
+ <%= button Spree.t('admin.digitals.upload'), 'add.svg', 'submit', { data: { upload_button_target: "uploadButton" } } %>
32
+ <br>
33
+ <%= f.error_message_on :attachment %>
34
+ <% end %>
35
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :digitals } %>
2
+
3
+ <div class="row">
4
+ <% if @product.has_variants? %>
5
+ <% @product.variants.each do |variant| %>
6
+ <div class="col-12 mb-5 ">
7
+ <div class="card">
8
+ <div class="card-header">
9
+ <h5 class="card-title mb-0"><%= variant.options_text %></h5>
10
+ </div>
11
+ <div class="card-body">
12
+ <div class="col-12 p-0">
13
+ <%= render 'form', variant: variant %>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <% end %>
19
+ <% else %>
20
+ <div class="col-12">
21
+ <%= render 'form', variant: @product.master %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+
@@ -67,7 +67,7 @@
67
67
 
68
68
  <div class="card-body">
69
69
  <div class="alert alert-warning col-12">
70
- This can be overriden by individual Store settings
70
+ This can be overridden by individual Store settings
71
71
  </div>
72
72
  <div class="form-group">
73
73
  <%= label_tag :currency, Spree.t(:default_currency) %>
@@ -75,27 +75,6 @@
75
75
  </div>
76
76
  </div>
77
77
  </div>
78
-
79
- <div class="card mb-3" id="general-settings-stores" data-hook="general_settings_stores">
80
- <div class="card-header">
81
- <h1 class="card-title mb-0 h5">
82
- <%= Spree.t(:multiple_stores) %>
83
- </h1>
84
- </div>
85
- <div class="card-body">
86
- <div class="alert alert-warning col-12">
87
- <%= Spree.t('show_store_selector.long') %>
88
- </div>
89
- <div class="form-group">
90
- <div class="checkbox">
91
- <label>
92
- <%= check_box('', :show_store_selector, { checked: Spree::Config.show_store_selector }) %>
93
- <%= Spree.t('show_store_selector.short') %>
94
- </label>
95
- </div>
96
- </div>
97
- </div>
98
- </div>
99
78
  </div>
100
79
  </div>
101
80
 
@@ -6,13 +6,13 @@
6
6
  <h5 class="mb-0"><%= Spree.t('admin.navigation.settings') %></h5>
7
7
  </div>
8
8
  <div class="card-body">
9
- <%= f.field_container :item_type, class: ['form-group'] do %>
9
+ <%= f.field_container :item_type do %>
10
10
  <%= f.label :item_type, Spree.t('admin.navigation.item_type') %>
11
11
  <%= f.select(:item_type, @menu_item_types, {include_blank: false}) %>
12
12
  <%= f.error_message_on :item_type %>
13
13
  <% end %>
14
14
 
15
- <%= f.field_container :code, class: ['form-group'] do %>
15
+ <%= f.field_container :code do %>
16
16
  <%= f.label :code, Spree.t('admin.navigation.code') %>
17
17
  <%= f.text_field :code, class: 'form-control' %>
18
18
  <%= f.error_message_on :code %>
@@ -21,7 +21,7 @@
21
21
  </small>
22
22
  <% end %>
23
23
 
24
- <%= f.field_container :parent_id, class: ['form-group'] do %>
24
+ <%= f.field_container :parent_id do %>
25
25
  <%= f.label :parent_id, Spree.t('admin.navigation.nested_under') %>
26
26
  <%= f.select :parent_id, nested_set_options(@menu.menu_items, @menu_item) {|i| "#{'-' * i.level} #{i.name}" }, {include_blank: false}, {class: 'select2'} %>
27
27
  <%= f.error_message_on :parent_id %>
@@ -39,13 +39,13 @@
39
39
  <h5 class="mb-0"><%= Spree.t('admin.navigation.public_details') %></h5>
40
40
  </div>
41
41
  <div class="card-body">
42
- <%= f.field_container :name, class: ['form-group'] do %>
42
+ <%= f.field_container :name do %>
43
43
  <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
44
44
  <%= f.text_field :name, class: 'form-control', required: true %>
45
45
  <%= f.error_message_on :name %>
46
46
  <% end %>
47
47
 
48
- <%= f.field_container :subtitle, class: ['form-group'] do %>
48
+ <%= f.field_container :subtitle do %>
49
49
  <%= f.label :subtitle, Spree.t('admin.navigation.subtitle') %>
50
50
  <%= f.text_field :subtitle, class: 'form-control' %>
51
51
  <%= f.error_message_on :subtitle %>
@@ -93,7 +93,7 @@
93
93
  <div class="card-body">
94
94
  <div class="row">
95
95
  <div class="col-12 col-md-6">
96
- <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
96
+ <%= f.field_container :linked_resource_type do %>
97
97
  <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
98
98
  <%= f.select(:linked_resource_type, spree_humanize_dropdown_values('Spree::MenuItem', {const: 'LINKED_RESOURCE_TYPE'}), {include_blank: false}, class: 'link_switcher') %>
99
99
  <%= f.error_message_on :linked_resource_type %>
@@ -1,17 +1,17 @@
1
1
  <div data-hook="admin_menu_form_fields" class="row">
2
- <%= f.field_container :name, class: ['form-group col-12 col-md-4'] do %>
2
+ <%= f.field_container :name, class: ['col-12 col-md-4'] do %>
3
3
  <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
4
4
  <%= f.text_field :name, class: 'form-control', required: true %>
5
5
  <%= f.error_message_on :name %>
6
6
  <% end %>
7
7
 
8
- <%= f.field_container :location, class: ['form-group col-12 col-md-4'] do %>
8
+ <%= f.field_container :location, class: ['col-12 col-md-4'] do %>
9
9
  <%= f.label :location, Spree.t('location') %>
10
10
  <%= f.select(:location, spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_LOCATIONS', paramterize_values: true }), {include_blank: false}, class: 'select2') %>
11
11
  <%= f.error_message_on :location %>
12
12
  <% end %>
13
13
 
14
- <%= f.field_container :locale, class: ['form-group col-12 col-md-4'] do %>
14
+ <%= f.field_container :locale, class: ['col-12 col-md-4'] do %>
15
15
  <%= f.label :language %>
16
16
  <%= f.select :locale, options_from_collection_for_select(all_locales_options, :last, :first, @menu.locale || I18n.locale), {}, { class: 'select2' } %>
17
17
  <%= f.error_message_on :default_locale %>
@@ -3,25 +3,25 @@
3
3
  <% end %>
4
4
 
5
5
  <div class="row">
6
- <div class="col-12">
7
- <div class="card mb-3">
8
- <div class="card-header">
9
- <h5 class="mb-0"><%= Spree.t('settings') %></h5>
10
- </div>
11
- <div class="card-body">
12
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
13
- <%= form_for [:admin, @menu] do |f| %>
14
- <%= render partial: 'form', locals: { f: f } %>
15
- <div class="d-flex ">
16
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
17
- </div>
18
- <% end %>
19
- </div>
6
+ <div class="col-12">
7
+ <div class="card mb-3">
8
+ <div class="card-header">
9
+ <h5 class="mb-0"><%= Spree.t('settings') %></h5>
10
+ </div>
11
+ <div class="card-body">
12
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
13
+ <%= form_for [:admin, @menu] do |f| %>
14
+ <%= render partial: 'form', locals: { f: f } %>
15
+ <div class="d-flex ">
16
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
17
+ </div>
18
+ <% end %>
19
+ </div>
20
20
  </div>
21
21
  </div>
22
22
  </div>
23
23
 
24
- <div id="menuArea">
24
+ <div id="sortableTreeArea">
25
25
  <div class="row mt-2">
26
26
  <div class="col-12">
27
27
  <div class="card mb-3">
@@ -37,11 +37,11 @@
37
37
  </div>
38
38
 
39
39
  <% if @menu.root.present? %>
40
- <div class="card-body p-0 bg-light">
41
- <div id="primaryMenuContainer" class="menu-container" data-parent-id="<%= @menu.root.id %>">
40
+ <div class="card-body p-0 bg-light" data-controller="sortable-tree" data-sortable-tree-handle-value=".move-handle">
41
+ <div data-sortable-tree-parent-id-value="<%= @menu.root.id %>">
42
42
  <% if @menu.root.children.present? %>
43
43
  <% @menu.root.children.each do |root_children| %>
44
- <%= build_menu_item(@menu, root_children) %>
44
+ <%= build_sortable_tree(@menu, root_children) %>
45
45
  <% end %>
46
46
  <% else %>
47
47
  <div class="alert alert-info no-objects-found m-5">
@@ -0,0 +1,22 @@
1
+ <div data-hook="admin_oauth_application_form_fields">
2
+ <%= f.field_container :name, 'data-hook' => "oauth_application_name" do %>
3
+ <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
4
+ <%= f.text_field :name, class: 'form-control', required: true %>
5
+ <%= f.error_message_on :name %>
6
+ <% end %>
7
+
8
+ <%= f.field_container :scopes, 'data-hook' => "oauth_application_scopes" do %>
9
+ <%= f.label :scopes, Spree.t(:scopes) %> <span class="required">*</span>
10
+ <%= f.text_field :scopes, class: 'form-control' %>
11
+ <%= f.error_message_on :scopes %>
12
+ <small class="form-text text-muted">
13
+ Possible values:
14
+ <ul>
15
+ <li><strong>admin read</strong> - read only access</li>
16
+ <li><strong>admin write</strong> - read and write access</li>
17
+ </ul>
18
+ </small>
19
+ <% end %>
20
+
21
+ <div data-hook="additional_oauth_application_fields"></div>
22
+ </div>
@@ -0,0 +1,38 @@
1
+ <%= turbo_stream.replace "new_oauth_application" do %>
2
+ <div data-controller="clipboard" class="mb-3 p-3 col-lg-7">
3
+ <div class="form-group">
4
+ <%= label_tag :client_id, 'Client ID' %>
5
+ <div class="input-group">
6
+ <%= text_area_tag :client_id, @object.uid, class: 'form-control bg-transparent p-0 mt-4 mr-4 border-0', rows: 2, data: { clipboard_target: 'source', action: 'clipboard#copy' }, readonly: true %>
7
+ <div class="input-append">
8
+ <button data-action="clipboard#copy" class="btn m-0 mt-4">
9
+ <%= svg_icon name: 'clone.svg', width: 18, height: 18 %>
10
+ <%= Spree.t(:copy_to_clipboard, scope: :admin ) %>
11
+ </button>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div data-controller="clipboard" class="mb-3 p-3 col-lg-7">
18
+ <div class="form-group">
19
+ <%= label_tag :client_secret, 'Client Secret' %>
20
+ <div class="input-group">
21
+ <%= text_area_tag :client_secret, @object.plaintext_secret, class: 'form-control bg-transparent p-0 mt-4 mr-4 border-0', rows: 2, data: { clipboard_target: 'source', action: 'clipboard#copy' }, readonly: true %>
22
+ <div class="input-append">
23
+ <button data-action="clipboard#copy" class="btn m-0 mt-4">
24
+ <%= svg_icon name: 'clone.svg', width: 18, height: 18 %>
25
+ <%= Spree.t(:copy_to_clipboard, scope: :admin ) %>
26
+ </button>
27
+ </div>
28
+ </div>
29
+ <small class="form-text text-muted mt-4">
30
+ This is your application's secret token, copy it now and keep it safe. It won't be shown again.
31
+ </small>
32
+ </div>
33
+ </div>
34
+
35
+ <hr />
36
+
37
+ <%= link_to 'Back to list', spree.admin_oauth_applications_url %>
38
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.oauth_applications.list'), spree.admin_oauth_applications_url %> /
3
+ <%= @oauth_application.name.capitalize %>
4
+ <% end %>
5
+
6
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @oauth_application } %>
7
+
8
+ <%= form_for [:admin, @oauth_application] do |f| %>
9
+ <fieldset>
10
+ <%= render partial: 'form', locals: { f: f } %>
11
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
12
+ </fieldset>
13
+ <% end %>