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
@@ -0,0 +1,19 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> /
3
+ <%= link_to @cms_page.title, spree.edit_admin_cms_page_path(@cms_page) %> / <%= @cms_section.name %>
4
+ <% end %>
5
+
6
+ <% content_for :page_actions do %>
7
+ <%= button_link_to(
8
+ Spree.t('admin.cms.go_to_fullscreen_section_manager'),
9
+ spree.edit_admin_cms_page_path(@cms_page) + '?section_editor_full_screen_mode=true',
10
+ class: 'btn-outline-secondary', icon: 'fullscreen.svg', id: 'admin_preview_product'
11
+ ) %>
12
+ <% end %>
13
+
14
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_section } %>
15
+
16
+ <%= form_for [:admin, @cms_page, @cms_section], as: :cms_section, url: spree.admin_cms_page_cms_section_path(@cms_page, @cms_section) do |f| %>
17
+ <%= render partial: 'form', locals: { f: f } %>
18
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
19
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> /
3
+ <%= link_to @cms_page.title, spree.edit_admin_cms_page_path(@cms_page) %> / <%= Spree.t('admin.cms.new_section') %>
4
+ <% end %>
5
+
6
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_section } %>
7
+
8
+ <%= form_for [:admin, @cms_page, @cms_section], url: spree.admin_cms_page_cms_sections_path do |f| %>
9
+ <%= render partial: 'form', locals: { f: f } %>
10
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
11
+ <% end %>
@@ -0,0 +1,50 @@
1
+ <div class="row">
2
+ <div class="col-12 col-md-4">
3
+ <%= f.field_container :title, class: ['form-group'] do %>
4
+ <%= f.label :title, Spree.t('admin.cms.title') %>
5
+ <%= f.text_field :title, class: 'form-control' %>
6
+ <%= f.error_message_on :title %>
7
+ <% end %>
8
+
9
+ <%= f.field_container :subtitle, class: ['form-group'] do %>
10
+ <%= f.label :subtitle, Spree.t('admin.cms.subtitle') %>
11
+ <%= f.text_field :subtitle, class: 'form-control' %>
12
+ <%= f.error_message_on :subtitle %>
13
+ <% end %>
14
+
15
+ <%= f.field_container :button_text, class: ['form-group'] do %>
16
+ <%= f.label :button_text, Spree.t('admin.cms.button_text') %>
17
+ <%= f.text_field :button_text, class: 'form-control' %>
18
+ <%= f.error_message_on :button_text %>
19
+ <% end %>
20
+
21
+ <%= f.field_container :gutters, class: ['form-group'] do %>
22
+ <%= f.label :gutters, Spree.t('admin.cms.gutters') %>
23
+ <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
24
+ <%= f.error_message_on :gutters %>
25
+ <% end %>
26
+
27
+ </div>
28
+ <div class="col-12 col-md-8">
29
+ <%= f.field_container :rte_content, class: ['form-group'] do %>
30
+ <%= f.label :rte_content, Spree.t('admin.cms.content') %>
31
+ <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
32
+ <%= f.error_message_on :rte_content %>
33
+ <% end %>
34
+ </div>
35
+ <div class="col-12"><hr></div>
36
+ <div class="col-12 col-md-6">
37
+ <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
38
+ <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
39
+ <%= f.select(:linked_resource_type,
40
+ spree_humanize_dropdown_values('Spree::Cms::Sections::FeaturedArticle',
41
+ { const: 'LINKED_RESOURCE_TYPE' }),
42
+ {include_blank: false},
43
+ class: 'link_switcher') %>
44
+ <%= f.error_message_on :linked_resource_type %>
45
+ <% end %>
46
+ </div>
47
+ <div class="col-12 col-md-6">
48
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
49
+ </div>
50
+ </div>
@@ -0,0 +1,62 @@
1
+ <div class="row pb-0">
2
+ <div class="col-12 col-md-6">
3
+ <%= f.field_container :title, class: ['form-group'] do %>
4
+ <%= f.label :title, Spree.t('admin.cms.title') %>
5
+ <%= f.text_field :title, class: 'form-control' %>
6
+ <%= f.error_message_on :title %>
7
+ <% end %>
8
+
9
+ <%= f.field_container :button_text, class: ['form-group'] do %>
10
+ <%= f.label :button_text, Spree.t('admin.cms.button_text') %>
11
+ <%= f.text_field :button_text, class: 'form-control' %>
12
+ <%= f.error_message_on :button_text %>
13
+ <% end %>
14
+
15
+ <div class="row">
16
+ <%= f.field_container :fit, class: ['form-group col-6'] do %>
17
+ <%= f.label :fit, Spree.t('admin.cms.fit') %>
18
+ <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
19
+ <%= f.error_message_on :fit %>
20
+ <% end %>
21
+
22
+ <%= f.field_container :gutters, class: ['form-group col-6'] do %>
23
+ <%= f.label :gutters, Spree.t('admin.cms.gutters') %>
24
+ <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
25
+ <%= f.error_message_on :gutters %>
26
+ <% end %>
27
+ </div>
28
+ </div>
29
+ <div class="col-12 col-md-6 pt-4">
30
+ <%= f.field_container :image_one, class: ['form-group'] do %>
31
+ <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
32
+ <figure class="admin-img-holder">
33
+ <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
34
+ </figure>
35
+ <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
36
+ <figure class="admin-img-holder">
37
+ <%= image_tag main_app.url_for(@cms_section.image_one) %>
38
+ </figure>
39
+ <% end %>
40
+ <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
41
+ <%= f.file_field :image_one %>
42
+ <%= f.error_message_on :image_one %>
43
+ <% end %>
44
+ <% end %>
45
+ <small class="form-text text-muted"><%= Spree.t('admin.cms.hero.aspect_ratio') %></small>
46
+ </div>
47
+ <div class="col-12"><hr></div>
48
+ <div class="col-12 col-md-6">
49
+ <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
50
+ <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
51
+ <%= f.select(:linked_resource_type,
52
+ spree_humanize_dropdown_values('Spree::Cms::Sections::HeroImage',
53
+ { const: 'LINKED_RESOURCE_TYPE' }),
54
+ { include_blank: false },
55
+ class: 'link_switcher') %>
56
+ <%= f.error_message_on :linked_resource_type %>
57
+ <% end %>
58
+ </div>
59
+ <div class="col-12 col-md-6">
60
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
61
+ </div>
62
+ </div>
@@ -0,0 +1,177 @@
1
+ <div class="row align-items-center">
2
+ <div id="ImageGalleryLayout" class="col-12 col-md-6 text-center m-auto">
3
+ <div id="LayoutType">
4
+ <div id="Default" class="<% unless @cms_section.layout_style == 'Default' %>d-none<% end %>">
5
+ <%= svg_icon name: "default-layout.svg", width: '150', height: '150' %>
6
+ </div>
7
+ <div id="Reversed" class="<% unless @cms_section.layout_style == 'Reversed' %>d-none<% end %>">
8
+ <%= svg_icon name: "reversed-layout.svg", width: '150', height: '150' %>
9
+ </div>
10
+ </div>
11
+
12
+ <%= f.field_container :layout_style, class: ['form-group'] do %>
13
+ <%= f.label :layout_style, Spree.t('admin.cms.image_gallery.layout_style') %>
14
+ <%= f.select(:layout_style,
15
+ spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
16
+ { const: 'LAYOUT_OPTIONS' }),
17
+ { include_blank: false }) %>
18
+ <%= f.error_message_on :layout_style %>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+
23
+ <div class="row">
24
+ <div class="col-12 col-md-4 mb-3">
25
+ <div class="card p-3">
26
+ <div class="text-center">
27
+ <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_a') %></h4>
28
+ <%= f.field_container :image_one, class: ['form-group'] do %>
29
+ <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
30
+ <figure class="admin-img-holder">
31
+ <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
32
+ </figure>
33
+ <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
34
+ <figure class="admin-img-holder">
35
+ <%= image_tag main_app.url_for(@cms_section.image_one) %>
36
+ </figure>
37
+ <% end %>
38
+ <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
39
+ <%= f.file_field :image_one %>
40
+ <%= f.error_message_on :image_one %>
41
+ <% end %>
42
+ <% end %>
43
+ </div>
44
+ <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
45
+
46
+ <%= f.field_container :title_one, class: ['form-group'] do %>
47
+ <%= f.label :title_one, Spree.t('admin.cms.title') %>
48
+ <%= f.text_field :title_one, class: 'form-control' %>
49
+ <%= f.error_message_on :title_one %>
50
+ <% end %>
51
+
52
+ <div class="col-12"><hr></div>
53
+ <% unless rails_5? %>
54
+ <%= f.field_container :link_type_one, class: ['form-group'] do %>
55
+ <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
56
+ <%= f.select(:link_type_one,
57
+ spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
58
+ { const: 'LINKED_RESOURCE_TYPE' }),
59
+ { include_blank: false },
60
+ class: 'link_switcher',
61
+ data: { target_field: :link_one}) %>
62
+ <%= f.error_message_on :link_type_one %>
63
+ <% end %>
64
+ <% end %>
65
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
66
+ </div>
67
+ </div>
68
+
69
+ <div class="col-12 col-md-4 mb-3">
70
+ <div class="card p-3">
71
+ <div class="text-center">
72
+ <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_b') %></h4>
73
+ <%= f.field_container :image_two, class: ['form-group'] do %>
74
+ <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
75
+ <figure class="admin-img-holder">
76
+ <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
77
+ </figure>
78
+ <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
79
+ <figure class="admin-img-holder">
80
+ <%= image_tag main_app.url_for(@cms_section.image_two) %>
81
+ </figure>
82
+ <% end %>
83
+ <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
84
+ <%= f.file_field :image_two %>
85
+ <%= f.error_message_on :image_two %>
86
+ <% end %>
87
+ <% end %>
88
+ </div>
89
+ <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.tall_image') %></small>
90
+
91
+ <%= f.field_container :title_two, class: ['form-group'] do %>
92
+ <%= f.label :title_two, Spree.t('admin.cms.title') %>
93
+ <%= f.text_field :title_two, class: 'form-control' %>
94
+ <%= f.error_message_on :title_two %>
95
+ <% end %>
96
+
97
+ <div class="col-12"><hr></div>
98
+ <% unless rails_5? %>
99
+ <%= f.field_container :link_type_two, class: ['form-group'] do %>
100
+ <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
101
+ <%= f.select(:link_type_two,
102
+ spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
103
+ { const: 'LINKED_RESOURCE_TYPE' }),
104
+ { include_blank: false },
105
+ class: 'link_switcher',
106
+ data: { target_field: :link_two}) %>
107
+ <%= f.error_message_on :link_type_two %>
108
+ <% end %>
109
+ <% end %>
110
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
111
+ </div>
112
+ </div>
113
+
114
+ <div class="col-12 col-md-4 mb-3">
115
+ <div class="card p-3">
116
+ <div class="text-center">
117
+ <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_c') %></h4>
118
+ <%= f.field_container :image_three, class: ['form-group'] do %>
119
+ <% if @cms_section.image_three.attached? && @cms_section.image_three.variable? %>
120
+ <figure class="admin-img-holder">
121
+ <%= image_tag main_app.url_for(@cms_section.image_three.variant(resize: '244x104>')) %>
122
+ </figure>
123
+ <% elsif @cms_section.image_three.attached? && @cms_section.image_three.image? %>
124
+ <figure class="admin-img-holder">
125
+ <%= image_tag main_app.url_for(@cms_section.image_three) %>
126
+ </figure>
127
+ <% end %>
128
+ <%= f.field_container :image_three, class: ['form-group mb-0'] do %>
129
+ <%= f.file_field :image_three %>
130
+ <%= f.error_message_on :image_three %>
131
+ <% end %>
132
+ <% end %>
133
+ </div>
134
+ <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
135
+
136
+ <%= f.field_container :title_three, class: ['form-group'] do %>
137
+ <%= f.label :title_three, Spree.t('admin.cms.title') %>
138
+ <%= f.text_field :title_three, class: 'form-control' %>
139
+ <%= f.error_message_on :title_three %>
140
+ <% end %>
141
+
142
+ <div class="col-12"><hr></div>
143
+ <% unless rails_5? %>
144
+ <%= f.field_container :link_type_three, class: ['form-group'] do %>
145
+ <%= f.label :link_type_three, Spree.t('admin.navigation.link_to') %>
146
+ <%= f.select(:link_type_three,
147
+ spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
148
+ { const: 'LINKED_RESOURCE_TYPE' }),
149
+ { include_blank: false },
150
+ class: 'link_switcher',
151
+ data: { target_field: :link_three}) %>
152
+ <%= f.error_message_on :link_type_three %>
153
+ <% end %>
154
+ <% end %>
155
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_three, save_to: :link_three, f: f %>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+ <div class="row pb-0">
161
+ <div class="col-12"> <hr></div>
162
+ <%= f.field_container :fit, class: ['form-group col-6'] do %>
163
+ <%= f.label :fit, Spree.t('admin.cms.fit') %>
164
+ <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
165
+ <%= f.error_message_on :fit %>
166
+ <% end %>
167
+
168
+ <%= f.field_container :display_labels, class: ['form-group col-6'] do %>
169
+ <%= f.label :display_labels, Spree.t('admin.cms.image_gallery.display_labels') %>
170
+ <%= f.select(:display_labels,
171
+ spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
172
+ { const: 'LABEL_OPTIONS' }),
173
+ { include_blank: false },
174
+ class:'select2') %>
175
+ <%= f.error_message_on :display_labels %>
176
+ <% end %>
177
+ </div>
@@ -0,0 +1,5 @@
1
+ <div class="row">
2
+ <div class="col-12">
3
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
4
+ </div>
5
+ </div>
@@ -0,0 +1,4 @@
1
+ <%= f.field_container :rte_content, class: ['form-group mb-0'] do %>
2
+ <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
3
+ <%= f.error_message_on :rte_content %>
4
+ <% end %>
@@ -0,0 +1,121 @@
1
+ <div class="row pb-0">
2
+ <div class="col-12 col-md-6 mb-3">
3
+ <div class="card p-3">
4
+ <div class="text-center">
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 %>
7
+ <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
8
+ <figure class="admin-img-holder">
9
+ <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
10
+ </figure>
11
+ <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
12
+ <figure class="admin-img-holder">
13
+ <%= image_tag main_app.url_for(@cms_section.image_one) %>
14
+ </figure>
15
+ <% end %>
16
+ <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
17
+ <%= f.file_field :image_one %>
18
+ <%= f.error_message_on :image_one %>
19
+ <% end %>
20
+ <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
21
+ <% end %>
22
+ </div>
23
+
24
+ <%= f.field_container :title_one, class: ['form-group'] do %>
25
+ <%= f.label :title_one, Spree.t('admin.cms.title') %>
26
+ <%= f.text_field :title_one, class: 'form-control' %>
27
+ <%= f.error_message_on :title_one %>
28
+ <% end %>
29
+
30
+ <%= f.field_container :subtitle_one, class: ['form-group'] do %>
31
+ <%= f.label :subtitle_one, Spree.t('admin.cms.subtitle') %>
32
+ <%= f.text_field :subtitle_one, class: 'form-control' %>
33
+ <%= f.error_message_on :subtitle_one %>
34
+ <% end %>
35
+
36
+ <div class="col-12"><hr></div>
37
+ <% unless rails_5? %>
38
+ <%= f.field_container :link_type_one, class: ['form-group'] do %>
39
+ <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
40
+ <%= f.select(:link_type_one,
41
+ spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
42
+ { const: 'LINKED_RESOURCE_TYPE' }),
43
+ { include_blank: false },
44
+ class: 'link_switcher',
45
+ data: { target_field: :link_one}) %>
46
+ <%= f.error_message_on :link_type_one %>
47
+ <% end %>
48
+ <% end %>
49
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
50
+ </div>
51
+ </div>
52
+
53
+ <div class="col-12 col-md-6 mb-3">
54
+ <div class="card p-3">
55
+ <div class="text-center">
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 %>
58
+ <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
59
+ <figure class="admin-img-holder">
60
+ <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
61
+ </figure>
62
+ <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
63
+ <figure class="admin-img-holder">
64
+ <%= image_tag main_app.url_for(@cms_section.image_two) %>
65
+ </figure>
66
+ <% end %>
67
+ <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
68
+ <%= f.file_field :image_two %>
69
+ <%= f.error_message_on :image_two %>
70
+ <% end %>
71
+ <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
72
+ <% end %>
73
+ </div>
74
+
75
+ <%= f.field_container :title_two, class: ['form-group'] do %>
76
+ <%= f.label :title_two, Spree.t('admin.cms.title') %>
77
+ <%= f.text_field :title_two, class: 'form-control' %>
78
+ <%= f.error_message_on :title_two %>
79
+ <% end %>
80
+
81
+ <%= f.field_container :subtitle_two, class: ['form-group'] do %>
82
+ <%= f.label :subtitle_two, Spree.t('admin.cms.subtitle') %>
83
+ <%= f.text_field :subtitle_two, class: 'form-control' %>
84
+ <%= f.error_message_on :subtitle_two %>
85
+ <% end %>
86
+
87
+ <div class="col-12"><hr></div>
88
+
89
+ <% unless rails_5? %>
90
+ <%= f.field_container :link_type_two, class: ['form-group'] do %>
91
+ <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
92
+ <%= f.select(:link_type_two,
93
+ spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
94
+ { const: 'LINKED_RESOURCE_TYPE' }),
95
+ { include_blank: false },
96
+ class: 'link_switcher',
97
+ data: { target_field: :link_two}) %>
98
+ <%= f.error_message_on :link_type_two %>
99
+ <% end %>
100
+ <% end %>
101
+ <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="col-12"><hr></div>
106
+ <div class="col-6">
107
+ <%= f.field_container :fit, class: ['form-group'] do %>
108
+ <%= f.label :fit, Spree.t('admin.cms.fit') %>
109
+ <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
110
+ <%= f.error_message_on :fit %>
111
+ <% end %>
112
+ </div>
113
+
114
+ <div class="col-6">
115
+ <%= f.field_container :gutters, class: ['form-group'] do %>
116
+ <%= f.label :gutters, Spree.t('admin.cms.set_gutters') %>
117
+ <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
118
+ <%= f.error_message_on :gutters %>
119
+ <% end %>
120
+ </div>
121
+ </div>