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.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/config/spree_backend_manifest.js +129 -0
- data/app/assets/images/backend-arrows-fullscreen.svg +3 -0
- data/app/assets/images/backend-box.svg +3 -0
- data/app/assets/images/backend-circle-fill.svg +3 -0
- data/app/assets/images/backend-circle.svg +3 -0
- data/app/assets/images/backend-default-layout.svg +6 -0
- data/app/assets/images/backend-eye-slash-fill.svg +4 -0
- data/app/assets/images/backend-file-richtext.svg +4 -0
- data/app/assets/images/backend-fullscreen-exit.svg +3 -0
- data/app/assets/images/backend-fullscreen.svg +3 -0
- data/app/assets/images/backend-mobile.svg +5 -0
- data/app/assets/images/backend-pages.svg +10 -0
- data/app/assets/images/backend-phone.svg +4 -0
- data/app/assets/images/backend-reversed-layout.svg +6 -0
- data/app/assets/images/backend-spree-icon.svg +1 -0
- data/app/assets/images/backend-spree-logo.svg +6 -0
- data/app/assets/images/backend-store.svg +2 -13
- data/app/assets/images/backend-translate.svg +4 -0
- data/app/assets/images/backend-users.svg +2 -5
- data/app/assets/images/backend-window-sidebar.svg +4 -0
- data/app/assets/images/noimage/backend-missing-image.svg +4 -0
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/images/noimage/mini.png +0 -0
- data/app/assets/images/noimage/product.png +0 -0
- data/app/assets/images/noimage/small.png +0 -0
- data/app/assets/javascripts/spree/backend/address_states.es6 +44 -0
- data/app/assets/javascripts/spree/backend/admin.js +45 -307
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +22 -13
- data/app/assets/javascripts/spree/backend/cms/_index.es6 +4 -0
- data/app/assets/javascripts/spree/backend/cms/links.es6 +25 -0
- data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +34 -0
- data/app/assets/javascripts/spree/backend/cms/page.es6 +133 -0
- data/app/assets/javascripts/spree/backend/cms/section.es6 +43 -0
- data/app/assets/javascripts/spree/backend/global/_index.js +11 -0
- data/app/assets/javascripts/spree/backend/global/alerts.es6 +66 -0
- data/app/assets/javascripts/spree/backend/global/api_functions.es6 +5 -0
- data/app/assets/javascripts/spree/backend/global/bootstrap.es6 +15 -0
- data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +22 -0
- data/app/assets/javascripts/spree/backend/global/info_alert.es6 +38 -0
- data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +18 -0
- data/app/assets/javascripts/spree/backend/global/ransack.es6 +108 -0
- data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +56 -0
- data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +156 -0
- data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +61 -0
- data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +137 -0
- data/app/assets/javascripts/spree/backend/global/sortable.es6 +35 -0
- data/app/assets/javascripts/spree/backend/global/tinymce.es6 +11 -0
- data/app/assets/javascripts/spree/backend/menus/_index.es6 +2 -0
- data/app/assets/javascripts/spree/backend/menus/menu.es6 +57 -0
- data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +26 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +13 -17
- data/app/assets/javascripts/spree/backend/option_value_picker.js +10 -22
- data/app/assets/javascripts/spree/backend/payments/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/payments/new.js +18 -5
- data/app/assets/javascripts/spree/backend/spree-select2.js +19 -1
- data/app/assets/javascripts/spree/backend/stock_location.js +1 -2
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +7 -1
- data/app/assets/javascripts/spree/backend/taxons.js +74 -73
- data/app/assets/javascripts/spree/backend/user_picker.js +7 -10
- data/app/assets/javascripts/spree/backend.js +28 -1
- data/app/assets/javascripts/spree.js +78 -0
- data/app/assets/stylesheets/spree/backend/components/_filters.scss +1 -3
- data/app/assets/stylesheets/spree/backend/components/_main.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_navbar.scss +35 -0
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +13 -0
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_tables.scss +4 -5
- data/app/assets/stylesheets/spree/backend/global/_mixins.scss +59 -0
- data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +95 -0
- data/app/assets/stylesheets/spree/backend/plugins/{select2_bootstrap4.scss → _select2_bootstrap4.scss} +0 -0
- data/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss +100 -0
- data/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss +4 -0
- data/app/assets/stylesheets/spree/backend/shared/_base.scss +75 -25
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +8 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +5 -0
- data/app/assets/stylesheets/spree/backend/views/_cms_pages.scss +148 -0
- data/app/assets/stylesheets/spree/backend/views/_menus.scss +61 -0
- data/app/controllers/concerns/spree/admin/order_concern.rb +24 -0
- data/app/controllers/concerns/spree/admin/product_concern.rb +11 -0
- data/app/controllers/spree/admin/base_controller.rb +63 -3
- data/app/controllers/spree/admin/cms_pages_controller.rb +29 -0
- data/app/controllers/spree/admin/cms_sections_controller.rb +15 -0
- data/app/controllers/spree/admin/customer_returns_controller.rb +4 -5
- data/app/controllers/spree/admin/errors_controller.rb +11 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +1 -1
- data/app/controllers/spree/admin/images_controller.rb +8 -22
- data/app/controllers/spree/admin/log_entries_controller.rb +4 -3
- data/app/controllers/spree/admin/menu_items_controller.rb +33 -0
- data/app/controllers/spree/admin/menus_controller.rb +32 -0
- data/app/controllers/spree/admin/option_types_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +6 -11
- data/app/controllers/spree/admin/orders_controller.rb +23 -31
- data/app/controllers/spree/admin/payment_methods_controller.rb +17 -4
- data/app/controllers/spree/admin/payments_controller.rb +5 -10
- data/app/controllers/spree/admin/prices_controller.rb +2 -2
- data/app/controllers/spree/admin/products_controller.rb +21 -10
- data/app/controllers/spree/admin/promotion_actions_controller.rb +1 -1
- data/app/controllers/spree/admin/promotion_rules_controller.rb +1 -1
- data/app/controllers/spree/admin/promotions_controller.rb +3 -3
- data/app/controllers/spree/admin/prototypes_controller.rb +1 -1
- data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
- data/app/controllers/spree/admin/reports_controller.rb +5 -1
- data/app/controllers/spree/admin/resource_controller.rb +32 -5
- data/app/controllers/spree/admin/return_index_controller.rb +1 -1
- data/app/controllers/spree/admin/state_changes_controller.rb +2 -7
- data/app/controllers/spree/admin/stock_items_controller.rb +2 -2
- data/app/controllers/spree/admin/stock_locations_controller.rb +2 -2
- data/app/controllers/spree/admin/stock_movements_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_transfers_controller.rb +1 -1
- data/app/controllers/spree/admin/store_credits_controller.rb +13 -8
- data/app/controllers/spree/admin/stores_controller.rb +14 -17
- data/app/controllers/spree/admin/taxons_controller.rb +9 -5
- data/app/controllers/spree/admin/users_controller.rb +9 -7
- data/app/controllers/spree/admin/variants_controller.rb +16 -15
- data/app/helpers/spree/admin/base_helper.rb +52 -14
- data/app/helpers/spree/admin/cms_helper.rb +15 -0
- data/app/helpers/spree/admin/menu_helper.rb +30 -0
- data/app/helpers/spree/admin/stores_helper.rb +21 -0
- data/app/models/spree/backend_configuration.rb +2 -0
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +7 -5
- data/app/views/spree/admin/cms_pages/_form.html.erb +135 -0
- data/app/views/spree/admin/cms_pages/_live_preview_area.html.erb +61 -0
- data/app/views/spree/admin/cms_pages/_section_template.html.erb +16 -0
- data/app/views/spree/admin/cms_pages/edit.html.erb +21 -0
- data/app/views/spree/admin/cms_pages/index.html.erb +84 -0
- data/app/views/spree/admin/cms_pages/new.html.erb +8 -0
- data/app/views/spree/admin/cms_sections/_form.html.erb +69 -0
- data/app/views/spree/admin/cms_sections/edit.html.erb +19 -0
- data/app/views/spree/admin/cms_sections/new.html.erb +11 -0
- data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +50 -0
- data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +62 -0
- data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +177 -0
- data/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb +5 -0
- data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +4 -0
- data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +121 -0
- data/app/views/spree/admin/countries/index.html.erb +5 -3
- data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +6 -4
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +9 -7
- data/app/views/spree/admin/customer_returns/index.html.erb +4 -2
- data/app/views/spree/admin/errors/forbidden.html.erb +0 -0
- data/app/views/spree/admin/images/index.html.erb +8 -4
- data/app/views/spree/admin/menu_items/_form.html.erb +115 -0
- data/app/views/spree/admin/menu_items/edit.html.erb +11 -0
- data/app/views/spree/admin/menu_items/new.html.erb +11 -0
- data/app/views/spree/admin/menus/_form.html.erb +19 -0
- data/app/views/spree/admin/menus/edit.html.erb +57 -0
- data/app/views/spree/admin/menus/index.html.erb +90 -0
- data/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb +30 -0
- data/app/views/spree/admin/menus/new.html.erb +22 -0
- data/app/views/spree/admin/option_types/_form.html.erb +3 -0
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +5 -1
- data/app/views/spree/admin/option_types/index.html.erb +5 -3
- data/app/views/spree/admin/orders/_channel_form.html.erb +2 -2
- data/app/views/spree/admin/orders/_line_items.html.erb +10 -8
- data/app/views/spree/admin/orders/_shipment.html.erb +26 -18
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +11 -9
- data/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb +2 -2
- data/app/views/spree/admin/orders/index.html.erb +100 -101
- data/app/views/spree/admin/payment_methods/_form.html.erb +6 -4
- data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +22 -3
- data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
- data/app/views/spree/admin/payments/_list.html.erb +9 -7
- data/app/views/spree/admin/prices/_variant_prices.html.erb +7 -14
- data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +9 -7
- data/app/views/spree/admin/products/_autocomplete.js.erb +10 -6
- data/app/views/spree/admin/products/_form.html.erb +35 -5
- data/app/views/spree/admin/products/index.html.erb +15 -14
- data/app/views/spree/admin/products/new.html.erb +6 -1
- data/app/views/spree/admin/products/stock.html.erb +71 -68
- data/app/views/spree/admin/promotion_categories/index.html.erb +5 -3
- data/app/views/spree/admin/promotions/_form.html.erb +7 -0
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +1 -0
- data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +2 -1
- data/app/views/spree/admin/promotions/index.html.erb +33 -34
- data/app/views/spree/admin/properties/_form.html.erb +6 -0
- data/app/views/spree/admin/properties/index.html.erb +19 -3
- data/app/views/spree/admin/prototypes/_form.html.erb +1 -1
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +8 -6
- data/app/views/spree/admin/prototypes/index.html.erb +5 -3
- data/app/views/spree/admin/reimbursement_types/index.html.erb +5 -3
- data/app/views/spree/admin/reports/index.html.erb +1 -1
- data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +2 -2
- data/app/views/spree/admin/return_authorizations/index.html.erb +7 -5
- data/app/views/spree/admin/return_index/customer_returns.html.erb +4 -2
- data/app/views/spree/admin/return_index/return_authorizations.html.erb +5 -3
- data/app/views/spree/admin/roles/index.html.erb +5 -3
- data/app/views/spree/admin/shared/_account_nav.html.erb +5 -5
- data/app/views/spree/admin/shared/_address_form.html.erb +5 -4
- data/app/views/spree/admin/shared/_content_header.html.erb +20 -6
- data/app/views/spree/admin/shared/_head.html.erb +2 -1
- data/app/views/spree/admin/shared/_header.html.erb +7 -10
- data/app/views/spree/admin/shared/_link_fields.html.erb +22 -0
- data/app/views/spree/admin/shared/_main_menu.html.erb +19 -4
- data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -10
- data/app/views/spree/admin/shared/_paths.html.erb +8 -0
- data/app/views/spree/admin/shared/_refunds.html.erb +4 -2
- data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
- data/app/views/spree/admin/shared/_store_switcher.html.erb +23 -0
- data/app/views/spree/admin/shared/_table_filter.html.erb +6 -6
- data/app/views/spree/admin/shared/_translations.html.erb +2 -0
- data/app/views/spree/admin/shared/cms/_spree_product.html.erb +14 -0
- data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +14 -0
- data/app/views/spree/admin/shared/linkables/_home_page.html.erb +3 -0
- data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +28 -0
- data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +20 -0
- data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +22 -0
- data/app/views/spree/admin/shared/linkables/_url.html.erb +16 -0
- data/app/views/spree/admin/shared/named_types/_index.html.erb +7 -5
- data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +1 -3
- data/app/views/spree/admin/shared/sub_menu/_content.html.erb +4 -0
- data/app/views/spree/admin/shared/sub_menu/_stock.html.erb +4 -0
- data/app/views/spree/admin/shipping_categories/index.html.erb +5 -3
- data/app/views/spree/admin/shipping_methods/index.html.erb +5 -3
- data/app/views/spree/admin/states/_state_list.html.erb +5 -3
- data/app/views/spree/admin/stock_locations/index.html.erb +5 -3
- data/app/views/spree/admin/stock_transfers/index.html.erb +5 -4
- data/app/views/spree/admin/stock_transfers/new.html.erb +9 -7
- data/app/views/spree/admin/store_credit_categories/index.html.erb +5 -3
- data/app/views/spree/admin/store_credits/index.html.erb +7 -5
- data/app/views/spree/admin/stores/_form.html.erb +12 -2
- data/app/views/spree/admin/stores/index.html.erb +12 -10
- data/app/views/spree/admin/tax_categories/index.html.erb +5 -3
- data/app/views/spree/admin/tax_rates/index.html.erb +5 -3
- data/app/views/spree/admin/taxonomies/_list.html.erb +5 -3
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/users/_addresses_form.html.erb +2 -4
- data/app/views/spree/admin/users/_lifetime_stats.html.erb +16 -4
- data/app/views/spree/admin/users/index.html.erb +5 -3
- data/app/views/spree/admin/users/items.html.erb +1 -1
- data/app/views/spree/admin/variants/_autocomplete.js.erb +6 -2
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +18 -12
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +12 -8
- data/app/views/spree/admin/variants/_split.js.erb +9 -7
- data/app/views/spree/admin/variants/index.html.erb +8 -5
- data/app/views/spree/admin/zones/index.html.erb +5 -3
- data/app/views/spree/layouts/admin.html.erb +16 -16
- data/config/initializers/assets.rb +5 -1
- data/config/routes.rb +14 -2
- data/lib/generators/spree/backend/install/install_generator.rb +22 -0
- data/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js +8 -0
- data/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css +9 -0
- data/lib/spree/backend/engine.rb +4 -11
- data/lib/spree/backend.rb +7 -4
- data/lib/spree_backend.rb +0 -2
- data/spec/fixtures/files/favicon.ico +0 -0
- data/spec/fixtures/files/icon_512x512.png +0 -0
- data/spree_backend.gemspec +16 -11
- data/vendor/assets/javascripts/cleave.js +8 -0
- data/vendor/assets/javascripts/jsonapi-serializer.min.js +8 -0
- data/vendor/assets/javascripts/jsuri.js +458 -0
- data/vendor/assets/javascripts/sortable.js +2 -3709
- data/vendor/assets/javascripts/sweetalert2.js +2 -0
- metadata +208 -42
- data/app/assets/javascripts/spree/backend/address_states.js +0 -44
- data/app/assets/javascripts/spree/frontend/backend.js +0 -1
- data/app/assets/stylesheets/spree/frontend/backend.css +0 -1
- 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,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>
|