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
@@ -15,6 +15,9 @@ module Spree
|
|
15
15
|
# Example:
|
16
16
|
# # Link to /admin/orders, also highlight tab for ProductsController and ShipmentsController
|
17
17
|
# tab :orders, :products, :shipments
|
18
|
+
|
19
|
+
ICON_SIZE = 16
|
20
|
+
|
18
21
|
def tab(*args)
|
19
22
|
options = { label: args.first.to_s }
|
20
23
|
|
@@ -48,7 +51,7 @@ module Spree
|
|
48
51
|
link_to(
|
49
52
|
titleized_label,
|
50
53
|
destination_url,
|
51
|
-
class: "sidebar-submenu-item w-100 py-1
|
54
|
+
class: "sidebar-submenu-item w-100 py-2 py-md-1 pl-3 d-block #{'text-success' if selected}"
|
52
55
|
)
|
53
56
|
end
|
54
57
|
|
@@ -61,9 +64,15 @@ module Spree
|
|
61
64
|
# Single main menu item
|
62
65
|
def main_menu_item(text, url: nil, icon: nil)
|
63
66
|
link_to url, 'data-toggle': 'collapse', class: 'd-flex w-100 p-3 position-relative align-items-center' do
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
+
if icon.ends_with?('.svg')
|
68
|
+
svg_icon(name: icon, classes: 'mr-2', width: ICON_SIZE, height: ICON_SIZE) +
|
69
|
+
content_tag(:span, " #{text}", class: 'text') +
|
70
|
+
svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))
|
71
|
+
else
|
72
|
+
content_tag(:span, nil, class: "icon icon-#{icon} mr-2") +
|
73
|
+
content_tag(:span, " #{text}", class: 'text') +
|
74
|
+
svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))
|
75
|
+
end
|
67
76
|
end
|
68
77
|
end
|
69
78
|
|
@@ -86,17 +95,17 @@ module Spree
|
|
86
95
|
end
|
87
96
|
else
|
88
97
|
per_page_default = Spree::Config.admin_orders_per_page
|
89
|
-
per_page_options = %w{
|
98
|
+
per_page_options = %w{25 50 75}
|
90
99
|
end
|
91
100
|
|
92
101
|
selected_option = params[:per_page].try(:to_i) || per_page_default
|
93
102
|
|
94
103
|
select_tag(:per_page,
|
95
104
|
options_for_select(per_page_options, selected_option),
|
96
|
-
class: "form-control
|
105
|
+
class: "w-auto form-control js-per-page-select per-page-selected-#{selected_option} custom-select")
|
97
106
|
end
|
98
107
|
|
99
|
-
# helper method to create proper url to apply per page
|
108
|
+
# helper method to create proper url to apply per page ing
|
100
109
|
# fixes https://github.com/spree/spree/issues/6888
|
101
110
|
def per_page_dropdown_params(args = nil)
|
102
111
|
args = params.permit!.to_h.clone
|
@@ -123,7 +132,7 @@ module Spree
|
|
123
132
|
options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
|
124
133
|
options[:class] = 'btn btn-primary btn-sm with-tip'
|
125
134
|
options[:method] = :post
|
126
|
-
options[:icon] =
|
135
|
+
options[:icon] = 'clone.svg'
|
127
136
|
button_link_to '', clone_object_url(resource), options
|
128
137
|
end
|
129
138
|
|
@@ -131,7 +140,7 @@ module Spree
|
|
131
140
|
options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
|
132
141
|
options[:class] = 'btn btn-warning btn-sm with-tip'
|
133
142
|
options[:method] = :post
|
134
|
-
options[:icon] =
|
143
|
+
options[:icon] = 'clone.svg'
|
135
144
|
button_link_to '', clone_admin_promotion_path(promotion), options
|
136
145
|
end
|
137
146
|
|
@@ -139,13 +148,13 @@ module Spree
|
|
139
148
|
url = options[:url] || edit_object_url(resource)
|
140
149
|
options[:data] = { action: 'edit' }
|
141
150
|
options[:class] = 'btn btn-primary btn-sm'
|
142
|
-
link_to_with_icon('edit', Spree.t(:edit), url, options)
|
151
|
+
link_to_with_icon('edit.svg', Spree.t(:edit), url, options)
|
143
152
|
end
|
144
153
|
|
145
154
|
def link_to_edit_url(url, options = {})
|
146
155
|
options[:data] = { action: 'edit' }
|
147
156
|
options[:class] = 'btn btn-primary btn-sm'
|
148
|
-
link_to_with_icon('edit', Spree.t(:edit), url, options)
|
157
|
+
link_to_with_icon('edit.svg', Spree.t(:edit), url, options)
|
149
158
|
end
|
150
159
|
|
151
160
|
def link_to_delete(resource, options = {})
|
@@ -153,7 +162,7 @@ module Spree
|
|
153
162
|
name = options[:name] || Spree.t(:delete)
|
154
163
|
options[:class] = 'btn btn-danger btn-sm delete-resource'
|
155
164
|
options[:data] = { confirm: Spree.t(:are_you_sure), action: 'remove' }
|
156
|
-
link_to_with_icon 'delete', name, url, options
|
165
|
+
link_to_with_icon 'delete.svg', name, url, options
|
157
166
|
end
|
158
167
|
|
159
168
|
def link_to_with_icon(icon_name, text, url, options = {})
|
@@ -162,20 +171,32 @@ module Spree
|
|
162
171
|
text = options[:no_text] ? '' : content_tag(:span, text, class: 'text')
|
163
172
|
options.delete(:no_text)
|
164
173
|
if icon_name
|
165
|
-
icon =
|
174
|
+
icon = if icon_name.ends_with?('.svg')
|
175
|
+
svg_icon(name: icon_name, classes: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}", width: ICON_SIZE, height: ICON_SIZE)
|
176
|
+
else
|
177
|
+
content_tag(:span, '', class: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}")
|
178
|
+
end
|
166
179
|
text = "#{icon} #{text}"
|
167
180
|
end
|
168
181
|
link_to(text.html_safe, url, options)
|
169
182
|
end
|
170
183
|
|
171
184
|
def spree_icon(icon_name)
|
172
|
-
icon_name
|
185
|
+
if icon_name.ends_with?('.svg')
|
186
|
+
icon_name ? svg_icon(name: icon_name, classes: icon_name, width: ICON_SIZE, height: ICON_SIZE) : ''
|
187
|
+
else
|
188
|
+
icon_name ? content_tag(:span, '', class: icon_name) : ''
|
189
|
+
end
|
173
190
|
end
|
174
191
|
|
175
192
|
# Override: Add disable_with option to prevent multiple request on consecutive clicks
|
176
193
|
def button(text, icon_name = nil, button_type = 'submit', options = {})
|
177
194
|
if icon_name
|
178
|
-
icon =
|
195
|
+
icon = if icon_name.ends_with?('.svg')
|
196
|
+
svg_icon(name: icon_name, classes: "icon icon-#{icon_name}", width: ICON_SIZE, height: ICON_SIZE)
|
197
|
+
else
|
198
|
+
content_tag(:span, '', class: "icon icon-#{icon_name}")
|
199
|
+
end
|
179
200
|
text = "#{icon} #{text}"
|
180
201
|
end
|
181
202
|
button_tag(
|
@@ -192,7 +213,7 @@ module Spree
|
|
192
213
|
if html_options[:method] &&
|
193
214
|
!html_options[:method].to_s.casecmp('get').zero? &&
|
194
215
|
!html_options[:remote]
|
195
|
-
form_tag(url, method: html_options.delete(:method)
|
216
|
+
form_tag(url, method: html_options.delete(:method)) do
|
196
217
|
button(text, html_options.delete(:icon), nil, html_options)
|
197
218
|
end
|
198
219
|
else
|
@@ -206,11 +227,15 @@ module Spree
|
|
206
227
|
html_options[:class] = html_options[:class] ? "btn #{html_options[:class]}" : 'btn btn-outline-secondary'
|
207
228
|
|
208
229
|
if html_options[:icon]
|
209
|
-
icon =
|
230
|
+
icon = if html_options[:icon].ends_with?('.svg')
|
231
|
+
svg_icon(name: html_options[:icon], classes: "icon icon-#{html_options[:icon]}", width: ICON_SIZE, height: ICON_SIZE)
|
232
|
+
else
|
233
|
+
content_tag(:span, '', class: "icon icon-#{html_options[:icon]}")
|
234
|
+
end
|
210
235
|
text = "#{icon} #{text}"
|
211
236
|
end
|
212
237
|
|
213
|
-
link_to(text.html_safe, url, html_options)
|
238
|
+
link_to(text.html_safe, url, html_options.except(:icon))
|
214
239
|
end
|
215
240
|
end
|
216
241
|
|
@@ -222,7 +247,7 @@ module Spree
|
|
222
247
|
options[:class] = 'sidebar-menu-item d-block w-100'
|
223
248
|
options[:class] << ' selected' if is_selected
|
224
249
|
content_tag(:li, options) do
|
225
|
-
link_to(link_text, url, class: "#{'text-success' if is_selected} py-1
|
250
|
+
link_to(link_text, url, class: "#{'text-success' if is_selected} sidebar-submenu-item w-100 py-2 py-md-1 pl-3 d-block")
|
226
251
|
end
|
227
252
|
end
|
228
253
|
|
@@ -235,6 +260,9 @@ module Spree
|
|
235
260
|
end
|
236
261
|
|
237
262
|
def main_sidebar_classes
|
263
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
264
|
+
Admin::NavigationsHelper#main_sidebar_classes is deprecated and will be removed in Spree 5.0.
|
265
|
+
DEPRECATION
|
238
266
|
if cookies['sidebar-minimized'] == 'true'
|
239
267
|
'col-3 col-md-2 sidebar'
|
240
268
|
else
|
@@ -243,6 +271,9 @@ module Spree
|
|
243
271
|
end
|
244
272
|
|
245
273
|
def wrapper_classes
|
274
|
+
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
275
|
+
Admin::NavigationsHelper#wrapper_classes is deprecated and will be removed in Spree 5.0.
|
276
|
+
DEPRECATION
|
246
277
|
'sidebar-minimized' if cookies['sidebar-minimized'] == 'true'
|
247
278
|
end
|
248
279
|
end
|
@@ -12,11 +12,11 @@ module Spree
|
|
12
12
|
label.capitalize,
|
13
13
|
[event, :admin, order],
|
14
14
|
method: :put,
|
15
|
-
icon: event.to_s,
|
15
|
+
icon: event.to_s + '.svg',
|
16
16
|
data: { confirm: Spree.t(:order_sure_want_to, event: label) }
|
17
17
|
)
|
18
18
|
end
|
19
|
-
safe_join(links, '
|
19
|
+
safe_join(links, ''.html_safe)
|
20
20
|
end
|
21
21
|
|
22
22
|
def line_item_shipment_price(line_item, quantity)
|
data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_first_page.html.erb
RENAMED
@@ -8,6 +8,6 @@
|
|
8
8
|
-%>
|
9
9
|
<% unless current_page.first? %>
|
10
10
|
<li class="first page-item">
|
11
|
-
<%= link_to_unless current_page.first?,
|
11
|
+
<%= link_to_unless current_page.first?, svg_icon(name: "double-chevron-left.svg", width: '13', height: '16', classes: 'spree-icon-arrow-left mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'First page' %>
|
12
12
|
</li>
|
13
13
|
<% end %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
per_page: number of items to fetch per page
|
6
6
|
remote: data-remote
|
7
7
|
-%>
|
8
|
-
<li class="page gap disabled page-item">
|
8
|
+
<li class="page gap disabled page-item d-none d-lg-flex">
|
9
9
|
<a href="#" onclick="return false;" class="page-link">
|
10
10
|
<%= raw(t 'views.pagination.truncate') %>
|
11
11
|
</a>
|
data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_last_page.html.erb
RENAMED
@@ -8,6 +8,6 @@
|
|
8
8
|
-%>
|
9
9
|
<% unless current_page.last? %>
|
10
10
|
<li class="last next page-item"><%# "next" class present for border styling in twitter bootstrap %>
|
11
|
-
<%= link_to_unless current_page.last?,
|
11
|
+
<%= link_to_unless current_page.last?, svg_icon(name: "double-chevron-right.svg", width: '13', height: '16', classes: 'spree-icon-arrow-right mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'Last page' %>
|
12
12
|
</li>
|
13
13
|
<% end %>
|
data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_next_page.html.erb
RENAMED
@@ -8,6 +8,6 @@
|
|
8
8
|
-%>
|
9
9
|
<% unless current_page.last? %>
|
10
10
|
<li class="next_page page-item">
|
11
|
-
<%= link_to_unless current_page.last?,
|
11
|
+
<%= link_to_unless current_page.last?, svg_icon(name: "chevron-right.svg", width: '13', height: '16', classes: 'spree-icon-arrow-right mb-0'), url, rel: 'next', remote: remote, class: 'page-link', 'aria-label': 'Next page' %>
|
12
12
|
</li>
|
13
13
|
<% end %>
|
File without changes
|
data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_paginator.html.erb
RENAMED
@@ -9,7 +9,7 @@
|
|
9
9
|
<% pagination_class ||= '' %>
|
10
10
|
|
11
11
|
<%= paginator.render do %>
|
12
|
-
<ul class="pagination
|
12
|
+
<ul class="pagination d-inline-flex <%= pagination_class %>">
|
13
13
|
<%= first_page_tag unless current_page.first? %>
|
14
14
|
<%= prev_page_tag unless current_page.first? %>
|
15
15
|
<% each_page do |page| %>
|
data/app/views/kaminari/{twitter-bootstrap-4 → admin-twitter-bootstrap-4}/_prev_page.html.erb
RENAMED
@@ -8,6 +8,6 @@
|
|
8
8
|
-%>
|
9
9
|
<% unless current_page.first? %>
|
10
10
|
<li class="prev page-item">
|
11
|
-
<%= link_to_unless current_page.first?,
|
11
|
+
<%= link_to_unless current_page.first?, svg_icon(name: "chevron-left.svg", width: '13', height: '16', classes: 'spree-icon-arrow-left mb-0'), url, rel: 'prev', remote: remote, class: 'page-link', 'aria-label': 'Previous page' %>
|
12
12
|
</li>
|
13
13
|
<% end %>
|
@@ -14,8 +14,8 @@
|
|
14
14
|
<%= adjustment.display_amount.to_html %>
|
15
15
|
</td>
|
16
16
|
<td class="text-center">
|
17
|
-
<span class="badge badge-<%= adjustment.state %>">
|
18
|
-
<%= adjustment.state %>
|
17
|
+
<span class="text-lowercase badge badge-<%= adjustment.state %>">
|
18
|
+
<%= Spree.t("state_machine_states.#{adjustment.state}") %>
|
19
19
|
</span>
|
20
20
|
</td>
|
21
21
|
<td class="actions actions-2 text-center">
|
@@ -1,22 +1,22 @@
|
|
1
1
|
<div class="card-header">
|
2
2
|
<h3 class="card-title mb-0 h5"><%= Spree.t(:order_adjustments) %></h3>
|
3
3
|
</div>
|
4
|
-
|
5
|
-
<table class="table table-bordered adjustments" data-hook="adjustments">
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
</table>
|
19
|
-
|
4
|
+
<div class="table-responsive">
|
5
|
+
<table class="table table-bordered adjustments" data-hook="adjustments">
|
6
|
+
<thead data-hook="adjustmment_head">
|
7
|
+
<tr>
|
8
|
+
<th><%= Spree.t(:adjustable) %></th>
|
9
|
+
<th><%= Spree.t(:description) %></th>
|
10
|
+
<th class="text-center"><%= Spree.t(:amount) %></th>
|
11
|
+
<th class="text-center"><%= Spree.t(:status) %></th>
|
12
|
+
<th class="actions"></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<%= render partial: "adjustment", collection: @adjustments %>
|
17
|
+
</tbody>
|
18
|
+
</table>
|
19
|
+
</div>
|
20
20
|
<% if can?(:edit, Spree::Adjustment) %>
|
21
21
|
<div class="card-footer">
|
22
22
|
<div class="row text-center pb-0">
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<%= render partial: 'form', locals: { f: f } %>
|
12
12
|
|
13
13
|
<div class="form-actions" data-hook="buttons">
|
14
|
-
<%= button Spree.t(:continue), 'save' %>
|
14
|
+
<%= button Spree.t(:continue), 'save.svg' %>
|
15
15
|
<span class="or"><%= Spree.t(:or) %></span>
|
16
|
-
<%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: '
|
16
|
+
<%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: 'cancel.svg' %>
|
17
17
|
</div>
|
18
18
|
</fieldset>
|
19
19
|
<% end %>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments} %>
|
2
2
|
|
3
3
|
<% content_for :page_title do %>
|
4
|
-
/ <%=
|
4
|
+
/ <%= Spree.t(:adjustments) %>
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<% content_for :page_actions do %>
|
8
|
-
<%= button_link_to(Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), class: "btn-success", icon: 'add') if can? :create, Spree::Adjustment %>
|
8
|
+
<%= button_link_to(Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), class: "btn-success", icon: 'add.svg') if can? :create, Spree::Adjustment %>
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<% if @adjustments.present? %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div class="form-group">
|
25
25
|
<%= text_field_tag "coupon_code", "", placeholder: Spree.t(:coupon_code), class: "form-control" %>
|
26
26
|
</div>
|
27
|
-
<%= button Spree.t(:add_coupon_code), '
|
27
|
+
<%= button Spree.t(:add_coupon_code), 'add.svg', 'submit', id: "add_coupon_code" %>
|
28
28
|
</div>
|
29
29
|
</div>
|
30
30
|
<% end %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<div class="form-actions" data-hook="buttons">
|
14
14
|
<%= button Spree.t(:continue), 'save' %>
|
15
15
|
<span class="or"><%= Spree.t(:or) %></span>
|
16
|
-
<%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: '
|
16
|
+
<%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: 'cancel' %>
|
17
17
|
</div>
|
18
18
|
</fieldset>
|
19
19
|
<% end %>
|
@@ -24,9 +24,14 @@
|
|
24
24
|
<% end %>
|
25
25
|
|
26
26
|
<div data-hook="states_required" class="form-group checkbox">
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
<%= f.check_box :states_required %>
|
28
|
+
<%= f.label :states_required, Spree.t(:states_required) %>
|
29
|
+
<%= f.error_message_on :states_required %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div data-hook="zipcode_required" class="form-group checkbox">
|
33
|
+
<%= f.check_box :zipcode_required %>
|
34
|
+
<%= f.label :zipcode_required, Spree.t(:zipcode_required) %>
|
35
|
+
<%= f.error_message_on :zipcode_required %>
|
31
36
|
</div>
|
32
37
|
</div>
|
@@ -3,29 +3,32 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
|
-
<%= button_link_to Spree.t(:new_country), new_object_url, { class: "btn-success", icon: 'add', id: 'admin_new_country' } %>
|
6
|
+
<%= button_link_to Spree.t(:new_country), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'admin_new_country' } %>
|
7
7
|
<% end if can? :create, Spree::Country %>
|
8
|
-
|
9
|
-
<table class="table" id='listing_countries' data-hook>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
</thead>
|
18
|
-
<tbody>
|
19
|
-
<% @countries.each do |country| %>
|
20
|
-
<tr id="<%= spree_dom_id country %>" data-hook="country_row">
|
21
|
-
<td><%= country.name %></td>
|
22
|
-
<td><%= country.iso_name %></td>
|
23
|
-
<td class="text-center"><%= country.states_required? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
24
|
-
<td class="actions actions-2 text-right">
|
25
|
-
<%= link_to_edit(country, no_text: true) if can? :edit, country %>
|
26
|
-
<%= link_to_delete(country, no_text: true) if can? :delete, country %>
|
27
|
-
</td>
|
8
|
+
<div class="table-responsive">
|
9
|
+
<table class="table" id='listing_countries' data-hook>
|
10
|
+
<thead>
|
11
|
+
<tr data-hook="tax_header">
|
12
|
+
<th><%= Spree.t(:country_name) %></th>
|
13
|
+
<th><%= Spree.t(:iso3) %></th>
|
14
|
+
<th><%= Spree.t(:states_required) %></th>
|
15
|
+
<th><%= Spree.t(:zipcode_required) %></th>
|
16
|
+
<th class="actions"></th>
|
28
17
|
</tr>
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<% @countries.each do |country| %>
|
21
|
+
<tr id="<%= spree_dom_id country %>" data-hook="country_row">
|
22
|
+
<td><%= country.name %></td>
|
23
|
+
<td><%= country.iso3 %></td>
|
24
|
+
<td class="text-center"><%= country.states_required? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
25
|
+
<td class="text-center"><%= country.zipcode_required? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
26
|
+
<td class="actions actions-2 text-right">
|
27
|
+
<%= link_to_edit(country, no_text: true) if can? :edit, country %>
|
28
|
+
<%= link_to_delete(country, no_text: true) if can? :delete, country %>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
34
|
+
</div>
|
@@ -1,36 +1,38 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</thead>
|
11
|
-
<tbody>
|
12
|
-
<% reimbursements.each do |reimbursement| %>
|
13
|
-
<tr id="<%= spree_dom_id(reimbursement) %>" data-hook="reimbursement_row">
|
14
|
-
<td>
|
15
|
-
<% if reimbursement.reimbursed? %>
|
16
|
-
<%= link_to reimbursement.number, url_for([:admin, @order, reimbursement]) %>
|
17
|
-
<% else %>
|
18
|
-
<%= reimbursement.number %>
|
19
|
-
<% end %>
|
20
|
-
</td>
|
21
|
-
<td><%= reimbursement.display_total %></td>
|
22
|
-
<td>
|
23
|
-
<span class="state <%= reimbursement_status_color(reimbursement) %>">
|
24
|
-
<%= reimbursement.reimbursement_status %>
|
25
|
-
</span>
|
26
|
-
</td>
|
27
|
-
<td><%= pretty_time(reimbursement.created_at) %></td>
|
28
|
-
<td class="actions actions-1">
|
29
|
-
<% if !reimbursement.reimbursed? %>
|
30
|
-
<%= link_to_edit_url(url_for([:edit, :admin, @order, reimbursement]), title: "admin_edit_#{dom_id(reimbursement)}", no_text: true) if can?(:edit, reimbursement) %>
|
31
|
-
<% end %>
|
32
|
-
</td>
|
1
|
+
<div class="table-responsive">
|
2
|
+
<table class="table table-condensed table-bordered">
|
3
|
+
<thead data-hook="customer_return_header">
|
4
|
+
<tr>
|
5
|
+
<th><%= Spree.t(:number) %></th>
|
6
|
+
<th><%= Spree.t(:total) %></th>
|
7
|
+
<th><%= Spree.t(:status) %></th>
|
8
|
+
<th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
|
9
|
+
<th></th>
|
33
10
|
</tr>
|
34
|
-
|
35
|
-
|
36
|
-
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% reimbursements.each do |reimbursement| %>
|
14
|
+
<tr id="<%= spree_dom_id(reimbursement) %>" data-hook="reimbursement_row">
|
15
|
+
<td>
|
16
|
+
<% if reimbursement.reimbursed? %>
|
17
|
+
<%= link_to reimbursement.number, url_for([:admin, @order, reimbursement]) %>
|
18
|
+
<% else %>
|
19
|
+
<%= reimbursement.number %>
|
20
|
+
<% end %>
|
21
|
+
</td>
|
22
|
+
<td><%= reimbursement.display_total %></td>
|
23
|
+
<td>
|
24
|
+
<span class="state <%= reimbursement_status_color(reimbursement) %>">
|
25
|
+
<%= reimbursement.reimbursement_status %>
|
26
|
+
</span>
|
27
|
+
</td>
|
28
|
+
<td><%= pretty_time(reimbursement.created_at) %></td>
|
29
|
+
<td class="actions actions-1">
|
30
|
+
<% if !reimbursement.reimbursed? %>
|
31
|
+
<%= link_to_edit_url(url_for([:edit, :admin, @order, reimbursement]), title: "admin_edit_#{dom_id(reimbursement)}", no_text: true) if can?(:edit, reimbursement) %>
|
32
|
+
<% end %>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
</div>
|