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
@@ -0,0 +1,135 @@
1
+ <div id="<% if @cms_page.type == 'Spree::Cms::Pages::StandardPage' %>standardPage<% end %>" data-hook="admin_page_form_fields">
2
+ <div class="row sp-pb-0">
3
+ <div class="col-12">
4
+ <div class="card sp-card">
5
+ <% unless %w[new create].include? controller.action_name %>
6
+ <div class="card-header col-12">
7
+ <div class="row no-gutters pb-0">
8
+ <div class="col d-flex justify-content-start align-items-center">
9
+ <%= f.field_container :visible, class: ['form-group pb-0 mb-0'] do %>
10
+ <div class="custom-control custom-switch custom-switch-md">
11
+ <%= f.check_box :visible, class: 'custom-control-input', data: {cms_page_id: @cms_page.id} %>
12
+ <label class="custom-control-label" for="cms_page_visible"></label>
13
+ <%= f.error_message_on :visible %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <span id="visibilityStatus" class="d-flex align-items-center">
18
+ <span class="page_hidden badge badge-secondary <% if @cms_page.visible? %>d-none<% end %>">
19
+ <%= svg_icon name: "eye-slash-fill.svg", width: '18', height: '18' %> <%= Spree.t('admin.cms.draft_mode') %>
20
+ </span>
21
+
22
+ <span class="page_visible badge badge-primary <% if @cms_page.draft_mode? %>d-none<% end %>">
23
+ <%= svg_icon name: "view.svg", width: '18', height: '18' %> <%= Spree.t('admin.cms.visible') %>
24
+ </span>
25
+ </span>
26
+ </div>
27
+ <div class="col-auto d-flex align-items-center">
28
+ <span class="badge badge-secondary">
29
+ <%= svg_icon name: "translate.svg", width: '18', height: '18' %> <%= locale_full_name(@cms_page.locale) %>
30
+ </span>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <% end %>
35
+
36
+ <div class="card-body pb-2">
37
+ <div class="row pb-0">
38
+
39
+ <%= f.field_container :title, class: ['form-group col-12 col-md-6'] do %>
40
+ <%= f.label :title, raw(Spree.t('admin.cms.title') + required_span_tag) %>
41
+ <%= f.text_field :title, class: 'form-control', required: true %>
42
+ <%= f.error_message_on :title %>
43
+ <% end %>
44
+
45
+ <%= f.field_container :type, class: ['form-group col-12 col-md-6'] do %>
46
+ <%= f.label :type, Spree.t('admin.cms.page_type') %>
47
+ <%= f.select(:type, spree_humanize_dropdown_values('Spree::CmsPage', {const: 'TYPES'}), {include_blank: false}, class: 'select2') %>
48
+ <%= f.error_message_on :type %>
49
+ <% end %>
50
+
51
+ <% unless %w[new create].include? controller.action_name %>
52
+ <div class="col-12 mt-3">
53
+ <div id="updatePageType" data-page-type="<%= @cms_page.type %>" class="alert alert-info d-none">
54
+ <% button_type = Spree.t('update') %>
55
+ <%= raw Spree.t('admin.cms.click_button_to_change_page_type', button_type: button_type) %>
56
+ </div>
57
+ </div>
58
+ <% end %>
59
+ </div>
60
+
61
+ <div class="<% unless %w[new create].include? controller.action_name %>collapse<% end %>" id="cmsPageSettings">
62
+ <div class="row pb-0">
63
+ <div class="col-12"><hr></div>
64
+ <%= f.field_container :locale, class: ['form-group col-12 col-md-4'] do %>
65
+ <%= f.label :language %>
66
+ <%= f.select :locale, options_from_collection_for_select(supported_locales_options, :last, :first, @cms_page.locale || I18n.locale), {}, { class: 'select2' } %>
67
+ <%= f.error_message_on :default_locale %>
68
+ <% end %>
69
+
70
+ <%= f.field_container :meta_title, class: ['form-group col-12 col-md-4'] do %>
71
+ <%= f.label :meta_title, Spree.t('admin.cms.meta_title') %>
72
+ <%= f.text_field :meta_title, class: 'form-control' %>
73
+ <%= f.error_message_on :meta_title %>
74
+ <% end %>
75
+
76
+ <%= f.field_container :slug, class: ['form-group col-12 col-md-4'] do %>
77
+ <div id="noHomePage">
78
+ <%= f.label :slug, Spree.t('slug') %>
79
+ <%= f.text_field :slug, class: 'form-control', disabled: @cms_page.homepage? %>
80
+ <%= f.error_message_on :slug %>
81
+ </div>
82
+ <% end %>
83
+
84
+ <%= f.field_container :meta_description, class: ['form-group col-12'] do %>
85
+ <%= f.label :meta_description, Spree.t('admin.cms.meta_description') %>
86
+ <%= f.text_area :meta_description, { rows: 3, class: 'form-control' } %>
87
+ <%= f.error_message_on :meta_description %>
88
+ <% end %>
89
+ </div>
90
+ </div>
91
+
92
+ <% unless %w[new create].include? controller.action_name %>
93
+ <div class="row pb-0">
94
+ <% if @cms_page.type != 'Spree::Cms::Pages::StandardPage' %>
95
+ <div class="col-12 col-sm-7">
96
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
97
+ </div>
98
+ <% else %>
99
+ <div class="col"></div>
100
+ <% end %>
101
+
102
+ <div class="col-12 col-sm text-right pt-3 pt-sm-0">
103
+ <button id="toggleMorePageSettingsButton" class="btn btn-outline-secondary" type="button" data-toggle="collapse" data-target="#cmsPageSettings" aria-expanded="false" aria-controls="collapsePageSettings">
104
+ <%= raw Spree.t('admin.cms.more_page_settings') %>
105
+ </button>
106
+ </div>
107
+ </div>
108
+ <% end %>
109
+
110
+ <% if %w[new create].include? controller.action_name %>
111
+ <div class="row pb-0">
112
+ <div class="col-6">
113
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
114
+ </div>
115
+ </div>
116
+ <% end %>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+
123
+ <% if @cms_page.type == 'Spree::Cms::Pages::StandardPage' %>
124
+ <div class="row">
125
+ <div class="col-12">
126
+ <%= f.field_container :content, class: ['form-group'] do %>
127
+ <%= f.text_area :content, { rows: 22, class: 'spree-rte'} %>
128
+ <%= f.error_message_on :content %>
129
+ <% end %>
130
+ </div>
131
+ </div>
132
+ <div class="d-flex ">
133
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
134
+ </div>
135
+ <% end %>
@@ -0,0 +1,61 @@
1
+ <div class="row">
2
+ <div id="pageSectionsArea" class="col-12">
3
+
4
+ <hr class="mt-4 hide-on-full-screen-mode">
5
+ <div class="row">
6
+ <div class="col d-flex justify-content-start">
7
+ <%= button_link_to Spree.t('admin.cms.add_new_section'), spree.new_admin_cms_page_cms_section_path(@cms_page), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
8
+ </div>
9
+ <div class="col d-none d-md-flex justify-content-end">
10
+ <div id="LiveViewSwitcher" class="btn-group btn-group-toggle" data-toggle="buttons">
11
+ <label class="btn btn-outline-primary active">
12
+ <input type="radio" name="options" id="mobileLiveView" autocomplete="off"> Mobile
13
+ </label>
14
+ <label class="btn btn-outline-primary">
15
+ <input type="radio" name="options" id="tabletLiveView" autocomplete="off"> Tablet
16
+ </label>
17
+ <label class="btn btn-outline-primary">
18
+ <input type="radio" name="options" id="desktopLiveView" autocomplete="off" checked> Desktop
19
+ </label>
20
+ </div>
21
+
22
+ <div class="ml-2">
23
+ <button id="cmsSectionEditorFullScreen" type="button" class="btn btn-outline-primary no-wrap" data-toggle="button" autocomplete="off"><%= raw Spree.t('admin.cms.full_screen_mode') %></button>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <div class="row no-gutters">
28
+ <div id="draggableSectionsHolder" class="col-12 col-md-3 bg-light border">
29
+ <% if @cms_page.cms_sections.any? %>
30
+ <div id="cmsPagesectionsArea" class="card-body row m-0 p-1 no-gutters">
31
+ <% @cms_page.cms_sections.each do |section| %>
32
+ <%= render 'spree/admin/cms_pages/section_template', section: section %>
33
+ <% end %>
34
+ </div>
35
+
36
+ <% else %>
37
+ <div class="row">
38
+ <div class="col-12">
39
+ <div class="alert alert-info no-objects-found m-4">
40
+ <%= raw Spree.t('admin.cms.no_sections_found_please_add_one') %>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <% end %>
45
+ </div>
46
+
47
+ <div class="d-none d-md-block col bg-secondary border border-left-0">
48
+ <div id="liveViewCont" class="desktopLiveView">
49
+ <div class="embed-responsive embed-responsive-4by3">
50
+ <iframe class="embed-responsive-item"
51
+ id="pageLivePreview"
52
+ src="<%= cms_page_preview_url(@cms_page) + "?no_cache=#{rand(1...10000)}" %>"
53
+ sandbox="allow-same-origin allow-forms allow-popups allow-scripts allow-modals">
54
+ </iframe>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+ </div>
60
+ </div>
61
+ </div>
@@ -0,0 +1,16 @@
1
+ <div class="col-12 p-0 removable-dom-element" data-section-id="<%= section.id %>">
2
+ <div class="row m-0 mb-1 pb-0 border border-secondary bg-white">
3
+ <div class="col move-handle d-flex pr-0 truncate">
4
+ <div class="py-3 align-items-center overflow-hidden w-100">
5
+ <h6 class="m-0 truncate"><%= section.name %></h6>
6
+ <small class="form-text mt-0 text-muted"><%= spree_humanize_type(section.type) %></small>
7
+ </div>
8
+ </div>
9
+ <div>
10
+ <div class="col h-100 d-flex flex-column align-self-sm-stretch p-0 justify-content-between actions cms_section_action_col">
11
+ <%= link_to_edit(section, no_text: true, url: spree.edit_admin_cms_page_cms_section_path(@cms_page, section)) %>
12
+ <%= link_to_delete(section, no_text: true, url: spree.admin_cms_page_cms_section_path(@cms_page, section)) if can?(:destroy, section) %>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,21 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= @cms_page.title %>
3
+ <% end %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <%= button_link_to(Spree.t('admin.cms.preview_page'),
7
+ cms_page_preview_url(@cms_page),
8
+ class: 'btn-outline-secondary',
9
+ icon: 'view.svg',
10
+ id: 'admin_preview_product',
11
+ target: :blank) %>
12
+ <% end %>
13
+
14
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_page } %>
15
+ <%= form_for [:admin, @cms_page], as: :cms_page, url: spree.admin_cms_page_path do |f| %>
16
+ <%= render partial: 'form', locals: { f: f } %>
17
+ <% end %>
18
+
19
+ <% if @cms_page.sections? %>
20
+ <%= render partial: 'live_preview_area' %>
21
+ <% end %>
@@ -0,0 +1,84 @@
1
+ <% content_for :page_title do %>
2
+ <%= Spree.t('admin.cms.all_pages') %>
3
+ <% end %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <%= button_link_to Spree.t('admin.cms.add_new_page'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_page' } %>
7
+ <% end if can?(:create, Spree::CmsPage) %>
8
+
9
+ <% content_for :table_filter do %>
10
+ <div data-hook="admin_menus_sidebar">
11
+ <%= search_form_for [:admin, @search] do |f| %>
12
+ <%- locals = {f: f} %>
13
+ <div class="row">
14
+ <div class="col-12 col-lg-4">
15
+ <div class="form-group">
16
+ <%= f.label :title_cont, Spree.t('admin.cms.title') %>
17
+ <%= f.text_field :title_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
18
+ </div>
19
+ </div>
20
+
21
+ <div class="col-12 col-lg-4">
22
+ <div class="form-group">
23
+ <%= label_tag :q_type_eq, Spree.t(:type) %>
24
+ <%= f.select(:type_eq, spree_humanize_dropdown_values('Spree::CmsPage', {const: 'TYPES'}), {include_blank: true}, class: 'select2-clear js-filterable') %>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="col-12 col-lg-4">
29
+ <div class="form-group">
30
+ <%= label_tag :q_locale_eq, Spree.t(:language) %>
31
+ <%= f.select :locale_eq, all_locales_options, { include_blank: true }, class: 'select2-clear js-filterable' %>
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+ <div data-hook="admin_menus_index_search_buttons" class="form-actions">
37
+ <%= button Spree.t(:search), 'search.svg' %>
38
+ </div>
39
+ <% end %>
40
+ </div>
41
+ <% end %>
42
+
43
+ <% if @cms_pages.any? %>
44
+ <div class="table-responsive">
45
+ <table class="table" id="pagesTable">
46
+ <thead>
47
+ <th scope="col"><%= Spree.t('admin.cms.title') %></th>
48
+ <th scope="col"><%= Spree.t('admin.cms.visible') %></th>
49
+ <th scope="col"><%= Spree.t('admin.cms.page_type') %></th>
50
+ <th scope="col"><%= Spree.t('language') %></th>
51
+ <th scope="col"></th>
52
+ </thead>
53
+ <tbody>
54
+ <% @cms_pages.each do |page| %>
55
+ <tr>
56
+ <td>
57
+ <%= page.title %>
58
+ </td>
59
+ <td>
60
+ <%= active_badge(page.visible?) %>
61
+ </td>
62
+ <td>
63
+ <%= spree_humanize_type(page.type) %>
64
+ </td>
65
+ <td>
66
+ <%= locale_full_name(page.locale) %>
67
+ </td>
68
+ <td class="actions" data-hook="admin_pages_index_row_actions">
69
+ <span class="d-flex justify-content-end">
70
+ <%= link_to_edit(page, no_text: true) %>
71
+ <%= link_to_delete page, no_text: true, url: spree.admin_cms_page_path(page) if can?(:destroy, page) %>
72
+ </span>
73
+ </td>
74
+ </tr>
75
+ <% end %>
76
+ </tbody>
77
+ </table>
78
+ </div>
79
+ <%= render 'spree/admin/shared/index_table_options', collection: @cms_pages, simple: true %>
80
+ <% else %>
81
+ <div class="alert alert-info no-objects-found">
82
+ <%= raw Spree.t('admin.cms.you_have_no_pages') %>
83
+ </div>
84
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= Spree.t('admin.cms.new_page') %>
3
+ <% end %>
4
+
5
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_page } %>
6
+ <%= form_for [:admin, @cms_page] do |f| %>
7
+ <%= render partial: 'form', locals: { f: f } %>
8
+ <% end %>
@@ -0,0 +1,69 @@
1
+ <div data-hook="admin_cms_section_form_fields">
2
+ <div class="row">
3
+ <div class="col-12 col-md-6">
4
+ <%= f.field_container :name, class: ['form-group'] do %>
5
+ <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
6
+ <%= f.text_field :name, class: 'form-control', required: true, autocomplete: false %>
7
+ <%= f.error_message_on :name %>
8
+ <% end %>
9
+ </div>
10
+ <div class="col-12 col-md-6">
11
+ <%= f.field_container :type, class: ['form-group'] do %>
12
+ <%= f.label :type, Spree.t('admin.cms.section_type') %>
13
+ <%= f.select(:type, spree_humanize_dropdown_values('Spree::CmsSection', {const: 'TYPES'}), {include_blank: false}) %>
14
+ <%= f.error_message_on :type %>
15
+ <% end %>
16
+ </div>
17
+ </div>
18
+
19
+ <div id="alertToClickUpdate" class="d-none">
20
+ <div class="row">
21
+ <div class="col-12">
22
+ <div class="alert alert-warning mt-3">
23
+ <% if %w[new create].include? controller.action_name %>
24
+ <%= raw Spree.t('admin.cms.click_create_to_load_new_link') %>
25
+ <% else %>
26
+ <%= raw Spree.t('admin.cms.click_update_to_load_new_link') %>
27
+ <% end %>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+
33
+ <% if @cms_section.type.present? %>
34
+ <div id="CmsSectionType"
35
+ data-hook="admin_cms_section_form_fields"
36
+ data-panel-section-type="<%= @cms_section.type %>">
37
+ <div class="row">
38
+ <div class="col-12">
39
+ <div class="card mb-3">
40
+ <div class="card-header d-flex">
41
+ <div class="d-flex flex-grow-1">
42
+ <h5 class="mb-0">
43
+ <%= raw Spree.t('admin.cms.settings_for', section: spree_humanize_type(@cms_section.type)) %>
44
+ </h5>
45
+ </div>
46
+ <div class="d-flex">
47
+ <span data-show-info
48
+ data-alert-kind="info"
49
+ data-alert-title="<%= spree_humanize_type(@cms_section.type) %>"
50
+ data-alert-html="<%= raw I18n.t("spree.admin.cms.info_#{spree_resource_path(@cms_section)}_body") %>">
51
+ <%= svg_icon name: "info.svg", width: '25', height: '25' %>
52
+ </span>
53
+ </div>
54
+ </div>
55
+ <div class="card-body">
56
+ <% if @cms_section.type.present? %>
57
+ <div class="row pb-0">
58
+ <div class="col-12">
59
+ <%= render "spree/admin/cms_sections/types/#{spree_resource_path(@cms_section)}", f: f %>
60
+ </div>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ <% end %>
69
+ </div>
@@ -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>