spree_backend 4.1.9 → 4.2.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/backend-add.svg +5 -0
- data/app/assets/images/backend-adjust.svg +5 -0
- data/app/assets/images/backend-approve.svg +3 -0
- data/app/assets/images/backend-arrow-down.svg +1 -0
- data/app/assets/images/backend-arrow-left.svg +1 -0
- data/app/assets/images/backend-arrow-right.svg +1 -0
- data/app/assets/images/backend-arrow-up.svg +1 -0
- data/app/assets/images/backend-calendar.svg +9 -0
- data/app/assets/images/backend-cancel.svg +7 -0
- data/app/assets/images/backend-capture.svg +3 -0
- data/app/assets/images/backend-cart.svg +1 -0
- data/app/assets/images/backend-chevron-down.svg +1 -0
- data/app/assets/images/backend-chevron-left.svg +1 -0
- data/app/assets/images/backend-chevron-right.svg +1 -0
- data/app/assets/images/backend-chevron-up.svg +1 -0
- data/app/assets/images/backend-clone.svg +7 -0
- data/app/assets/images/backend-close.svg +7 -0
- data/app/assets/images/backend-delete.svg +6 -0
- data/app/assets/images/backend-double-chevron-left.svg +15 -0
- data/app/assets/images/backend-double-chevron-right.svg +17 -0
- data/app/assets/images/backend-edit.svg +14 -0
- data/app/assets/images/backend-enter.svg +6 -0
- data/app/assets/images/backend-envelope.svg +3 -0
- data/app/assets/images/backend-exit.svg +13 -0
- data/app/assets/images/backend-extensions.svg +4 -0
- data/app/assets/images/backend-eye-open.svg +8 -0
- data/app/assets/images/backend-file.svg +6 -0
- data/app/assets/images/backend-filter.svg +3 -0
- data/app/assets/images/backend-folder.svg +4 -0
- data/app/assets/images/backend-images.svg +7 -0
- data/app/assets/images/backend-info.svg +7 -0
- data/app/assets/images/backend-items.svg +5 -0
- data/app/assets/images/backend-leaf.svg +7 -0
- data/app/assets/images/backend-list.svg +5 -0
- data/app/assets/images/backend-location.svg +4 -0
- data/app/assets/images/backend-menu.svg +5 -0
- data/app/assets/images/backend-money.svg +1 -0
- data/app/assets/images/backend-move.svg +5 -0
- data/app/assets/images/backend-ok.svg +3 -0
- data/app/assets/images/backend-pagination-double-arrow-right.svg +8 -0
- data/app/assets/images/backend-payments.svg +8 -0
- data/app/assets/images/backend-pencil.svg +1 -0
- data/app/assets/images/backend-products.svg +5 -0
- data/app/assets/images/backend-promotion.svg +8 -0
- data/app/assets/images/backend-recycle.svg +5 -0
- data/app/assets/images/backend-remove.svg +6 -0
- data/app/assets/images/backend-report.svg +6 -0
- data/app/assets/images/backend-resume.svg +5 -0
- data/app/assets/images/backend-returns.svg +3 -0
- data/app/assets/images/backend-save.svg +3 -0
- data/app/assets/images/backend-search.svg +1 -0
- data/app/assets/images/backend-settings.svg +6 -0
- data/app/assets/images/backend-shipping.svg +3 -0
- data/app/assets/images/backend-slack.svg +3 -0
- data/app/assets/images/backend-sort.svg +5 -0
- data/app/assets/images/backend-split.svg +3 -0
- data/app/assets/images/backend-store.svg +14 -0
- data/app/assets/images/backend-tick.svg +3 -0
- data/app/assets/images/backend-update.svg +3 -0
- data/app/assets/images/backend-user.svg +3 -0
- data/app/assets/images/backend-users.svg +6 -0
- data/app/assets/images/backend-view.svg +8 -0
- data/app/assets/images/backend-void.svg +7 -0
- data/app/assets/javascripts/spree/backend.js +5 -2
- data/app/assets/javascripts/spree/backend/admin.js +156 -147
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -0
- data/app/assets/javascripts/spree/backend/flatpickr_locals.js +37 -0
- data/app/assets/javascripts/spree/backend/multi_currency.js +38 -0
- data/app/assets/javascripts/spree/backend/payments/edit.js +4 -3
- data/app/assets/javascripts/spree/backend/payments/new.js +18 -18
- data/app/assets/javascripts/spree/backend/promotions.js +1 -1
- data/app/assets/javascripts/spree/backend/spree-select2.js +18 -4
- data/app/assets/javascripts/spree/backend/stock_management.js +2 -1
- data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +4 -4
- data/app/assets/javascripts/spree/backend/taxonomy.js +8 -1
- data/app/assets/javascripts/spree/backend/taxons.js +25 -16
- data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js +1 -1
- data/app/assets/javascripts/spree/backend/variant_management.js +2 -1
- data/app/assets/stylesheets/spree/backend.css +1 -1
- data/app/assets/stylesheets/spree/backend/components/_buttons.scss +27 -11
- data/app/assets/stylesheets/spree/backend/components/_filters.scss +35 -5
- data/app/assets/stylesheets/spree/backend/components/_icons.scss +39 -4
- data/app/assets/stylesheets/spree/backend/components/_main.scss +32 -6
- data/app/assets/stylesheets/spree/backend/components/_navbar.scss +16 -8
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +119 -55
- data/app/assets/stylesheets/spree/backend/components/_tables.scss +62 -19
- data/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss +26 -63
- data/app/assets/stylesheets/spree/backend/global/_variables.scss +5 -1
- data/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss +95 -0
- data/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss +0 -117
- data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +73 -24
- data/app/assets/stylesheets/spree/backend/shared/_base.scss +40 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +38 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +5 -0
- data/app/assets/stylesheets/spree/backend/views/_order_payments.scss +12 -0
- data/app/assets/stylesheets/spree/backend/views/_product_properties.scss +11 -0
- data/app/assets/stylesheets/spree/backend/views/prototypes.scss +42 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +27 -0
- data/app/controllers/spree/admin/prices_controller.rb +39 -0
- data/app/controllers/spree/admin/stock_transfers_controller.rb +8 -1
- data/app/controllers/spree/admin/stores_controller.rb +61 -1
- data/app/controllers/spree/admin/taxons_controller.rb +5 -1
- data/app/helpers/spree/admin/base_helper.rb +25 -8
- data/app/helpers/spree/admin/navigation_helper.rb +50 -19
- data/app/helpers/spree/admin/orders_helper.rb +2 -2
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_first_page.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_gap.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_last_page.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_next_page.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_page.html.erb +0 -0
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_paginator.html.erb +1 -1
- data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_prev_page.html.erb +1 -1
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +2 -2
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +16 -16
- data/app/views/spree/admin/adjustments/edit.html.erb +2 -2
- data/app/views/spree/admin/adjustments/index.html.erb +3 -3
- data/app/views/spree/admin/adjustments/new.html.erb +1 -1
- data/app/views/spree/admin/countries/_form.html.erb +9 -4
- data/app/views/spree/admin/countries/index.html.erb +27 -24
- data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +37 -35
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +2 -0
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +45 -43
- data/app/views/spree/admin/customer_returns/index.html.erb +3 -1
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/general_settings/_form.html.erb +27 -0
- data/app/views/spree/admin/general_settings/edit.html.erb +4 -3
- data/app/views/spree/admin/images/edit.html.erb +2 -2
- data/app/views/spree/admin/images/index.html.erb +7 -7
- data/app/views/spree/admin/images/new.html.erb +2 -2
- data/app/views/spree/admin/log_entries/index.html.erb +4 -3
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/edit.html.erb +22 -20
- data/app/views/spree/admin/option_types/index.html.erb +27 -25
- data/app/views/spree/admin/orders/_adjustments.html.erb +26 -26
- data/app/views/spree/admin/orders/_line_items.html.erb +7 -7
- data/app/views/spree/admin/orders/_order_actions.html.erb +1 -1
- data/app/views/spree/admin/orders/_risk_analysis.html.erb +44 -42
- data/app/views/spree/admin/orders/_shipment.html.erb +6 -6
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +5 -5
- data/app/views/spree/admin/orders/_store_form.html.erb +3 -3
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +135 -127
- data/app/views/spree/admin/payment_methods/index.html.erb +6 -4
- data/app/views/spree/admin/payments/_capture_events.html.erb +18 -16
- data/app/views/spree/admin/payments/_form.html.erb +1 -1
- data/app/views/spree/admin/payments/_list.html.erb +39 -37
- data/app/views/spree/admin/payments/index.html.erb +2 -3
- data/app/views/spree/admin/payments/new.html.erb +1 -1
- data/app/views/spree/admin/payments/show.html.erb +1 -1
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +30 -30
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +20 -18
- data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +28 -26
- data/app/views/spree/admin/prices/_variant_prices.html.erb +43 -0
- data/app/views/spree/admin/prices/index.html.erb +21 -0
- data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +16 -4
- data/app/views/spree/admin/product_properties/index.html.erb +24 -19
- data/app/views/spree/admin/products/_add_stock_form.html.erb +1 -1
- data/app/views/spree/admin/products/_autocomplete.js.erb +27 -21
- data/app/views/spree/admin/products/_form.html.erb +40 -9
- data/app/views/spree/admin/products/edit.html.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +24 -19
- data/app/views/spree/admin/products/new.html.erb +11 -2
- data/app/views/spree/admin/products/stock.html.erb +3 -3
- data/app/views/spree/admin/promotion_categories/index.html.erb +4 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
- data/app/views/spree/admin/promotions/_form.html.erb +44 -17
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +1 -1
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
- data/app/views/spree/admin/promotions/_rules.html.erb +4 -4
- data/app/views/spree/admin/promotions/edit.html.erb +2 -2
- data/app/views/spree/admin/promotions/index.html.erb +5 -3
- data/app/views/spree/admin/promotions/new.html.erb +7 -6
- data/app/views/spree/admin/promotions/rules/_country.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +5 -5
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +6 -13
- data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
- data/app/views/spree/admin/properties/index.html.erb +5 -3
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +30 -28
- data/app/views/spree/admin/prototypes/index.html.erb +21 -19
- data/app/views/spree/admin/prototypes/show.html.erb +21 -8
- data/app/views/spree/admin/refunds/edit.html.erb +2 -2
- data/app/views/spree/admin/refunds/new.html.erb +2 -2
- data/app/views/spree/admin/reimbursement_types/_form.html.erb +4 -4
- data/app/views/spree/admin/reimbursement_types/index.html.erb +4 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +66 -63
- data/app/views/spree/admin/reimbursements/index.html.erb +21 -20
- data/app/views/spree/admin/reimbursements/show.html.erb +66 -60
- data/app/views/spree/admin/reports/index.html.erb +18 -17
- data/app/views/spree/admin/reports/sales_total.html.erb +20 -19
- data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -2
- data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/index.html.erb +3 -1
- data/app/views/spree/admin/return_authorizations/new.html.erb +2 -2
- data/app/views/spree/admin/return_index/customer_returns.html.erb +4 -4
- data/app/views/spree/admin/return_index/return_authorizations.html.erb +4 -4
- data/app/views/spree/admin/roles/index.html.erb +21 -19
- data/app/views/spree/admin/shared/_account_nav.html.erb +51 -65
- data/app/views/spree/admin/shared/_address_form.html.erb +31 -73
- data/app/views/spree/admin/shared/_cal_close.html.erb +10 -0
- data/app/views/spree/admin/shared/_content_header.html.erb +40 -21
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_header.html.erb +14 -11
- data/app/views/spree/admin/shared/_index_table_options.html.erb +5 -7
- data/app/views/spree/admin/shared/_main_menu.html.erb +25 -14
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_order_summary.html.erb +2 -0
- data/app/views/spree/admin/shared/_order_tabs.html.erb +9 -9
- data/app/views/spree/admin/shared/_product_tabs.html.erb +13 -5
- data/app/views/spree/admin/shared/_refunds.html.erb +31 -29
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +27 -6
- data/app/views/spree/admin/shared/_sidebar.html.erb +19 -1
- data/app/views/spree/admin/shared/_table_filter.html.erb +3 -3
- data/app/views/spree/admin/shared/_translations.html.erb +33 -1
- data/app/views/spree/admin/shared/_version.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_index.html.erb +3 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +3 -1
- data/app/views/spree/admin/shipping_methods/index.html.erb +3 -1
- data/app/views/spree/admin/state_changes/index.html.erb +5 -2
- data/app/views/spree/admin/states/_state_list.html.erb +25 -24
- data/app/views/spree/admin/states/index.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +2 -2
- data/app/views/spree/admin/stock_locations/index.html.erb +3 -1
- data/app/views/spree/admin/stock_movements/index.html.erb +28 -26
- data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +20 -18
- data/app/views/spree/admin/stock_transfers/index.html.erb +6 -4
- data/app/views/spree/admin/stock_transfers/new.html.erb +3 -3
- data/app/views/spree/admin/stock_transfers/show.html.erb +3 -3
- data/app/views/spree/admin/store_credit_categories/index.html.erb +3 -1
- data/app/views/spree/admin/store_credits/index.html.erb +3 -1
- data/app/views/spree/admin/stores/_form.html.erb +128 -68
- data/app/views/spree/admin/stores/edit.html.erb +1 -1
- data/app/views/spree/admin/stores/index.html.erb +4 -2
- data/app/views/spree/admin/tax_categories/index.html.erb +29 -27
- data/app/views/spree/admin/tax_rates/index.html.erb +3 -1
- data/app/views/spree/admin/taxonomies/_list.html.erb +24 -22
- data/app/views/spree/admin/taxonomies/edit.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +3 -3
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +24 -22
- data/app/views/spree/admin/taxons/edit.html.erb +6 -2
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/users/_lifetime_stats.html.erb +24 -23
- data/app/views/spree/admin/users/_sidebar.html.erb +5 -5
- data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
- data/app/views/spree/admin/users/edit.html.erb +2 -2
- data/app/views/spree/admin/users/index.html.erb +25 -23
- data/app/views/spree/admin/users/items.html.erb +3 -2
- data/app/views/spree/admin/users/orders.html.erb +30 -29
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +3 -3
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +2 -2
- data/app/views/spree/admin/variants/_form.html.erb +14 -2
- data/app/views/spree/admin/variants/_split.js.erb +2 -2
- data/app/views/spree/admin/variants/index.html.erb +7 -5
- data/app/views/spree/admin/zones/index.html.erb +4 -4
- data/app/views/spree/layouts/admin.html.erb +33 -27
- data/config/initializers/ransack.rb +31 -0
- data/config/routes.rb +1 -0
- data/lib/spree/backend.rb +2 -0
- data/lib/spree_backend.rb +0 -1
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spree_backend.gemspec +6 -4
- data/vendor/assets/javascripts/js.cookie.js +154 -156
- data/vendor/assets/javascripts/purify.js +1217 -0
- data/vendor/assets/javascripts/sortable.js +3709 -0
- data/vendor/assets/stylesheets/animate.css +7 -3156
- data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +23 -9
- metadata +137 -24
@@ -0,0 +1,7 @@
|
|
1
|
+
<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
2
|
+
<g transform="matrix(5.37908e-15,-16.6134,-16.6134,-5.37908e-15,470.536,472.199)">
|
3
|
+
<path d="M14.061,12.927L24.78,23.646C25.073,23.939 25.073,24.414 24.78,24.707C24.487,25 24.013,25 23.72,24.707L13,13.987L2.28,24.707C1.987,25 1.513,25 1.22,24.707C0.927,24.414 0.927,23.939 1.22,23.646L11.939,12.927L1.22,2.207C0.927,1.914 0.927,1.439 1.22,1.146C1.366,1 1.558,0.927 1.75,0.927C1.942,0.927 2.134,1 2.28,1.146L13,11.866L23.72,1.146C23.866,1 24.058,0.927 24.25,0.927C24.442,0.927 24.634,1 24.78,1.146C25.073,1.439 25.073,1.914 24.78,2.207L14.061,12.927Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:2.05px;"/>
|
4
|
+
</g>
|
5
|
+
</svg>
|
6
|
+
|
7
|
+
<!-- CANCEL CLOSE VOID-->
|
@@ -1,13 +1,15 @@
|
|
1
1
|
//= require modernizr
|
2
|
+
//= require purify
|
3
|
+
//= require sortable
|
4
|
+
//= require flatpickr
|
2
5
|
//= require jquery3
|
3
6
|
//= require popper
|
4
7
|
//= require bootstrap-sprockets
|
5
8
|
//= require handlebars
|
9
|
+
//= require cleave
|
6
10
|
//= require js.cookie
|
7
11
|
//= require jquery.jstree/jquery.jstree
|
8
12
|
//= require jquery_ujs
|
9
|
-
//= require jquery-ui/widgets/datepicker
|
10
|
-
//= require jquery-ui/widgets/sortable
|
11
13
|
//= require jquery-ui/widgets/autocomplete
|
12
14
|
//= require select2
|
13
15
|
//= require underscore-min.js
|
@@ -24,6 +26,7 @@
|
|
24
26
|
//= require spree/backend/handlebar_extensions
|
25
27
|
//= require spree/backend/line_items
|
26
28
|
//= require spree/backend/line_items_on_order_edit
|
29
|
+
//= require spree/backend/multi_currency
|
27
30
|
//= require spree/backend/option_type_autocomplete
|
28
31
|
//= require spree/backend/option_value_picker
|
29
32
|
//= require spree/backend/orders/edit
|
@@ -4,74 +4,83 @@ under the spree namespace that do stuff we find helpful.
|
|
4
4
|
Hopefully, this will evolve into a propper class.
|
5
5
|
**/
|
6
6
|
|
7
|
-
/* global
|
7
|
+
/* global AUTH_TOKEN, order_number, Sortable, flatpickr, DOMPurify */
|
8
|
+
|
9
|
+
//= require spree/backend/flatpickr_locals
|
8
10
|
|
9
11
|
jQuery(function ($) {
|
10
12
|
// Add some tips
|
11
|
-
$('.with-tip').
|
13
|
+
$('.with-tip').each(function() {
|
14
|
+
$(this).tooltip({
|
15
|
+
container: $(this)
|
16
|
+
})
|
17
|
+
})
|
18
|
+
|
19
|
+
$('.with-tip').on('show.bs.tooltip', function(event) {
|
20
|
+
if (('ontouchstart' in window)) {
|
21
|
+
event.preventDefault()
|
22
|
+
}
|
23
|
+
})
|
12
24
|
|
13
25
|
$('.js-show-index-filters').click(function () {
|
14
26
|
$('.filter-well').slideToggle()
|
15
27
|
$(this).parents('.filter-wrap').toggleClass('collapsed')
|
16
|
-
$('span.icon', $(this)).toggleClass('icon-chevron-down')
|
17
28
|
})
|
18
29
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
// Responsive Menus
|
31
|
+
var body = $('body')
|
32
|
+
var modalBackdrop = $('#multi-backdrop')
|
33
|
+
|
34
|
+
// Fail safe on resize
|
35
|
+
var resizeTimer;
|
36
|
+
window.addEventListener('resize', function () {
|
37
|
+
document.body.classList.remove('modal-open', 'sidebar-open', 'contextualSideMenu-open');
|
38
|
+
document.body.classList.add('resize-animation-stopper');
|
39
|
+
clearTimeout(resizeTimer);
|
40
|
+
resizeTimer = setTimeout(function () {
|
41
|
+
document.body.classList.remove('resize-animation-stopper');
|
42
|
+
}, 400);
|
43
|
+
});
|
44
|
+
|
45
|
+
function closeAllMenus() {
|
46
|
+
body.removeClass()
|
47
|
+
body.addClass('admin')
|
48
|
+
modalBackdrop.removeClass('show')
|
49
|
+
}
|
29
50
|
|
30
|
-
|
31
|
-
var wrapper = $('#wrapper')
|
32
|
-
var main = $('#main-part')
|
33
|
-
var sidebar = $('#main-sidebar')
|
34
|
-
var version = $('.spree-version')
|
35
|
-
var collapsed = sidebar.find('[aria-expanded="true"]')
|
36
|
-
var collapsedIcons = sidebar.find('.icon-chevron-down')
|
51
|
+
modalBackdrop.click(closeAllMenus)
|
37
52
|
|
38
|
-
|
53
|
+
// Main Menu Functionality
|
54
|
+
var sidebarOpen = $('#sidebar-open')
|
55
|
+
var sidebarClose = $('#sidebar-close')
|
56
|
+
var activeItem = $('#main-sidebar').find('.selected')
|
39
57
|
|
40
|
-
|
41
|
-
|
42
|
-
.next()
|
43
|
-
.removeClass('show')
|
58
|
+
activeItem.closest('.nav-sidebar').addClass('active-option')
|
59
|
+
activeItem.closest('.nav-pills').addClass('in show')
|
44
60
|
|
45
|
-
|
46
|
-
|
47
|
-
|
61
|
+
function openMenu() {
|
62
|
+
closeAllMenus()
|
63
|
+
body.addClass('sidebar-open modal-open')
|
64
|
+
modalBackdrop.addClass('show')
|
65
|
+
}
|
66
|
+
sidebarOpen.click(openMenu)
|
67
|
+
sidebarClose.click(closeAllMenus)
|
48
68
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
.toggleClass('col-9 offset-3 col-md-10 offset-md-2')
|
69
|
+
// Contextual Sidebar Menu
|
70
|
+
var contextualSidebarMenuToggle = $('#contextual-menu-toggle')
|
71
|
+
var contextualSidebarMenuClose = $('#contextual-menu-close')
|
53
72
|
|
54
|
-
|
55
|
-
|
56
|
-
|
73
|
+
function toggleContextualMenu() {
|
74
|
+
if (document.body.classList.contains('contextualSideMenu-open')) {
|
75
|
+
closeAllMenus()
|
57
76
|
} else {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
})
|
62
|
-
|
63
|
-
$('.sidebar-menu-item').mouseover(function () {
|
64
|
-
if ($('#wrapper').hasClass('sidebar-minimized')) {
|
65
|
-
$(this).addClass('menu-active')
|
66
|
-
$(this).find('ul.nav').addClass('submenu-active')
|
77
|
+
closeAllMenus()
|
78
|
+
body.addClass('contextualSideMenu-open modal-open')
|
79
|
+
modalBackdrop.addClass('show')
|
67
80
|
}
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
$(this).removeClass('menu-active')
|
72
|
-
$(this).find('ul.nav').removeClass('submenu-active')
|
73
|
-
}
|
74
|
-
})
|
81
|
+
}
|
82
|
+
contextualSidebarMenuToggle.click(toggleContextualMenu)
|
83
|
+
contextualSidebarMenuClose.click(toggleContextualMenu)
|
75
84
|
|
76
85
|
// TODO: remove this js temp behaviour and fix this decent
|
77
86
|
// Temp quick search
|
@@ -84,28 +93,6 @@ jQuery(function ($) {
|
|
84
93
|
return false
|
85
94
|
})
|
86
95
|
|
87
|
-
// Main menu active item submenu show
|
88
|
-
var active_item = $('#main-sidebar').find('.selected')
|
89
|
-
active_item.closest('.nav-pills').addClass('in show')
|
90
|
-
active_item.closest('.nav-sidebar')
|
91
|
-
.find('.icon-chevron-left')
|
92
|
-
.removeClass('icon-chevron-left')
|
93
|
-
.addClass('icon-chevron-down')
|
94
|
-
|
95
|
-
// Replace ▼ and ▲ in sort_link with nicer icons
|
96
|
-
$('.sort_link').each(function () {
|
97
|
-
// Remove the   in the text
|
98
|
-
var sortLinkText = $(this).text().replace('\xA0', '')
|
99
|
-
|
100
|
-
if (sortLinkText.indexOf('▼') >= 0) {
|
101
|
-
$(this).text(sortLinkText.replace('▼', ''))
|
102
|
-
$(this).append('<span class="icon icon-chevron-down"></span>')
|
103
|
-
} else if (sortLinkText.indexOf('▲') >= 0) {
|
104
|
-
$(this).text(sortLinkText.replace('▲', ''))
|
105
|
-
$(this).append('<span class="icon icon-chevron-up"></span>')
|
106
|
-
}
|
107
|
-
})
|
108
|
-
|
109
96
|
// Clickable ransack filters
|
110
97
|
$('.js-add-filter').click(function () {
|
111
98
|
var ransackField = $(this).data('ransack-field')
|
@@ -148,8 +135,9 @@ jQuery(function ($) {
|
|
148
135
|
}
|
149
136
|
|
150
137
|
label = ransackField(label.text()) + ': ' + ransackValue
|
138
|
+
var cleanLabel = DOMPurify.sanitize(label)
|
151
139
|
|
152
|
-
filter = '<span class="js-filter badge badge-secondary" data-ransack-field="' + ransackFieldId + '">' +
|
140
|
+
filter = '<span class="js-filter badge badge-secondary" data-ransack-field="' + ransackFieldId + '">' + cleanLabel + '<i class="icon icon-cancel ml-2 js-delete-filter"></i></span>'
|
153
141
|
$(".js-filters").append(filter).show()
|
154
142
|
}
|
155
143
|
})
|
@@ -179,20 +167,46 @@ jQuery(function ($) {
|
|
179
167
|
$('#table-filter form').append(perPageInput)
|
180
168
|
}
|
181
169
|
})
|
170
|
+
})
|
171
|
+
|
172
|
+
function handleAlert (element) {
|
173
|
+
element.classList.add('animate__animated', 'animate__bounceInUp')
|
174
|
+
element.addEventListener('animationend', function () {
|
175
|
+
element.classList.remove('animate__bounceInUp')
|
176
|
+
element.classList.add('animate__fadeOutDownBig', 'animate__delay-3s')
|
177
|
+
})
|
178
|
+
}
|
182
179
|
|
183
|
-
|
184
|
-
|
180
|
+
// Triggers alert if required on document ready.
|
181
|
+
$(document).ready(function () {
|
182
|
+
var element = document.querySelector('.flash-alert')
|
183
|
+
|
184
|
+
if (element) {
|
185
|
+
handleAlert(element)
|
186
|
+
}
|
185
187
|
})
|
186
188
|
|
187
189
|
$.fn.visible = function (cond) { this[ cond ? 'show' : 'hide' ]() }
|
190
|
+
// Triggers alerts when requested by javascript.
|
188
191
|
// eslint-disable-next-line camelcase
|
189
192
|
function show_flash (type, message) {
|
193
|
+
var cleanMessage = DOMPurify.sanitize(message)
|
194
|
+
var existingAlert = document.querySelector('.flash-alert')
|
195
|
+
|
196
|
+
if (existingAlert) {
|
197
|
+
existingAlert.remove()
|
198
|
+
}
|
199
|
+
|
190
200
|
var flashDiv = $('.alert-' + type)
|
191
201
|
if (flashDiv.length === 0) {
|
192
|
-
flashDiv = $('<div class="
|
193
|
-
|
202
|
+
flashDiv = $('<div class="d-flex justify-content-center position-fixed flash-alert">' +
|
203
|
+
'<div class="alert alert-' + type + ' mx-2">' + cleanMessage + '</div></div>')
|
204
|
+
|
205
|
+
$('body').append(flashDiv)
|
206
|
+
|
207
|
+
var ajaxFlashNotfication = document.querySelector('.flash-alert')
|
208
|
+
handleAlert(ajaxFlashNotfication)
|
194
209
|
}
|
195
|
-
flashDiv.html(message).show().delay(10000).slideUp()
|
196
210
|
}
|
197
211
|
|
198
212
|
// Apply to individual radio button that makes another element visible when checked
|
@@ -208,31 +222,34 @@ $.fn.radioControlsVisibilityOfElement = function (dependentElementSelector) {
|
|
208
222
|
if (this.checked) { this.click() }
|
209
223
|
})
|
210
224
|
}
|
211
|
-
|
212
|
-
function
|
213
|
-
|
225
|
+
|
226
|
+
document.addEventListener('DOMContentLoaded', function() {
|
227
|
+
var dateFrom = flatpickr('.datePickerFrom', {
|
228
|
+
time_24hr: true,
|
214
229
|
dateFormat: Spree.translations.date_picker,
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
prevText: Spree.translations.previous,
|
220
|
-
nextText: Spree.translations.next,
|
221
|
-
showOn: 'focus',
|
222
|
-
showAnim: ''
|
230
|
+
monthSelectorType: 'static',
|
231
|
+
onChange: function(selectedDates) {
|
232
|
+
dateTo.set('minDate', selectedDates[0])
|
233
|
+
}
|
223
234
|
})
|
224
235
|
|
225
|
-
|
226
|
-
|
227
|
-
|
236
|
+
var dateTo = flatpickr('.datePickerTo', {
|
237
|
+
monthSelectorType: 'static',
|
238
|
+
time_24hr: true,
|
239
|
+
dateFormat: Spree.translations.date_picker,
|
240
|
+
onChange: function(selectedDates) {
|
241
|
+
dateFrom.set('maxDate', selectedDates[0])
|
242
|
+
}
|
228
243
|
})
|
229
|
-
|
230
|
-
|
244
|
+
|
245
|
+
flatpickr('.datepicker', {
|
246
|
+
monthSelectorType: 'static',
|
247
|
+
time_24hr: true,
|
248
|
+
dateFormat: Spree.translations.date_picker
|
231
249
|
})
|
232
|
-
}
|
250
|
+
})
|
233
251
|
|
234
|
-
$(document).ready(function(){
|
235
|
-
handle_date_picker_fields()
|
252
|
+
$(document).ready(function() {
|
236
253
|
$('.observe_field').on('change', function() {
|
237
254
|
target = $(this).data('update')
|
238
255
|
$(target).hide()
|
@@ -277,7 +294,10 @@ $(document).ready(function(){
|
|
277
294
|
_method: 'delete',
|
278
295
|
authenticity_token: AUTH_TOKEN
|
279
296
|
},
|
280
|
-
dataType: 'script'
|
297
|
+
dataType: 'script',
|
298
|
+
complete: function() {
|
299
|
+
el.blur()
|
300
|
+
}
|
281
301
|
}).done(function () {
|
282
302
|
var $flash_element = $('.alert-success')
|
283
303
|
if ($flash_element.length) {
|
@@ -288,6 +308,8 @@ $(document).ready(function(){
|
|
288
308
|
}).fail(function (response) {
|
289
309
|
show_flash('error', response.responseText)
|
290
310
|
})
|
311
|
+
} else {
|
312
|
+
el.blur()
|
291
313
|
}
|
292
314
|
return false
|
293
315
|
})
|
@@ -317,7 +339,7 @@ $(document).ready(function(){
|
|
317
339
|
return false
|
318
340
|
})
|
319
341
|
|
320
|
-
$('body').on('click', '.select_properties_from_prototype', function(){
|
342
|
+
$('body').on('click', '.select_properties_from_prototype', function() {
|
321
343
|
$('#busy_indicator').show()
|
322
344
|
var clicked_link = $(this)
|
323
345
|
$.ajax({
|
@@ -331,60 +353,47 @@ $(document).ready(function(){
|
|
331
353
|
return false
|
332
354
|
})
|
333
355
|
|
334
|
-
//
|
335
|
-
var
|
336
|
-
|
337
|
-
|
338
|
-
})
|
339
|
-
return ui
|
356
|
+
// Sortable List Up-Down
|
357
|
+
var parentEl = document.getElementsByClassName("sortable")[0];
|
358
|
+
if (parentEl) {
|
359
|
+
var element = parentEl.querySelector('tbody')
|
340
360
|
}
|
341
361
|
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
}
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
// Set correct height for placehoder (from dragged tr)
|
371
|
-
ui.placeholder.height(ui.item.height())
|
372
|
-
// Fix placeholder content to make it correct width
|
373
|
-
ui.placeholder.html("<td colspan='" + (tdCount - 1) + "'></td><td class='actions'></td>")
|
374
|
-
},
|
375
|
-
stop: function (event, ui) {
|
376
|
-
// Fix odd/even classes after reorder
|
377
|
-
$('table.sortable tr:even').removeClass('odd even').addClass('even')
|
378
|
-
$('table.sortable tr:odd').removeClass('odd even').addClass('odd')
|
379
|
-
}
|
380
|
-
|
381
|
-
})
|
382
|
-
})
|
362
|
+
if (element) {
|
363
|
+
Sortable.create(element, {
|
364
|
+
handle: '.move-handle',
|
365
|
+
animation: 550,
|
366
|
+
ghostClass: 'bg-light',
|
367
|
+
dragClass: "sortable-drag-v",
|
368
|
+
easing: 'cubic-bezier(1, 0, 0, 1)',
|
369
|
+
swapThreshold: 0.9,
|
370
|
+
forceFallback: true,
|
371
|
+
onEnd: function (evt) {
|
372
|
+
var itemEl = evt.item
|
373
|
+
var positions = { authenticity_token: AUTH_TOKEN }
|
374
|
+
$.each($('tr', element), function(position, obj) {
|
375
|
+
reg = /spree_(\w+_?)+_(\d+)/
|
376
|
+
parts = reg.exec($(obj).prop('id'))
|
377
|
+
if (parts) {
|
378
|
+
positions['positions[' + parts[2] + ']'] = position + 1
|
379
|
+
}
|
380
|
+
})
|
381
|
+
$.ajax({
|
382
|
+
type: 'POST',
|
383
|
+
dataType: 'json',
|
384
|
+
url: $(itemEl).closest('table.sortable').data('sortable-link'),
|
385
|
+
data: positions
|
386
|
+
})
|
387
|
+
}
|
388
|
+
})
|
389
|
+
}
|
383
390
|
|
391
|
+
// Close notifications
|
384
392
|
$('a.dismiss').click(function () {
|
385
393
|
$(this).parent().fadeOut()
|
386
394
|
})
|
387
395
|
|
396
|
+
// Utility
|
388
397
|
window.Spree.advanceOrder = function() {
|
389
398
|
$.ajax({
|
390
399
|
type: 'PUT',
|
@@ -59,6 +59,7 @@ $(document).ready(function () {
|
|
59
59
|
if (billAddress) {
|
60
60
|
$('#order_bill_address_attributes_firstname').val(billAddress.firstname)
|
61
61
|
$('#order_bill_address_attributes_lastname').val(billAddress.lastname)
|
62
|
+
$('#order_bill_address_attributes_company').val(billAddress.company)
|
62
63
|
$('#order_bill_address_attributes_address1').val(billAddress.address1)
|
63
64
|
$('#order_bill_address_attributes_address2').val(billAddress.address2)
|
64
65
|
$('#order_bill_address_attributes_city').val(billAddress.city)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/* global flatpickr */
|
2
|
+
document.addEventListener('DOMContentLoaded', function() {
|
3
|
+
flatpickr.l10ns.default.firstDayOfWeek = Spree.translations.firstDay
|
4
|
+
flatpickr.l10ns.default.rangeSeparator = Spree.translations.rangeSep
|
5
|
+
flatpickr.l10ns.default.weekAbbreviation = Spree.translations.weekAbbr
|
6
|
+
flatpickr.l10ns.default.scrollTitle = Spree.translations.scrollTitle
|
7
|
+
flatpickr.l10ns.default.toggleTitle = Spree.translations.toggleTitle
|
8
|
+
flatpickr.l10ns.default.amPM = [Spree.translations.am, Spree.translations.pm]
|
9
|
+
flatpickr.l10ns.default.yearAriaLabel = Spree.translations.yearAriaLabel
|
10
|
+
flatpickr.l10ns.default.hourAriaLabel = Spree.translations.hourAriaLabel
|
11
|
+
flatpickr.l10ns.default.minuteAriaLabel = Spree.translations.minuteAriaLabel
|
12
|
+
flatpickr.l10ns.default.weekdays = {
|
13
|
+
shorthand: [
|
14
|
+
Spree.translations.sun,
|
15
|
+
Spree.translations.mon,
|
16
|
+
Spree.translations.tue,
|
17
|
+
Spree.translations.wed,
|
18
|
+
Spree.translations.thu,
|
19
|
+
Spree.translations.fri,
|
20
|
+
Spree.translations.sat]
|
21
|
+
}
|
22
|
+
flatpickr.l10ns.default.months = {
|
23
|
+
longhand: [
|
24
|
+
Spree.translations.lh_jan,
|
25
|
+
Spree.translations.lh_feb,
|
26
|
+
Spree.translations.lh_mar,
|
27
|
+
Spree.translations.lh_apr,
|
28
|
+
Spree.translations.lh_may,
|
29
|
+
Spree.translations.lh_jun,
|
30
|
+
Spree.translations.lh_jul,
|
31
|
+
Spree.translations.lh_aug,
|
32
|
+
Spree.translations.lh_sep,
|
33
|
+
Spree.translations.lh_oct,
|
34
|
+
Spree.translations.lh_nov,
|
35
|
+
Spree.translations.lh_dec]
|
36
|
+
}
|
37
|
+
})
|