spree_backend 4.1.13 → 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
@@ -2,10 +2,19 @@
|
|
2
2
|
padding: 0 0 15px 0;
|
3
3
|
}
|
4
4
|
|
5
|
+
.card {
|
6
|
+
overflow: hidden;
|
7
|
+
}
|
8
|
+
|
5
9
|
.is-hidden {
|
6
10
|
display: none;
|
7
11
|
}
|
8
12
|
|
13
|
+
.tooltip{
|
14
|
+
pointer-events: none;
|
15
|
+
z-index: $zindex-dropdown;
|
16
|
+
}
|
17
|
+
|
9
18
|
// No-margin and no-padding helper classes
|
10
19
|
@each $side in top bottom left right {
|
11
20
|
.no-margin-#{$side} { margin-#{side}: 0; }
|
@@ -15,3 +24,34 @@
|
|
15
24
|
.alert-error {
|
16
25
|
@extend .alert-danger;
|
17
26
|
}
|
27
|
+
|
28
|
+
.js-remove-promo-rule-option-value {
|
29
|
+
color: $primary !important;
|
30
|
+
&:hover {
|
31
|
+
color: darken($primary, 10) !important;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.flash-alert {
|
36
|
+
z-index: 0;
|
37
|
+
opacity: 0;
|
38
|
+
bottom: -50px;
|
39
|
+
left:0;
|
40
|
+
right:0;
|
41
|
+
|
42
|
+
.alert {
|
43
|
+
z-index: 500;
|
44
|
+
opacity: 0.98;
|
45
|
+
border-width: 3px;
|
46
|
+
margin-bottom: 0;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
.flash-alert.animate__animated {
|
51
|
+
opacity: 1;
|
52
|
+
bottom: 30px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.resize-animation-stopper * {
|
56
|
+
transition: none !important;
|
57
|
+
}
|
@@ -24,3 +24,41 @@ span.or {
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
}
|
27
|
+
|
28
|
+
// Hide number toggler
|
29
|
+
// Chrome, Safari, Edge, Opera
|
30
|
+
input.hide-number-toggle::-webkit-outer-spin-button,
|
31
|
+
input.hide-number-toggle::-webkit-inner-spin-button {
|
32
|
+
-webkit-appearance: none;
|
33
|
+
margin: 0;
|
34
|
+
}
|
35
|
+
// Firefox
|
36
|
+
input[type=number].hide-number-toggle {
|
37
|
+
-moz-appearance: textfield;
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
// Remove the default 5px outlines and box-shadows
|
42
|
+
// from all inputs on focus.
|
43
|
+
.form-control:focus {
|
44
|
+
box-shadow: none !important;
|
45
|
+
}
|
46
|
+
|
47
|
+
*:focus {
|
48
|
+
outline: none;
|
49
|
+
}
|
50
|
+
|
51
|
+
:-webkit-direct-focus {
|
52
|
+
outline-color: transparent;
|
53
|
+
outline-style: auto;
|
54
|
+
outline-width: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
.custom-select {
|
58
|
+
background: $input-bg url(asset-path("backend-chevron-down.svg")) no-repeat right 0.5rem center/8px 10px;
|
59
|
+
background-size: 0.7em;
|
60
|
+
&:focus{
|
61
|
+
outline: none;
|
62
|
+
box-shadow: none;
|
63
|
+
}
|
64
|
+
}
|
@@ -20,6 +20,11 @@
|
|
20
20
|
|
21
21
|
@import 'plugins/select2';
|
22
22
|
@import 'plugins/jquery_ui';
|
23
|
+
@import 'plugins/flatpickr';
|
23
24
|
|
24
25
|
@import 'shared/base';
|
25
26
|
@import 'shared/forms';
|
27
|
+
|
28
|
+
@import 'views/order_payments';
|
29
|
+
@import 'views/product_properties';
|
30
|
+
@import 'views/prototypes';
|
@@ -0,0 +1,42 @@
|
|
1
|
+
$color_size: 26px;
|
2
|
+
|
3
|
+
.product-prototype-options {
|
4
|
+
.option-type-values {
|
5
|
+
&__color {
|
6
|
+
display: flex;
|
7
|
+
flex-wrap: wrap;
|
8
|
+
align-items: center;
|
9
|
+
max-width: 350px;
|
10
|
+
input {
|
11
|
+
display: none;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
li {
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
margin: 0.25rem;
|
18
|
+
input {
|
19
|
+
margin-right: 0.5rem;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
.option-value__color {
|
24
|
+
border-radius: 50%;
|
25
|
+
border: 2px solid #d3d3d3;
|
26
|
+
width: $color_size;
|
27
|
+
height: $color_size;
|
28
|
+
overflow: hidden;
|
29
|
+
padding: 1px;
|
30
|
+
&:after {
|
31
|
+
content: '';
|
32
|
+
display: inline-block;
|
33
|
+
width: 100%;
|
34
|
+
height: 100%;
|
35
|
+
background-color: var(--presentation);
|
36
|
+
border-radius: 50%;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
input:checked + .option-value__color {
|
40
|
+
border-color: #565656;
|
41
|
+
}
|
42
|
+
}
|
@@ -3,6 +3,8 @@ module Spree
|
|
3
3
|
class GeneralSettingsController < Spree::Admin::BaseController
|
4
4
|
include Spree::Backend::Callbacks
|
5
5
|
|
6
|
+
before_action :update_currency_settings, only: :update
|
7
|
+
|
6
8
|
def edit
|
7
9
|
@preferences_security = []
|
8
10
|
end
|
@@ -23,6 +25,31 @@ module Spree
|
|
23
25
|
invoke_callbacks(:clear_cache, :after)
|
24
26
|
head :no_content
|
25
27
|
end
|
28
|
+
|
29
|
+
def render(*args)
|
30
|
+
@preferences_currency |= [:allow_currency_change, :show_currency_selector]
|
31
|
+
super
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def update_currency_settings
|
37
|
+
params.each do |name, value|
|
38
|
+
next unless Spree::Config.has_preference?(name) && name.eql?('supported_currencies')
|
39
|
+
|
40
|
+
value = update_value(value)
|
41
|
+
Spree::Config[name] = value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def update_value(value)
|
46
|
+
value.split(',').
|
47
|
+
map { |curr| ::Money::Currency.find(curr.strip).try(:iso_code) }.
|
48
|
+
concat([Spree::Config[:currency]]).
|
49
|
+
uniq.
|
50
|
+
compact.
|
51
|
+
join(',')
|
52
|
+
end
|
26
53
|
end
|
27
54
|
end
|
28
55
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class PricesController < ResourceController
|
4
|
+
belongs_to 'spree/product', find_by: :slug
|
5
|
+
|
6
|
+
helper_method :supported_currencies_for_all_stores
|
7
|
+
|
8
|
+
def create
|
9
|
+
params.require(:vp).permit!
|
10
|
+
params[:vp].each do |variant_id, prices|
|
11
|
+
next unless variant_id
|
12
|
+
|
13
|
+
variant = Spree::Variant.find(variant_id)
|
14
|
+
next unless variant
|
15
|
+
|
16
|
+
supported_currencies_for_all_stores.each do |currency|
|
17
|
+
price = variant.price_in(currency.iso_code)
|
18
|
+
price.price = (prices[currency.iso_code]['price'].blank? ? nil : prices[currency.iso_code]['price'])
|
19
|
+
price.compare_at_price = (prices[currency.iso_code]['compare_at_price'].blank? ? nil : prices[currency.iso_code]['compare_at_price'])
|
20
|
+
price.save! if price.new_record? && price.price || !price.new_record? && price.changed?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
flash[:success] = Spree.t('notice_messages.prices_saved')
|
24
|
+
redirect_to admin_product_path(parent)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def supported_currencies_for_all_stores
|
30
|
+
@supported_currencies_for_all_stores = begin
|
31
|
+
(
|
32
|
+
Spree::Store.pluck(:supported_currencies).map { |c| c&.split(',') }.flatten + Spree::Store.pluck(:default_currency)
|
33
|
+
).
|
34
|
+
compact.uniq.map { |code| ::Money::Currency.find(code.strip) }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -20,7 +20,10 @@ module Spree
|
|
20
20
|
|
21
21
|
def create
|
22
22
|
if params[:variant].nil?
|
23
|
-
flash[:error] = Spree.t('stock_transfer.errors.must_have_variant')
|
23
|
+
flash.now[:error] = Spree.t('stock_transfer.errors.must_have_variant')
|
24
|
+
render :new
|
25
|
+
elsif any_missing_variants?(params[:variant])
|
26
|
+
flash.now[:error] = Spree.t('stock_transfer.errors.variants_unavailable', stock: source_location.name)
|
24
27
|
render :new
|
25
28
|
else
|
26
29
|
variants = Hash.new(0)
|
@@ -51,6 +54,10 @@ module Spree
|
|
51
54
|
def destination_location
|
52
55
|
@destination_location ||= StockLocation.find(params[:transfer_destination_location_id])
|
53
56
|
end
|
57
|
+
|
58
|
+
def any_missing_variants?(variant_ids)
|
59
|
+
source_location&.stock_items&.where(variant_id: variant_ids, count_on_hand: 0)&.any?
|
60
|
+
end
|
54
61
|
end
|
55
62
|
end
|
56
63
|
end
|
@@ -3,9 +3,43 @@ module Spree
|
|
3
3
|
class StoresController < Spree::Admin::BaseController
|
4
4
|
before_action :load_store, only: [:new, :edit, :update]
|
5
5
|
before_action :set_default_currency, only: :new
|
6
|
+
before_action :set_default_locale, only: :new
|
7
|
+
before_action :normalize_supported_currencies, only: [:create, :update]
|
8
|
+
before_action :set_default_country_id, only: :new
|
9
|
+
before_action :load_all_countries, only: [:new, :edit, :update, :create]
|
10
|
+
|
11
|
+
if defined?(SpreeI18n)
|
12
|
+
include SpreeI18n::LocaleHelper
|
13
|
+
end
|
14
|
+
|
15
|
+
helper_method :all_locales_options
|
6
16
|
|
7
17
|
def index
|
8
|
-
|
18
|
+
if params[:ids]
|
19
|
+
load_stores_by_ids
|
20
|
+
elsif params[:q]
|
21
|
+
load_stores_by_query
|
22
|
+
else
|
23
|
+
@stores = Spree::Store.all
|
24
|
+
end
|
25
|
+
|
26
|
+
respond_with(@stores) do |format|
|
27
|
+
format.json { render layout: false }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def load_stores_by_ids
|
32
|
+
ids = params[:ids].split(',')
|
33
|
+
@stores = Spree::Store.where(id: ids)
|
34
|
+
end
|
35
|
+
|
36
|
+
def load_stores_by_query
|
37
|
+
@stores = if defined?(SpreeGlobalize)
|
38
|
+
Spree::Store.joins(:translations).where("LOWER(#{Store::Translation.table_name}.name) LIKE LOWER(:query)",
|
39
|
+
query: "%#{params[:q]}%")
|
40
|
+
else
|
41
|
+
Spree::Store.where('LOWER(name) LIKE LOWER(:query)', query: "%#{params[:q]}%")
|
42
|
+
end
|
9
43
|
end
|
10
44
|
|
11
45
|
def create
|
@@ -76,9 +110,35 @@ module Spree
|
|
76
110
|
@store = Spree::Store.find_by(id: params[:id]) || Spree::Store.new
|
77
111
|
end
|
78
112
|
|
113
|
+
def load_all_countries
|
114
|
+
@countries = Spree::Country.all
|
115
|
+
end
|
116
|
+
|
79
117
|
def set_default_currency
|
80
118
|
@store.default_currency = Spree::Config[:currency]
|
81
119
|
end
|
120
|
+
|
121
|
+
def set_default_locale
|
122
|
+
@store.default_locale = I18n.locale
|
123
|
+
end
|
124
|
+
|
125
|
+
def normalize_supported_currencies
|
126
|
+
if params[:store][:supported_currencies]&.is_a?(Array)
|
127
|
+
params[:store][:supported_currencies] = params[:store][:supported_currencies].compact.uniq.reject(&:blank?).join(',')
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def set_default_country_id
|
132
|
+
@store.default_country_id = Spree::Config[:default_country_id]
|
133
|
+
end
|
134
|
+
|
135
|
+
# this method is overriten by spree_i18n to add support for more locales
|
136
|
+
# in https://github.com/spree-contrib/spree_i18n/blob/master/app/helpers/spree_i18n/locale_helper.rb#L17
|
137
|
+
unless defined?(SpreeI18n)
|
138
|
+
def all_locales_options
|
139
|
+
[['English (EN)', :en]]
|
140
|
+
end
|
141
|
+
end
|
82
142
|
end
|
83
143
|
end
|
84
144
|
end
|
@@ -77,7 +77,11 @@ module Spree
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def load_taxonomy
|
80
|
-
@taxonomy =
|
80
|
+
@taxonomy = if defined?(SpreeGlobalize)
|
81
|
+
Taxonomy.includes(:translations, taxons: [:translations]).find(params[:taxonomy_id])
|
82
|
+
else
|
83
|
+
Taxonomy.find(params[:taxonomy_id])
|
84
|
+
end
|
81
85
|
end
|
82
86
|
|
83
87
|
def set_position
|
@@ -3,15 +3,13 @@ module Spree
|
|
3
3
|
module BaseHelper
|
4
4
|
def flash_alert(flash)
|
5
5
|
if flash.present?
|
6
|
-
close_button = button_tag(class: 'close', 'data-dismiss' => 'alert', 'aria-label' => Spree.t(:close)) do
|
7
|
-
content_tag('span', '×'.html_safe, 'aria-hidden' => true)
|
8
|
-
end
|
9
6
|
message = flash[:error] || flash[:notice] || flash[:success]
|
10
7
|
flash_class = 'danger' if flash[:error]
|
11
8
|
flash_class = 'info' if flash[:notice]
|
12
9
|
flash_class = 'success' if flash[:success]
|
13
|
-
flash_div = content_tag(:div,
|
14
|
-
content_tag(:div, flash_div,
|
10
|
+
flash_div = content_tag(:div, message, class: "alert alert-#{flash_class} mx-2")
|
11
|
+
content_tag(:div, flash_div,
|
12
|
+
class: 'd-flex justify-content-center position-fixed flash-alert ')
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
@@ -37,6 +35,15 @@ module Spree
|
|
37
35
|
end
|
38
36
|
end
|
39
37
|
|
38
|
+
def svg_icon(name:, classes: '', width:, height:)
|
39
|
+
if name.ends_with?('.svg')
|
40
|
+
icon_name = File.basename(name, File.extname(name))
|
41
|
+
inline_svg_tag "backend-#{icon_name}.svg", class: "icon-#{icon_name} #{classes}", size: "#{width}px*#{height}px"
|
42
|
+
else
|
43
|
+
inline_svg_tag "backend-#{name}.svg", class: "icon-#{name} #{classes}", size: "#{width}px*#{height}px"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
40
47
|
def datepicker_field_value(date)
|
41
48
|
unless date.blank?
|
42
49
|
l(date, format: Spree.t('date_picker.format', default: '%Y/%m/%d'))
|
@@ -130,7 +137,7 @@ module Spree
|
|
130
137
|
# renders hidden field and link to remove record using nested_attributes
|
131
138
|
def link_to_icon_remove_fields(form)
|
132
139
|
url = form.object.persisted? ? [:admin, form.object] : '#'
|
133
|
-
link_to_with_icon('delete', '', url,
|
140
|
+
link_to_with_icon('delete.svg', '', url,
|
134
141
|
class: 'spree_remove_fields btn btn-sm btn-danger',
|
135
142
|
data: {
|
136
143
|
action: 'remove'
|
@@ -152,7 +159,7 @@ module Spree
|
|
152
159
|
def order_time(time)
|
153
160
|
return '' if time.blank?
|
154
161
|
|
155
|
-
[I18n.l(time.to_date), time.strftime('%l:%M %p').strip].join(' ')
|
162
|
+
[I18n.l(time.to_date), time.strftime('%l:%M %p %Z').strip].join(' ')
|
156
163
|
end
|
157
164
|
|
158
165
|
def required_span_tag
|
@@ -165,7 +172,17 @@ module Spree
|
|
165
172
|
button_link_to(
|
166
173
|
Spree.t(:preview_product),
|
167
174
|
spree.product_url(product),
|
168
|
-
class: 'btn-outline-secondary', icon: '
|
175
|
+
class: 'btn-outline-secondary', icon: 'view.svg', id: 'admin_preview_product', target: :blank
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
179
|
+
def taxon_preview_link(taxon)
|
180
|
+
return unless frontend_available?
|
181
|
+
|
182
|
+
button_link_to(
|
183
|
+
Spree.t(:preview_taxon),
|
184
|
+
seo_url(taxon),
|
185
|
+
class: 'btn-outline-secondary', icon: 'view.svg', id: 'admin_preview_taxon', target: :blank
|
169
186
|
)
|
170
187
|
end
|
171
188
|
end
|