spree_backend 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +222 -0
- data/.codeclimate.yml +36 -0
- data/.editorconfig +22 -0
- data/.eslintignore +7 -0
- data/.eslintrc.cjs +29 -0
- data/.gem_release.yml +4 -0
- data/.github/CONTRIBUTING.md +1 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/ISSUE_TEMPLATE.md +39 -0
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/spelling_lint.yml +34 -0
- data/.gitignore +64 -0
- data/.rubocop.yml +197 -0
- data/.solargraph.yml +20 -0
- data/.stylelintignore +4 -0
- data/.stylelintrc +6 -0
- data/CODE_OF_CONDUCT.md +22 -0
- data/Gemfile +59 -3
- data/README.md +123 -0
- data/SECURITY.md +1 -0
- data/app/assets/config/spree_backend_manifest.js +1 -1
- data/app/assets/images/backend-cloud-arrow-up.svg +4 -0
- data/app/assets/images/backend-eye-open.svg +1 -1
- data/app/assets/images/backend-file-earmark-font.svg +4 -0
- data/app/assets/images/backend-file-earmark-image.svg +4 -0
- data/app/assets/images/backend-file-earmark-music.svg +4 -0
- data/app/assets/images/backend-file-earmark-pdf.svg +4 -0
- data/app/assets/images/backend-file-earmark-play.svg +4 -0
- data/app/assets/images/backend-file-earmark-spreadsheet.svg +3 -0
- data/app/assets/images/backend-file-earmark-zip.svg +4 -0
- data/app/assets/images/backend-file-earmark.svg +3 -0
- data/app/assets/images/backend-hdd.svg +4 -0
- data/app/assets/images/backend-link.svg +4 -0
- data/app/assets/images/backend-view.svg +1 -1
- data/app/assets/javascripts/spree/backend/address_states.es6 +2 -0
- data/app/assets/javascripts/spree/backend/adjustments.js +5 -5
- data/app/assets/javascripts/spree/backend/admin.js +4 -6
- data/app/assets/javascripts/spree/backend/calculator.js +1 -1
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/cms/links.es6 +1 -1
- data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +1 -1
- data/app/assets/javascripts/spree/backend/cms/page.es6 +22 -40
- data/app/assets/javascripts/spree/backend/cms/section.es6 +1 -1
- data/app/assets/javascripts/spree/backend/gateway.js +1 -1
- data/app/assets/javascripts/spree/backend/general_settings.js +1 -1
- data/app/assets/javascripts/spree/backend/global/_index.js +3 -1
- data/app/assets/javascripts/spree/backend/global/alerts.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/animate_css.es6 +19 -0
- data/app/assets/javascripts/spree/backend/global/fetch_request_utility.es6 +114 -0
- data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +8 -1
- data/app/assets/javascripts/spree/backend/global/info_alert.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/ransack.es6 +7 -5
- data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +11 -4
- data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +2 -2
- data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +2 -2
- data/app/assets/javascripts/spree/backend/global/sortable.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/tinymce.es6 +3 -2
- data/app/assets/javascripts/spree/backend/line_items.js +7 -9
- data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +23 -28
- data/app/assets/javascripts/spree/backend/menus/_index.es6 +0 -1
- data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +1 -1
- data/app/assets/javascripts/spree/backend/multi_currency.js +2 -2
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
- data/app/assets/javascripts/spree/backend/orders/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/payments/edit.js +32 -22
- data/app/assets/javascripts/spree/backend/payments/new.js +1 -1
- data/app/assets/javascripts/spree/backend/product_picker.js +16 -25
- data/app/assets/javascripts/spree/backend/progress.js +5 -3
- data/app/assets/javascripts/spree/backend/promotions.js +3 -1
- data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js +1 -1
- data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
- data/app/assets/javascripts/spree/backend/shipments.js +80 -79
- data/app/assets/javascripts/spree/backend/spree-select2.js +8 -1
- data/app/assets/javascripts/spree/backend/states.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_location.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_management.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_movement.js +58 -13
- data/app/assets/javascripts/spree/backend/stock_transfer.js +62 -32
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +9 -8
- data/app/assets/javascripts/spree/backend/taxons.js +17 -14
- data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
- data/app/assets/javascripts/spree/backend/users/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js +19 -11
- data/app/assets/javascripts/spree/backend/variant_management.js +1 -1
- data/app/assets/javascripts/spree/backend/zone.js +1 -1
- data/app/assets/javascripts/spree/backend.js +13 -33
- data/app/assets/javascripts/spree.js +2 -9
- data/app/assets/stylesheets/spree/backend/components/_main.scss +8 -0
- data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +1 -1
- data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_sortable_tree.scss +62 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +3 -0
- data/app/assets/stylesheets/spree/backend/views/_digitals.scss +33 -0
- data/app/assets/stylesheets/spree/backend/views/{prototypes.scss → _prototypes.scss} +0 -0
- data/app/assets/stylesheets/spree/backend/views/_taxonomies.scss +3 -0
- data/app/controllers/spree/admin/base_controller.rb +4 -13
- data/app/controllers/spree/admin/digitals_controller.rb +33 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +0 -5
- data/app/controllers/spree/admin/images_controller.rb +1 -1
- data/app/controllers/spree/admin/oauth_applications_controller.rb +17 -0
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +10 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +2 -2
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +4 -2
- data/app/controllers/spree/admin/promotions_controller.rb +1 -1
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/resource_controller.rb +9 -4
- data/app/controllers/spree/admin/return_index_controller.rb +3 -4
- data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -2
- data/app/controllers/spree/admin/store_credits_controller.rb +2 -2
- data/app/controllers/spree/admin/stores_controller.rb +2 -2
- data/app/controllers/spree/admin/taxons_controller.rb +23 -38
- data/app/controllers/spree/admin/users_controller.rb +6 -19
- data/app/controllers/spree/admin/variants_controller.rb +1 -2
- data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +48 -0
- data/app/helpers/spree/admin/base_helper.rb +27 -9
- data/app/helpers/spree/admin/digital_helper.rb +28 -0
- data/app/helpers/spree/admin/menu_helper.rb +0 -21
- data/app/helpers/spree/admin/navigation_helper.rb +19 -9
- data/app/helpers/spree/admin/sortable_tree_helper.rb +31 -0
- data/app/helpers/spree/admin/stores_helper.rb +1 -1
- data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +31 -0
- data/app/javascript/spree/dashboard/controllers/clipboard_controller.js +12 -0
- data/app/javascript/spree/dashboard/controllers/password_toggle_controller.js +14 -0
- data/app/javascript/spree/dashboard/controllers/sortable_tree_controller.js +55 -0
- data/app/javascript/spree/dashboard/controllers/spree_controller.js +25 -0
- data/app/javascript/spree/dashboard/controllers/upload_button_controller.js +13 -0
- data/app/javascript/spree/dashboard/controllers/webhooks_subscriber_events_controller.js +19 -0
- data/app/javascript/spree/dashboard/index.js +49 -0
- data/app/{assets/javascripts/spree/backend/global/bootstrap.es6 → javascript/spree/dashboard/utilities/bootstrap.js} +6 -2
- data/app/javascript/spree/dashboard/utilities/request_utility.js +54 -0
- data/app/models/spree/backend_configuration.rb +11 -0
- data/app/views/spree/admin/adjustments/_form.html.erb +2 -2
- data/app/views/spree/admin/adjustments/index.html.erb +1 -0
- data/app/views/spree/admin/cms_pages/_form.html.erb +8 -8
- data/app/views/spree/admin/cms_pages/edit.html.erb +1 -6
- data/app/views/spree/admin/cms_sections/_form.html.erb +2 -2
- data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +6 -6
- data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +6 -6
- data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +12 -12
- data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +1 -1
- data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +12 -12
- data/app/views/spree/admin/countries/_form.html.erb +4 -4
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/digitals/_form.html.erb +35 -0
- data/app/views/spree/admin/digitals/index.html.erb +25 -0
- data/app/views/spree/admin/general_settings/edit.html.erb +1 -22
- data/app/views/spree/admin/menu_items/_form.html.erb +6 -6
- data/app/views/spree/admin/menus/_form.html.erb +3 -3
- data/app/views/spree/admin/menus/edit.html.erb +18 -18
- data/app/views/spree/admin/oauth_applications/_form.html.erb +22 -0
- data/app/views/spree/admin/oauth_applications/create.turbo_stream.erb +38 -0
- data/app/views/spree/admin/oauth_applications/edit.html.erb +13 -0
- data/app/views/spree/admin/oauth_applications/index.html.erb +51 -0
- data/app/views/spree/admin/oauth_applications/new.html.erb +15 -0
- data/app/views/spree/admin/option_types/_form.html.erb +3 -3
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +2 -2
- data/app/views/spree/admin/orders/_channel_form.html.erb +1 -1
- data/app/views/spree/admin/orders/_form.html.erb +1 -0
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -0
- data/app/views/spree/admin/orders/_order_actions.html.erb +6 -0
- data/app/views/spree/admin/orders/_search.html.erb +151 -0
- data/app/views/spree/admin/orders/index.html.erb +2 -151
- data/app/views/spree/admin/payment_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +19 -20
- data/app/views/spree/admin/products/index.html.erb +2 -1
- data/app/views/spree/admin/products/new.html.erb +6 -6
- data/app/views/spree/admin/promotion_actions/create.js.erb +1 -1
- data/app/views/spree/admin/promotion_categories/_form.html.erb +2 -2
- data/app/views/spree/admin/promotions/_form.html.erb +5 -5
- data/app/views/spree/admin/properties/_form.html.erb +3 -3
- data/app/views/spree/admin/prototypes/_form.html.erb +4 -4
- data/app/views/spree/admin/refunds/new.html.erb +2 -2
- data/app/views/spree/admin/reimbursement_types/_form.html.erb +2 -2
- data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -3
- data/app/views/spree/admin/roles/_form.html.erb +1 -1
- data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
- data/app/views/spree/admin/shared/_address_form.html.erb +4 -4
- data/app/views/spree/admin/shared/_head.html.erb +4 -8
- data/app/views/spree/admin/shared/_main_menu.html.erb +12 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -0
- data/app/views/spree/admin/shared/_version.html.erb +1 -1
- data/app/views/spree/admin/shared/cms/_spree_product.html.erb +2 -2
- data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_url.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
- data/app/views/spree/admin/{menus/nested_menu_items/_item_bar.html.erb → shared/sortable_tree/_menu.html.erb} +10 -7
- data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +34 -0
- data/app/views/spree/admin/shared/sub_menu/_apps.html.erb +3 -0
- data/app/views/spree/admin/shared/sub_menu/_integrations.html.erb +3 -0
- data/app/views/spree/admin/shipping_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -8
- data/app/views/spree/admin/states/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_locations/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_movements/_form.html.erb +3 -3
- data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_form.html.erb +4 -4
- data/app/views/spree/admin/stores/_form.html.erb +280 -227
- data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
- data/app/views/spree/admin/tax_rates/_form.html.erb +4 -3
- data/app/views/spree/admin/taxonomies/_form.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/edit.html.erb +34 -29
- data/app/views/spree/admin/taxons/_form.html.erb +101 -57
- data/app/views/spree/admin/taxons/edit.html.erb +6 -3
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/taxons/new.html.erb +16 -0
- data/app/views/spree/admin/users/_form.html.erb +3 -3
- data/app/views/spree/admin/users/edit.html.erb +0 -40
- data/app/views/spree/admin/variants/_autocomplete.js.erb +5 -5
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +2 -2
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +6 -6
- data/app/views/spree/admin/variants/_split.js.erb +1 -1
- data/app/views/spree/admin/variants/index.html.erb +4 -1
- data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +101 -0
- data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +13 -0
- data/app/views/spree/admin/webhooks_subscribers/index.html.erb +47 -0
- data/app/views/spree/admin/webhooks_subscribers/new.html.erb +13 -0
- data/app/views/spree/admin/webhooks_subscribers/show.html.erb +59 -0
- data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +2 -2
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/app/views/spree/layouts/admin.html.erb +1 -11
- data/codespell.txt +8 -0
- data/config/locales/en.yml +273 -0
- data/config/routes.rb +6 -2
- data/lib/generators/spree/backend/install/install_generator.rb +4 -2
- data/lib/generators/spree/backend/install/templates/app/javascript/spree-dashboard.js +7 -0
- data/lib/spree/backend/engine.rb +2 -1
- data/lib/spree/backend/testing_support/capybara_utils.rb +53 -0
- data/lib/spree/backend/testing_support/flash.rb +38 -0
- data/lib/spree/backend/testing_support/flatpickr_capybara.rb +126 -0
- data/lib/spree/backend/version.rb +9 -0
- data/lib/spree/backend.rb +2 -1
- data/lib/spree_backend.rb +17 -0
- data/license.md +13 -0
- data/package.json +45 -0
- data/rollup.config.js +41 -0
- data/spree_backend.gemspec +17 -16
- data/vendor/assets/javascripts/purify.js +1 -1
- data/vendor/assets/stylesheets/animate.css +2 -4
- data/yarn.lock +944 -0
- metadata +118 -36
- data/app/assets/javascripts/spree/backend/menus/menu.es6 +0 -57
- data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +0 -11
- data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +0 -35
- data/app/assets/javascripts/spree/backend/taxonomy.js +0 -178
- data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -7
- data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4564
- data/vendor/assets/javascripts/js.cookie.js +0 -163
- data/vendor/assets/javascripts/modernizr.js +0 -3
- data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +0 -230
- data/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif +0 -0
@@ -23,7 +23,7 @@ module Spree
|
|
23
23
|
|
24
24
|
def field_container(model, method, options = {}, &block)
|
25
25
|
css_classes = options[:class].to_a
|
26
|
-
css_classes << '
|
26
|
+
css_classes << 'form-group'
|
27
27
|
css_classes << 'withError' if error_message_on(model, method).present?
|
28
28
|
content_tag(
|
29
29
|
:div, capture(&block),
|
@@ -237,18 +237,28 @@ module Spree
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def product_preview_link(product)
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
)
|
240
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
241
|
+
Admin::BaseHelper#product_preview_link is deprecated and will be removed in Spree 5.0. - Use Admin::BaseHelper#external_page_preview_link
|
242
|
+
DEPRECATION
|
243
|
+
|
244
|
+
external_page_preview_link(product)
|
245
245
|
end
|
246
246
|
|
247
247
|
def taxon_preview_link(taxon)
|
248
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
249
|
+
Admin::BaseHelper#taxon_preview_link is deprecated and will be removed in Spree 5.0. - Use Admin::BaseHelper#external_page_preview_link
|
250
|
+
DEPRECATION
|
251
|
+
|
252
|
+
external_page_preview_link(taxon)
|
253
|
+
end
|
254
|
+
|
255
|
+
def external_page_preview_link(resource, options = {})
|
256
|
+
resource_name = options[:name] || resource.class.name.demodulize
|
257
|
+
|
248
258
|
button_link_to(
|
249
|
-
Spree.t(:
|
250
|
-
spree_storefront_resource_url(
|
251
|
-
class: 'btn-outline-secondary', icon: 'view.svg', id:
|
259
|
+
Spree.t('admin.utilities.preview', name: resource_name ),
|
260
|
+
spree_storefront_resource_url(resource),
|
261
|
+
class: 'btn-outline-secondary', icon: 'view.svg', id: "adminPreview#{resource_name}", target: :blank, data: { turbo: false }
|
252
262
|
)
|
253
263
|
end
|
254
264
|
|
@@ -285,6 +295,14 @@ module Spree
|
|
285
295
|
'default'
|
286
296
|
end
|
287
297
|
end
|
298
|
+
|
299
|
+
def product_wysiwyg_editor_enabled?
|
300
|
+
Spree::Backend::Config[:product_wysiwyg_editor_enabled]
|
301
|
+
end
|
302
|
+
|
303
|
+
def taxon_wysiwyg_editor_enabled?
|
304
|
+
Spree::Backend::Config[:taxon_wysiwyg_editor_enabled]
|
305
|
+
end
|
288
306
|
end
|
289
307
|
end
|
290
308
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
module DigitalHelper
|
4
|
+
def asset_icon(asset)
|
5
|
+
file_name = case asset.attachment.content_type
|
6
|
+
when /pdf\z/
|
7
|
+
'file-earmark-pdf.svg'
|
8
|
+
when /\Aimage/
|
9
|
+
'file-earmark-image.svg'
|
10
|
+
when /zip\z/
|
11
|
+
'file-earmark-zip.svg'
|
12
|
+
when 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
13
|
+
'file-earmark-spreadsheet.svg'
|
14
|
+
when /\Avideo/
|
15
|
+
'file-earmark-play.svg'
|
16
|
+
when /\Aaudio/
|
17
|
+
'file-earmark-music.svg'
|
18
|
+
when /\Afont/
|
19
|
+
'file-earmark-font.svg'
|
20
|
+
else
|
21
|
+
'file-earmark.svg'
|
22
|
+
end
|
23
|
+
|
24
|
+
svg_icon name: file_name, width: 50, height: 50
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,27 +1,6 @@
|
|
1
1
|
module Spree
|
2
2
|
module Admin
|
3
3
|
module MenuHelper
|
4
|
-
def menu_item_bar(menu, item)
|
5
|
-
render 'spree/admin/menus/nested_menu_items/item_bar', menu: menu, item: item
|
6
|
-
end
|
7
|
-
|
8
|
-
def build_menu_item(menu, item)
|
9
|
-
decendents = []
|
10
|
-
|
11
|
-
unless item.leaf?
|
12
|
-
item.children.each do |child_item|
|
13
|
-
decendents << build_menu_item(menu, child_item) unless item.leaf?
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
info_row = menu_item_bar(menu, item)
|
18
|
-
menu_container = content_tag(:div, raw(decendents.join), class: 'menu-container', data: { parent_id: item.id })
|
19
|
-
|
20
|
-
content_tag(:div, info_row + menu_container,
|
21
|
-
class: 'menu-item menu-container-item dragable removable-dom-element',
|
22
|
-
data: { item_id: item.id })
|
23
|
-
end
|
24
|
-
|
25
4
|
def default_menu_for_store?(menu)
|
26
5
|
menu.store.default_locale == menu.locale
|
27
6
|
end
|
@@ -3,7 +3,7 @@ module Spree
|
|
3
3
|
module NavigationHelper
|
4
4
|
# Makes an admin navigation tab (<li> tag) that links to a routing resource under /admin.
|
5
5
|
# The arguments should be a list of symbolized controller names that will cause this tab to
|
6
|
-
# be highlighted, with the first being the name of the
|
6
|
+
# be highlighted, with the first being the name of the resource to link (uses URL helpers).
|
7
7
|
#
|
8
8
|
# Option hash may follow. Valid options are
|
9
9
|
# * :label to override link text, otherwise based on the first resource name (translated)
|
@@ -22,13 +22,18 @@ module Spree
|
|
22
22
|
options = { label: args.first.to_s }
|
23
23
|
|
24
24
|
# Return if resource is found and user is not allowed to :admin
|
25
|
-
return '' if (klass = klass_for(
|
25
|
+
return '' if (klass = klass_for(args.first.to_s)) && cannot?(:admin, klass)
|
26
26
|
|
27
27
|
options = options.merge(args.pop) if args.last.is_a?(Hash)
|
28
28
|
options[:route] ||= "admin_#{args.first}"
|
29
29
|
|
30
30
|
destination_url = options[:url] || spree.send("#{options[:route]}_path")
|
31
|
-
|
31
|
+
|
32
|
+
if options[:do_not_titleize] == true
|
33
|
+
titleized_label = options[:label]
|
34
|
+
else
|
35
|
+
titleized_label = Spree.t(options[:label], default: options[:label], scope: [:admin, :tab]).titleize
|
36
|
+
end
|
32
37
|
|
33
38
|
css_classes = ['sidebar-menu-item d-block w-100 position-relative']
|
34
39
|
|
@@ -88,13 +93,13 @@ module Spree
|
|
88
93
|
# this method generates the select_tag
|
89
94
|
def per_page_dropdown
|
90
95
|
# there is a config setting for admin_products_per_page, only for the orders page
|
91
|
-
if @products && per_page_default = Spree::Config.admin_products_per_page
|
96
|
+
if @products && per_page_default = Spree::Backend::Config.admin_products_per_page
|
92
97
|
per_page_options = []
|
93
98
|
5.times do |amount|
|
94
|
-
per_page_options << (amount + 1) * Spree::Config.admin_products_per_page
|
99
|
+
per_page_options << (amount + 1) * Spree::Backend::Config.admin_products_per_page
|
95
100
|
end
|
96
101
|
else
|
97
|
-
per_page_default = Spree::Config.admin_orders_per_page
|
102
|
+
per_page_default = Spree::Backend::Config.admin_orders_per_page
|
98
103
|
per_page_options = %w{25 50 75}
|
99
104
|
end
|
100
105
|
|
@@ -199,11 +204,13 @@ module Spree
|
|
199
204
|
end
|
200
205
|
text = "#{icon} #{text}"
|
201
206
|
end
|
207
|
+
|
208
|
+
css_classes = options[:class] || 'btn-primary'
|
202
209
|
button_tag(
|
203
210
|
text.html_safe,
|
204
211
|
options.merge(
|
205
212
|
type: button_type,
|
206
|
-
class: "btn
|
213
|
+
class: "btn #{css_classes}",
|
207
214
|
'data-disable-with' => "#{Spree.t(:saving)}..."
|
208
215
|
)
|
209
216
|
)
|
@@ -262,6 +269,9 @@ module Spree
|
|
262
269
|
end
|
263
270
|
|
264
271
|
def main_part_classes
|
272
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
273
|
+
Admin::NavigationHelper#main_part_classes is deprecated and will be removed in Spree 5.0.
|
274
|
+
DEPRECATION
|
265
275
|
if cookies['sidebar-minimized'] == 'true'
|
266
276
|
'col-12 sidebar-collapsed'
|
267
277
|
else
|
@@ -271,7 +281,7 @@ module Spree
|
|
271
281
|
|
272
282
|
def main_sidebar_classes
|
273
283
|
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
274
|
-
Admin::
|
284
|
+
Admin::NavigationHelper#main_sidebar_classes is deprecated and will be removed in Spree 5.0.
|
275
285
|
DEPRECATION
|
276
286
|
if cookies['sidebar-minimized'] == 'true'
|
277
287
|
'col-3 col-md-2 sidebar'
|
@@ -282,7 +292,7 @@ module Spree
|
|
282
292
|
|
283
293
|
def wrapper_classes
|
284
294
|
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
285
|
-
Admin::
|
295
|
+
Admin::NavigationHelper#wrapper_classes is deprecated and will be removed in Spree 5.0.
|
286
296
|
DEPRECATION
|
287
297
|
'sidebar-minimized' if cookies['sidebar-minimized'] == 'true'
|
288
298
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
module SortableTreeHelper
|
4
|
+
def sortable_tree_bar(parent_resource, child_resource)
|
5
|
+
partial_name = parent_resource.class.name.demodulize.underscore
|
6
|
+
render "spree/admin/shared/sortable_tree/#{partial_name}", parent_resource: parent_resource, child_resource: child_resource
|
7
|
+
end
|
8
|
+
|
9
|
+
def build_sortable_tree(parent_resource, child_resource)
|
10
|
+
child_resource_name = child_resource.class.name.demodulize.underscore
|
11
|
+
descendants = []
|
12
|
+
|
13
|
+
unless child_resource.leaf?
|
14
|
+
child_resource.children.each do |child_item|
|
15
|
+
descendants << build_sortable_tree(parent_resource, child_item) unless child_resource.leaf?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
row = sortable_tree_bar(parent_resource, child_resource)
|
20
|
+
container = content_tag(:div, raw(descendants.join), data: { sortable_tree_parent_id_value: child_resource.id })
|
21
|
+
|
22
|
+
content_tag(:div, row + container,
|
23
|
+
class: 'sortable-tree-item draggable removable-dom-element',
|
24
|
+
data: {
|
25
|
+
sortable_tree_resource_name_value: child_resource_name.singularize,
|
26
|
+
sortable_tree_update_url_value: "/api/v2/platform/#{child_resource_name.pluralize}/#{child_resource.id}/reposition"
|
27
|
+
})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -23,7 +23,7 @@ module Spree
|
|
23
23
|
end
|
24
24
|
|
25
25
|
link_to icon + store.unique_name, url_for(host: store.formatted_url),
|
26
|
-
class: "#{classes} text-dark p-3 dropdown-item", id: store.code
|
26
|
+
class: "#{classes} text-dark p-3 dropdown-item", id: store.code, data: { turbo: false }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
module WebhooksSubscribersHelper
|
4
|
+
def event_checkbox_for(resource_name, form)
|
5
|
+
content_tag :div, class: 'col-xs-12 col-sm-6 col-md-4 col-lg-4 form-group' do
|
6
|
+
content_tag :div, class: 'custom-control custom-switch' do
|
7
|
+
(form.check_box resource_name, event_checkbox_opts(resource_name), true, nil) + ' ' +
|
8
|
+
form.label(resource_name, Spree.t("admin.webhooks_subscribers.#{resource_name.to_s.pluralize}"), class: 'custom-control-label')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def subscribe_to_all_events?
|
14
|
+
@webhooks_subscriber.new_record? || @webhooks_subscriber.subscriptions == ['*']
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def event_checkbox_opts(resource_name)
|
20
|
+
{
|
21
|
+
class: 'events-checkbox custom-control-input',
|
22
|
+
checked: subscribed_to_resource?(resource_name)
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def subscribed_to_resource?(resource_name)
|
27
|
+
@webhooks_subscriber.subscriptions&.any? { |event| event.include? "#{resource_name}." }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [ "source" ]
|
5
|
+
|
6
|
+
copy(event) {
|
7
|
+
console.log(event)
|
8
|
+
event.preventDefault()
|
9
|
+
this.sourceTarget.select()
|
10
|
+
document.execCommand("copy")
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = ["unhide"]
|
5
|
+
|
6
|
+
password(e) {
|
7
|
+
if (this.unhideTarget.type === "password") {
|
8
|
+
this.unhideTarget.type = "text"
|
9
|
+
} else {
|
10
|
+
this.unhideTarget.type = "password"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
import { Sortable } from "sortablejs"
|
3
|
+
import { patch } from "../utilities/request_utility"
|
4
|
+
|
5
|
+
export default class extends Controller {
|
6
|
+
static values = { handle: String }
|
7
|
+
|
8
|
+
connect() {
|
9
|
+
const itemSortable = {
|
10
|
+
...this.options
|
11
|
+
}
|
12
|
+
|
13
|
+
let containers = null
|
14
|
+
containers = this.element.querySelectorAll("[data-sortable-tree-parent-id-value]")
|
15
|
+
|
16
|
+
for (let i = 0; i < containers.length; i++) {
|
17
|
+
new Sortable(containers[i], itemSortable)
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
async end({ item, newIndex, to }) {
|
22
|
+
if (!item.dataset.sortableTreeUpdateUrlValue) return
|
23
|
+
|
24
|
+
const data = {
|
25
|
+
[item.dataset.sortableTreeResourceNameValue]: {
|
26
|
+
new_parent_id: to.dataset.sortableTreeParentIdValue,
|
27
|
+
new_position_idx: newIndex
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
const response = await patch(item.dataset.sortableTreeUpdateUrlValue, { body: data })
|
32
|
+
|
33
|
+
if (!response.ok) {
|
34
|
+
show_flash("error", "This move could not be saved.")
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
get options() {
|
39
|
+
return {
|
40
|
+
group: {
|
41
|
+
name: "sortable-tree",
|
42
|
+
pull: true,
|
43
|
+
put: true
|
44
|
+
},
|
45
|
+
handle: this.handleValue || undefined,
|
46
|
+
swapThreshold: 0.5,
|
47
|
+
emptyInsertThreshold: 8,
|
48
|
+
dragClass: "item-dragged",
|
49
|
+
draggable: ".draggable",
|
50
|
+
animation: 350,
|
51
|
+
forceFallback: false,
|
52
|
+
onEnd: this.end
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
connect() {
|
5
|
+
|
6
|
+
// This is a hack to allow legacy JavaScript to run in a Turbo enabled environment.
|
7
|
+
// Once all JavaScript is reduced to Stimulus controllers, this can be removed.
|
8
|
+
const event = new Event("spree:load")
|
9
|
+
document.dispatchEvent(event)
|
10
|
+
|
11
|
+
// The Issue
|
12
|
+
// If you initiate common JavaScript with an event listener of "turbo:load"
|
13
|
+
// This will work, but if someone submits an update to a field that is required,
|
14
|
+
// a 442 Unprocessable entity is returned, and a render event is used render the errors in place.
|
15
|
+
|
16
|
+
// Because this in not a successful "turbo:load" event, all common JavaScript will fail.
|
17
|
+
// You could set up a separate listener for "turbo:render", but this can cause duplicate loading.
|
18
|
+
// Using a Stimulus connect() is the correct way to go, but should be phased out as JavaScript is replaced
|
19
|
+
// With Hotwire Frames and dedicated Stimulus controllers for the JavaScript you have remaining.
|
20
|
+
|
21
|
+
// References:
|
22
|
+
// https://github.com/hotwired/turbo-rails/issues/12#issuecomment-915893233
|
23
|
+
// https://github.com/hotwired/turbo/issues/85#issuecomment-756259687
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [ "uploadButton"]
|
5
|
+
|
6
|
+
initialize() {
|
7
|
+
this.uploadButtonTarget.disabled = true
|
8
|
+
}
|
9
|
+
|
10
|
+
buttonState() {
|
11
|
+
this.uploadButtonTarget.disabled = false
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [ "eventsCheckboxesContainer", "subscribeToAll" ]
|
5
|
+
|
6
|
+
hideCheckboxes() {
|
7
|
+
this.eventsCheckboxesContainerTarget.hidden = true
|
8
|
+
}
|
9
|
+
|
10
|
+
showCheckboxes() {
|
11
|
+
this.eventsCheckboxesContainerTarget.hidden = false
|
12
|
+
}
|
13
|
+
|
14
|
+
initialize() {
|
15
|
+
if (this.subscribeToAllTarget.checked) {
|
16
|
+
this.hideCheckboxes()
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
//
|
2
|
+
// Initialize Dashboard
|
3
|
+
class Dashboard {
|
4
|
+
constructor() {
|
5
|
+
console.log("Spree Dashboard Initialized")
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
//
|
10
|
+
// Import JavaScript packages that are required globally.
|
11
|
+
import { Application } from "@hotwired/stimulus"
|
12
|
+
import flatpickr from "flatpickr"
|
13
|
+
import * as Turbo from "@hotwired/turbo"
|
14
|
+
|
15
|
+
// To disable Turbo, un-comment the line below.
|
16
|
+
// Turbo.session.drive = false
|
17
|
+
|
18
|
+
//
|
19
|
+
// Import Utility JavaScript required globally.
|
20
|
+
import "./utilities/bootstrap"
|
21
|
+
|
22
|
+
//
|
23
|
+
// Stimulus - Setup
|
24
|
+
const application = Application.start()
|
25
|
+
application.debug = false
|
26
|
+
window.Stimulus = application
|
27
|
+
|
28
|
+
// Stimulus - Spree Controllers
|
29
|
+
import UploadButtonController from "./controllers/upload_button_controller"
|
30
|
+
application.register("upload-button", UploadButtonController)
|
31
|
+
|
32
|
+
import SpreeController from "./controllers/spree_controller"
|
33
|
+
application.register("spree", SpreeController)
|
34
|
+
|
35
|
+
import SortableTreeController from "./controllers/sortable_tree_controller"
|
36
|
+
application.register("sortable-tree", SortableTreeController)
|
37
|
+
|
38
|
+
import WebhooksSubscriberEventsController from "./controllers/webhooks_subscriber_events_controller"
|
39
|
+
application.register("webhooks_subscriber_events", WebhooksSubscriberEventsController)
|
40
|
+
|
41
|
+
import PasswordToggleController from "./controllers/password_toggle_controller"
|
42
|
+
application.register("password-toggle", PasswordToggleController)
|
43
|
+
|
44
|
+
import ClipboardController from "./controllers/clipboard_controller"
|
45
|
+
application.register("clipboard", ClipboardController)
|
46
|
+
|
47
|
+
//
|
48
|
+
// Export
|
49
|
+
export { Dashboard, application, flatpickr, Turbo }
|
@@ -1,6 +1,10 @@
|
|
1
|
-
|
1
|
+
import jquery from 'jquery'
|
2
|
+
import 'bootstrap'
|
3
|
+
import 'popper.js'
|
2
4
|
|
3
|
-
|
5
|
+
const $ = jquery
|
6
|
+
|
7
|
+
document.addEventListener("spree:load", function() {
|
4
8
|
$('.with-tip').each(function() {
|
5
9
|
$(this).tooltip({
|
6
10
|
container: $(this)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { RequestInterceptor } from "@rails/request.js"
|
2
|
+
import { FetchRequest } from "@rails/request.js"
|
3
|
+
import { navigator } from "@hotwired/turbo"
|
4
|
+
|
5
|
+
//
|
6
|
+
// Inject Authorization & Content-Type into @rails/request.js requests.
|
7
|
+
RequestInterceptor.register(async (request) => {
|
8
|
+
request.addHeader("Authorization", `Bearer ${OAUTH_TOKEN}`)
|
9
|
+
})
|
10
|
+
|
11
|
+
//
|
12
|
+
// Setup Turbo Progress bar on @rails/request.js requests.
|
13
|
+
export function showProgressBar() {
|
14
|
+
navigator.delegate.adapter.progressBar.setValue(0)
|
15
|
+
navigator.delegate.adapter.progressBar.show()
|
16
|
+
}
|
17
|
+
|
18
|
+
export function hideProgressBar() {
|
19
|
+
navigator.delegate.adapter.progressBar.setValue(1)
|
20
|
+
navigator.delegate.adapter.progressBar.hide()
|
21
|
+
}
|
22
|
+
|
23
|
+
export function withProgress(request) {
|
24
|
+
new Promise(resolve => {
|
25
|
+
showProgressBar()
|
26
|
+
resolve(request.then(hideProgressBar))
|
27
|
+
})
|
28
|
+
return request
|
29
|
+
}
|
30
|
+
|
31
|
+
export function get (url, options) {
|
32
|
+
const request = new FetchRequest("get", url, options)
|
33
|
+
return withProgress(request.perform())
|
34
|
+
}
|
35
|
+
|
36
|
+
export function post (url, options) {
|
37
|
+
const request = new FetchRequest("post", url, options)
|
38
|
+
return withProgress(request.perform())
|
39
|
+
}
|
40
|
+
|
41
|
+
export function put (url, options) {
|
42
|
+
const request = new FetchRequest("put", url, options)
|
43
|
+
return withProgress(request.perform())
|
44
|
+
}
|
45
|
+
|
46
|
+
export function patch (url, options) {
|
47
|
+
const request = new FetchRequest("patch", url, options)
|
48
|
+
return withProgress(request.perform())
|
49
|
+
}
|
50
|
+
|
51
|
+
export function destroy (url, options) {
|
52
|
+
const request = new FetchRequest("delete", url, options)
|
53
|
+
return withProgress(request.perform())
|
54
|
+
}
|
@@ -1,8 +1,19 @@
|
|
1
1
|
module Spree
|
2
2
|
class BackendConfiguration < Preferences::Configuration
|
3
|
+
preference :admin_path, :string, default: '/admin'
|
4
|
+
preference :admin_products_per_page, :integer, default: Kaminari.config.default_per_page
|
5
|
+
preference :admin_orders_per_page, :integer, default: Kaminari.config.default_per_page
|
6
|
+
preference :admin_properties_per_page, :integer, default: Kaminari.config.default_per_page
|
7
|
+
preference :admin_promotions_per_page, :integer, default: Kaminari.config.default_per_page
|
8
|
+
preference :admin_customer_returns_per_page, :integer, default: Kaminari.config.default_per_page
|
9
|
+
preference :admin_users_per_page, :integer, default: Kaminari.config.default_per_page
|
10
|
+
preference :admin_show_version, :boolean, default: true
|
3
11
|
preference :locale, :string, default: Rails.application.config.i18n.default_locale
|
4
12
|
preference :variants_per_page, :integer, default: Kaminari.config.default_per_page
|
5
13
|
preference :menus_per_page, :integer, default: Kaminari.config.default_per_page
|
14
|
+
preference :product_wysiwyg_editor_enabled, :boolean, default: true
|
15
|
+
preference :taxon_wysiwyg_editor_enabled, :boolean, default: true
|
16
|
+
preference :show_only_complete_orders_by_default, :boolean, default: true
|
6
17
|
|
7
18
|
ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
|
8
19
|
:shipments, :credit_cards, :return_authorizations,
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div data-hook="admin_adjustment_form_fields">
|
2
|
-
<%= f.field_container :amount
|
2
|
+
<%= f.field_container :amount do %>
|
3
3
|
<%= f.label :amount, raw(Spree.t(:amount) + required_span_tag) %>
|
4
4
|
<%= text_field :adjustment, :amount, class: 'form-control' %>
|
5
5
|
<%= f.error_message_on :amount %>
|
6
6
|
<% end %>
|
7
|
-
<%= f.field_container :label
|
7
|
+
<%= f.field_container :label do %>
|
8
8
|
<%= f.label :label, raw(Spree.t(:description) + required_span_tag) %>
|
9
9
|
<%= text_field :adjustment, :label, class: 'form-control' %>
|
10
10
|
<%= f.error_message_on :label %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="card-header col-12">
|
7
7
|
<div class="row no-gutters pb-0">
|
8
8
|
<div class="col d-flex justify-content-start align-items-center">
|
9
|
-
<%= f.field_container :visible, class: ['
|
9
|
+
<%= f.field_container :visible, class: ['pb-0 mb-0'] do %>
|
10
10
|
<div class="custom-control custom-switch custom-switch-md">
|
11
11
|
<%= f.check_box :visible, class: 'custom-control-input', data: {cms_page_id: @cms_page.id} %>
|
12
12
|
<label class="custom-control-label" for="cms_page_visible"></label>
|
@@ -36,13 +36,13 @@
|
|
36
36
|
<div class="card-body pb-2">
|
37
37
|
<div class="row pb-0">
|
38
38
|
|
39
|
-
<%= f.field_container :title, class: ['
|
39
|
+
<%= f.field_container :title, class: ['col-12 col-md-6'] do %>
|
40
40
|
<%= f.label :title, raw(Spree.t('admin.cms.title') + required_span_tag) %>
|
41
41
|
<%= f.text_field :title, class: 'form-control', required: true %>
|
42
42
|
<%= f.error_message_on :title %>
|
43
43
|
<% end %>
|
44
44
|
|
45
|
-
<%= f.field_container :type, class: ['
|
45
|
+
<%= f.field_container :type, class: ['col-12 col-md-6'] do %>
|
46
46
|
<%= f.label :type, Spree.t('admin.cms.page_type') %>
|
47
47
|
<%= f.select(:type, spree_humanize_dropdown_values('Spree::CmsPage', {const: 'TYPES'}), {include_blank: false}, class: 'select2') %>
|
48
48
|
<%= f.error_message_on :type %>
|
@@ -61,19 +61,19 @@
|
|
61
61
|
<div class="<% unless %w[new create].include? controller.action_name %>collapse<% end %>" id="cmsPageSettings">
|
62
62
|
<div class="row pb-0">
|
63
63
|
<div class="col-12"><hr></div>
|
64
|
-
<%= f.field_container :locale, class: ['
|
64
|
+
<%= f.field_container :locale, class: ['col-12 col-md-4'] do %>
|
65
65
|
<%= f.label :language %>
|
66
66
|
<%= f.select :locale, options_from_collection_for_select(supported_locales_options, :last, :first, @cms_page.locale || I18n.locale), {}, { class: 'select2' } %>
|
67
67
|
<%= f.error_message_on :default_locale %>
|
68
68
|
<% end %>
|
69
69
|
|
70
|
-
<%= f.field_container :meta_title, class: ['
|
70
|
+
<%= f.field_container :meta_title, class: ['col-12 col-md-4'] do %>
|
71
71
|
<%= f.label :meta_title, Spree.t('admin.cms.meta_title') %>
|
72
72
|
<%= f.text_field :meta_title, class: 'form-control' %>
|
73
73
|
<%= f.error_message_on :meta_title %>
|
74
74
|
<% end %>
|
75
75
|
|
76
|
-
<%= f.field_container :slug, class: ['
|
76
|
+
<%= f.field_container :slug, class: ['col-12 col-md-4'] do %>
|
77
77
|
<div id="noHomePage">
|
78
78
|
<%= f.label :slug, Spree.t('slug') %>
|
79
79
|
<%= f.text_field :slug, class: 'form-control', disabled: @cms_page.homepage? %>
|
@@ -81,7 +81,7 @@
|
|
81
81
|
</div>
|
82
82
|
<% end %>
|
83
83
|
|
84
|
-
<%= f.field_container :meta_description, class: ['
|
84
|
+
<%= f.field_container :meta_description, class: ['col-12'] do %>
|
85
85
|
<%= f.label :meta_description, Spree.t('admin.cms.meta_description') %>
|
86
86
|
<%= f.text_area :meta_description, { rows: 3, class: 'form-control' } %>
|
87
87
|
<%= f.error_message_on :meta_description %>
|
@@ -123,7 +123,7 @@
|
|
123
123
|
<% if @cms_page.type == 'Spree::Cms::Pages::StandardPage' %>
|
124
124
|
<div class="row">
|
125
125
|
<div class="col-12">
|
126
|
-
<%= f.field_container :content
|
126
|
+
<%= f.field_container :content do %>
|
127
127
|
<%= f.text_area :content, { rows: 22, class: 'spree-rte'} %>
|
128
128
|
<%= f.error_message_on :content %>
|
129
129
|
<% end %>
|