spree_backend 4.2.5 → 4.3.0
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 +132 -0
- data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +87 -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 +79 -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 +19 -16
- 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 +61 -0
- data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +174 -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 +27 -0
- data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +27 -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 +23 -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 +10 -5
- 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 +193 -21
- 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
@@ -23,9 +23,11 @@
|
|
23
23
|
<td class="text-center"><%= country.iso3 %></td>
|
24
24
|
<td class="text-center"><%= active_badge(country.states_required?) %></td>
|
25
25
|
<td class="text-center"><%= active_badge(country.zipcode_required?) %></td>
|
26
|
-
<td class="actions
|
27
|
-
|
28
|
-
|
26
|
+
<td class="actions">
|
27
|
+
<span class="d-flex justify-content-end">
|
28
|
+
<%= link_to_edit(country, no_text: true) if can? :edit, country %>
|
29
|
+
<%= link_to_delete(country, no_text: true) if can? :delete, country %>
|
30
|
+
</span>
|
29
31
|
</td>
|
30
32
|
</tr>
|
31
33
|
<% end %>
|
@@ -26,10 +26,12 @@
|
|
26
26
|
</span>
|
27
27
|
</td>
|
28
28
|
<td><%= pretty_time(reimbursement.created_at) %></td>
|
29
|
-
<td class="actions
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
<td class="actions">
|
30
|
+
<span class="d-flex justify-content-end">
|
31
|
+
<% if !reimbursement.reimbursed? %>
|
32
|
+
<%= link_to_edit_url(url_for([:edit, :admin, @order, reimbursement]), title: "admin_edit_#{dom_id(reimbursement)}", no_text: true) if can?(:edit, reimbursement) %>
|
33
|
+
<% end %>
|
34
|
+
</span>
|
33
35
|
</td>
|
34
36
|
</tr>
|
35
37
|
<% end %>
|
@@ -38,13 +38,15 @@
|
|
38
38
|
<%= return_item.acceptance_status_errors if return_item.acceptance_status_errors.present? %>
|
39
39
|
</td>
|
40
40
|
<% if show_decision %>
|
41
|
-
<td class='actions
|
42
|
-
|
43
|
-
<%= Spree.t(:accept) %>
|
44
|
-
|
45
|
-
|
46
|
-
<%= Spree.t(:reject) %>
|
47
|
-
|
41
|
+
<td class='actions'>
|
42
|
+
<span class="d-flex justify-content-end">
|
43
|
+
<%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-success btn-sm', params: { "return_item[acceptance_status]" => 'accepted' }, "data-action" => 'save', title: Spree.t(:accept), method: 'put' } do %>
|
44
|
+
<%= Spree.t(:accept) %>
|
45
|
+
<% end if can?(:accept, return_item) %>
|
46
|
+
<%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-danger btn-sm', params: { "return_item[acceptance_status]" => 'rejected' }, "data-action" => 'remove', title: Spree.t(:reject), method: 'put' } do %>
|
47
|
+
<%= Spree.t(:reject) %>
|
48
|
+
<% end if can?(:reject, return_item) %>
|
49
|
+
</span>
|
48
50
|
</td>
|
49
51
|
<% end %>
|
50
52
|
</tr>
|
@@ -37,8 +37,10 @@
|
|
37
37
|
<strong class="badge badge-inactive text-uppercase"><%= Spree.t(:incomplete) %></strong>
|
38
38
|
<% end %>
|
39
39
|
</td>
|
40
|
-
<td class='actions
|
41
|
-
|
40
|
+
<td class='actions' data-hook="admin_orders_customer_returns_index_row_actions">
|
41
|
+
<span class="d-flex justify-content-end">
|
42
|
+
<%= link_to_edit_url(edit_admin_order_customer_return_path(@order, customer_return), title: "admin_edit_#{dom_id(customer_return)}", no_text: true) if can?(:edit, customer_return) %>
|
43
|
+
</span>
|
42
44
|
</td>
|
43
45
|
</tr>
|
44
46
|
<% end %>
|
File without changes
|
@@ -41,15 +41,19 @@
|
|
41
41
|
<% end %>
|
42
42
|
</td>
|
43
43
|
<td class="image">
|
44
|
-
|
44
|
+
<div class="admin-product-image-container small-img">
|
45
|
+
<%= link_to image_tag(main_app.url_for(image.url(:product))), main_app.rails_blob_url(image.attachment) %>
|
46
|
+
</div>
|
45
47
|
</td>
|
46
48
|
<% if has_variants %>
|
47
49
|
<td><%= options_text_for(image) %></td>
|
48
50
|
<% end %>
|
49
51
|
<td><%= image.alt %></td>
|
50
|
-
<td class="actions
|
51
|
-
|
52
|
-
|
52
|
+
<td class="actions">
|
53
|
+
<span class="d-flex justify-content-end">
|
54
|
+
<%= link_to_with_icon('edit.svg', Spree.t(:edit), spree.edit_admin_product_image_url(@product, image), class: 'btn btn-primary btn-sm', no_text: true, data: { action: 'edit' }) if can? :edit, image %>
|
55
|
+
<%= link_to_delete(image, { url: spree.admin_product_image_url(@product, image), no_text: true }) if can? :destroy, image %>
|
56
|
+
</span>
|
53
57
|
</td>
|
54
58
|
</tr>
|
55
59
|
<% end %>
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<div data-hook="admin_menu_item_form_fields">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-12 col-md-6">
|
4
|
+
<div class="card mb-3">
|
5
|
+
<div class="card-header">
|
6
|
+
<h5 class="mb-0"><%= Spree.t('admin.navigation.settings') %></h5>
|
7
|
+
</div>
|
8
|
+
<div class="card-body">
|
9
|
+
<%= f.field_container :item_type, class: ['form-group'] do %>
|
10
|
+
<%= f.label :item_type, Spree.t('admin.navigation.item_type') %>
|
11
|
+
<%= f.select(:item_type, @menu_item_types, {include_blank: false}) %>
|
12
|
+
<%= f.error_message_on :item_type %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= f.field_container :code, class: ['form-group'] do %>
|
16
|
+
<%= f.label :code, Spree.t('admin.navigation.code') %>
|
17
|
+
<%= f.text_field :code, class: 'form-control' %>
|
18
|
+
<%= f.error_message_on :code %>
|
19
|
+
<small class="form-text text-muted">
|
20
|
+
<%= raw Spree.t('admin.navigation.set_a_code') %>
|
21
|
+
</small>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= f.field_container :parent_id, class: ['form-group'] do %>
|
25
|
+
<%= f.label :parent_id, Spree.t('admin.navigation.nested_under') %>
|
26
|
+
<%= f.select :parent_id, nested_set_options(@menu.menu_items, @menu_item) {|i| "#{'-' * i.level} #{i.name}" }, {include_blank: false}, {class: 'select2'} %>
|
27
|
+
<%= f.error_message_on :parent_id %>
|
28
|
+
<small class="form-text text-muted">
|
29
|
+
<%= Spree.t('admin.navigation.nested_under_info') %>
|
30
|
+
</small>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div class="col-12 col-md-6">
|
37
|
+
<div class="card mb-3">
|
38
|
+
<div class="card-header">
|
39
|
+
<h5 class="mb-0"><%= Spree.t('admin.navigation.public_details') %></h5>
|
40
|
+
</div>
|
41
|
+
<div class="card-body">
|
42
|
+
<%= f.field_container :name, class: ['form-group'] do %>
|
43
|
+
<%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
|
44
|
+
<%= f.text_field :name, class: 'form-control', required: true %>
|
45
|
+
<%= f.error_message_on :name %>
|
46
|
+
<% end %>
|
47
|
+
|
48
|
+
<%= f.field_container :subtitle, class: ['form-group'] do %>
|
49
|
+
<%= f.label :subtitle, Spree.t('admin.navigation.subtitle') %>
|
50
|
+
<%= f.text_field :subtitle, class: 'form-control' %>
|
51
|
+
<%= f.error_message_on :subtitle %>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
<% @menu_item.build_icon unless @menu_item.icon %>
|
55
|
+
<%= f.fields_for :icon do |icon_field| %>
|
56
|
+
<%= f.field_container :icon_attachment do %>
|
57
|
+
<% unless @menu_item.icon.new_record? %>
|
58
|
+
<div id="menuItemImgContainer" class="my-3 ">
|
59
|
+
<%= image_tag(main_app.url_for(@menu_item.icon.attachment)) %>
|
60
|
+
<%= link_to Spree.t(:remove_image), remove_icon_admin_menu_menu_item_path(@menu, @menu_item), method: :delete %>
|
61
|
+
</div>
|
62
|
+
<% end %>
|
63
|
+
<div id="<% unless @menu_item.icon.new_record? %>MenuItemImageButton<% end %>">
|
64
|
+
<%= icon_field.file_field :attachment %>
|
65
|
+
</div>
|
66
|
+
<small class="form-text text-muted">
|
67
|
+
<%= raw Spree.t('admin.navigation.image_info') %>
|
68
|
+
</small>
|
69
|
+
<% end %>
|
70
|
+
|
71
|
+
<%= f.field_container :icon_alt do %>
|
72
|
+
<% unless @menu_item.icon.new_record? %>
|
73
|
+
<div class="form-group my-3">
|
74
|
+
<%= icon_field.label :alt, Spree.t('admin.navigation.image_alt_text') %>
|
75
|
+
<%= icon_field.text_field :alt, class: 'form-control' %>
|
76
|
+
</div>
|
77
|
+
<% end %>
|
78
|
+
<% end %>
|
79
|
+
<% end %>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="row">
|
86
|
+
<div class="col-12">
|
87
|
+
|
88
|
+
<div id="LinkSettings">
|
89
|
+
<div class="card mb-3">
|
90
|
+
<div class="card-header">
|
91
|
+
<h5 class="mb-0"><%= Spree.t('admin.navigation.link_settings') %></h5>
|
92
|
+
</div>
|
93
|
+
<div class="card-body">
|
94
|
+
<div class="row">
|
95
|
+
<div class="col-12 col-md-6">
|
96
|
+
<%= f.field_container :linked_resource_type, class: ['form-group'] do %>
|
97
|
+
<%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
|
98
|
+
<%= f.select(:linked_resource_type, spree_humanize_dropdown_values('Spree::MenuItem', {const: 'LINKED_RESOURCE_TYPE'}), {include_blank: false}, class: 'link_switcher') %>
|
99
|
+
<%= f.error_message_on :linked_resource_type %>
|
100
|
+
<% end %>
|
101
|
+
</div>
|
102
|
+
<div class="col-12 col-md-6">
|
103
|
+
<%= render "spree/admin/shared/link_fields", resource: @menu_item, f: f %>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div id="usingContainerInfo" class="alert alert-info">
|
111
|
+
<%= raw Spree.t('admin.navigation.menu_item_type_container_message') %>
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :page_title do %>
|
2
|
+
<%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> /
|
3
|
+
<%= link_to @menu.name, spree.edit_admin_menu_path(@menu) %> / <%= @menu_item.name %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu_item } %>
|
7
|
+
|
8
|
+
<%= form_for [:admin, @menu, @menu_item] do |f| %>
|
9
|
+
<%= render partial: 'form', locals: { f: f } %>
|
10
|
+
<%= render partial: 'spree/admin/shared/edit_resource_links' %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :page_title do %>
|
2
|
+
<%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> /
|
3
|
+
<%= link_to @menu.name, spree.edit_admin_menu_path(@menu) %> / <%= Spree.t('admin.navigation.new_menu_item') %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu_item } %>
|
7
|
+
|
8
|
+
<%= form_for [:admin, @menu, @menu_item] do |f| %>
|
9
|
+
<%= render partial: 'form', locals: { f: f } %>
|
10
|
+
<%= render partial: 'spree/admin/shared/new_resource_links' %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div data-hook="admin_menu_form_fields" class="row">
|
2
|
+
<%= f.field_container :name, class: ['form-group col-12 col-md-4'] do %>
|
3
|
+
<%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
|
4
|
+
<%= f.text_field :name, class: 'form-control', required: true %>
|
5
|
+
<%= f.error_message_on :name %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<%= f.field_container :location, class: ['form-group col-12 col-md-4'] do %>
|
9
|
+
<%= f.label :location, Spree.t('location') %>
|
10
|
+
<%= f.select(:location, spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_LOCATIONS', paramterize_values: true }), {include_blank: false}, class: 'select2') %>
|
11
|
+
<%= f.error_message_on :location %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= f.field_container :locale, class: ['form-group col-12 col-md-4'] do %>
|
15
|
+
<%= f.label :language %>
|
16
|
+
<%= f.select :locale, options_from_collection_for_select(all_locales_options, :last, :first, @menu.locale || I18n.locale), {}, { class: 'select2' } %>
|
17
|
+
<%= f.error_message_on :default_locale %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<% content_for :page_title do %>
|
2
|
+
<%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> / <%= @menu.name %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-12">
|
7
|
+
<div class="card mb-3">
|
8
|
+
<div class="card-header">
|
9
|
+
<h5 class="mb-0"><%= Spree.t('settings') %></h5>
|
10
|
+
</div>
|
11
|
+
<div class="card-body">
|
12
|
+
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
|
13
|
+
<%= form_for [:admin, @menu] do |f| %>
|
14
|
+
<%= render partial: 'form', locals: { f: f } %>
|
15
|
+
<div class="d-flex ">
|
16
|
+
<%= render partial: 'spree/admin/shared/edit_resource_links' %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="menuArea">
|
25
|
+
<div class="row mt-2">
|
26
|
+
<div class="col-12">
|
27
|
+
<div class="card mb-3">
|
28
|
+
<div class="card-header">
|
29
|
+
<div class="row pb-0">
|
30
|
+
<div class="col d-flex">
|
31
|
+
<h5 class="mb-0 align-self-center"><%= Spree.t('admin.navigation.menu_items', menu_name: @menu.name) %></h5>
|
32
|
+
</div>
|
33
|
+
<div class="col d-flex justify-content-end">
|
34
|
+
<%= button_link_to Spree.t('admin.navigation.add_new_item', menu: @menu.name), spree.new_admin_menu_menu_item_path(@menu), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<% if @menu.root.present? %>
|
40
|
+
<div class="card-body p-0 bg-light">
|
41
|
+
<div id="primaryMenuContainer" class="menu-container" data-parent-id="<%= @menu.root.id %>">
|
42
|
+
<% if @menu.root.children.present? %>
|
43
|
+
<% @menu.root.children.each do |root_children| %>
|
44
|
+
<%= build_menu_item(@menu, root_children) %>
|
45
|
+
<% end %>
|
46
|
+
<% else %>
|
47
|
+
<div class="alert alert-info no-objects-found m-5">
|
48
|
+
<%= raw Spree.t('admin.navigation.no_menu_items', menu: @menu.root.name) %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
</div>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<% content_for :page_title do %>
|
2
|
+
<%= Spree.t('admin.navigation.menus') %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :page_actions do %>
|
6
|
+
<%= button_link_to Spree.t('admin.navigation.add_new_menu'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_menu' } %>
|
7
|
+
<% end if can?(:create, Spree::Menu) %>
|
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
|
+
|
15
|
+
<div class="col-12 col-lg-4">
|
16
|
+
<div class="form-group">
|
17
|
+
<%= f.label :name_cont, Spree.t('name') %>
|
18
|
+
<%= f.text_field :name_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div class="col-12 col-lg-4">
|
22
|
+
<div class="form-group">
|
23
|
+
<%= label_tag :q_location_eq, Spree.t(:location) %><%= f.select :location_eq, spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_LOCATIONS', paramterize_values: true }), { include_blank: true }, class: 'select2-clear js-filterable' %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="col-12 col-lg-4">
|
28
|
+
<div class="form-group">
|
29
|
+
<%= label_tag :q_locale_eq, Spree.t(:language) %>
|
30
|
+
<%= f.select :locale_eq, all_locales_options, { include_blank: true }, class: 'select2-clear js-filterable' %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div data-hook="admin_menus_index_search_buttons" class="form-actions">
|
36
|
+
<%= button Spree.t(:search), 'search.svg' %>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<% if @menus.any? %>
|
43
|
+
<div class="table-responsive">
|
44
|
+
<table class="table" id="menusTable">
|
45
|
+
<thead>
|
46
|
+
<th scope="col"><%= Spree.t(:name) %></th>
|
47
|
+
<th scope="col"><%= Spree.t('location') %></th>
|
48
|
+
<th scope="col"><%= Spree.t('language') %></th>
|
49
|
+
<th class="text-center" scope="col"><%= Spree.t('default') %>
|
50
|
+
<span data-show-info
|
51
|
+
data-alert-kind="info"
|
52
|
+
data-alert-title="<%= Spree.t('admin.navigation.default_menus_info.title') %>"
|
53
|
+
data-alert-html="<%= Spree.t('admin.navigation.default_menus_info.body') %>">
|
54
|
+
<%= svg_icon name: "info.svg", width: '15', height: '15' %>
|
55
|
+
</span>
|
56
|
+
</th>
|
57
|
+
<th scope="col"></th>
|
58
|
+
</thead>
|
59
|
+
<tbody>
|
60
|
+
<% @menus.each do |menu| %>
|
61
|
+
<tr>
|
62
|
+
<td>
|
63
|
+
<%= menu.name %>
|
64
|
+
</td>
|
65
|
+
<td>
|
66
|
+
<%= menu.location.titleize %>
|
67
|
+
</td>
|
68
|
+
<td>
|
69
|
+
<%= locale_full_name(menu.locale) %>
|
70
|
+
</td>
|
71
|
+
<td class="text-center">
|
72
|
+
<%= active_badge(default_menu_for_store?(menu)) %>
|
73
|
+
</td>
|
74
|
+
<td class="actions" data-hook="admin_menus_index_row_actions">
|
75
|
+
<span class="d-flex justify-content-end">
|
76
|
+
<%= link_to_edit(menu, no_text: true) %>
|
77
|
+
<%= link_to_delete menu, no_text: true, url: spree.admin_menu_path(menu) if can?(:destroy, menu) %>
|
78
|
+
</span>
|
79
|
+
</td>
|
80
|
+
</tr>
|
81
|
+
<% end %>
|
82
|
+
</tbody>
|
83
|
+
</table>
|
84
|
+
</div>
|
85
|
+
<%= render 'spree/admin/shared/index_table_options', collection: @menus, simple: true %>
|
86
|
+
<% else %>
|
87
|
+
<div class="alert alert-info no-objects-found">
|
88
|
+
<%= Spree.t('admin.navigation.you_have_no_menus') %>
|
89
|
+
</div>
|
90
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div class="container-item-row d-flex flex-nowrap">
|
2
|
+
<div class="move-handle d-flex align-items-center p-3">
|
3
|
+
<%= svg_icon(name: 'sort.svg', width: '20', height: '20') %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="d-flex align-items-center overflow-hidden w-100">
|
7
|
+
<div class="overflow-hidden">
|
8
|
+
<%= item.name %>
|
9
|
+
<% if item.link.present? %>
|
10
|
+
<span class="badge badge-light badge-light-muted-text">-> <%= item.link %></span>
|
11
|
+
<% end %>
|
12
|
+
<small class="form-text text-muted mt-0">
|
13
|
+
<%= "#{Spree.t('admin.navigation.type')}: #{item.item_type}" %>
|
14
|
+
<%= "| #{Spree.t('admin.navigation.code')}: #{item.code}" if item.code.present? %>
|
15
|
+
</small>
|
16
|
+
</div>
|
17
|
+
<% if item.icon.present? %>
|
18
|
+
<div class="ml-2">
|
19
|
+
<div class="menu_items_image_holder">
|
20
|
+
<%= image_tag main_app.url_for(item.icon.attachment) %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="d-flex align-items-center space-buttons px-2">
|
27
|
+
<%= link_to_edit(item, no_text: true, url: spree.edit_admin_menu_menu_item_path(menu, item)) %>
|
28
|
+
<%= link_to_delete(item, no_text: true, url: spree.admin_menu_menu_item_path(menu, item)) if can?(:destroy, item) %>
|
29
|
+
</div>
|
30
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% content_for :page_title do %>
|
2
|
+
<%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> / <%= Spree.t('admin.navigation.new_menu') %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class="row">
|
6
|
+
<div class="col-12">
|
7
|
+
<div class="card mb-3">
|
8
|
+
<div class="card-header">
|
9
|
+
<h5 class="mb-0"><%= Spree.t('settings') %></h5>
|
10
|
+
</div>
|
11
|
+
<div class="card-body">
|
12
|
+
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
|
13
|
+
<%= form_for [:admin, @menu] do |f| %>
|
14
|
+
<%= render partial: 'form', locals: { f: f } %>
|
15
|
+
<div class="d-flex ">
|
16
|
+
<%= render partial: 'spree/admin/shared/new_resource_links' %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|