diff --git a/app/assets/javascripts/admin_minimal.js b/app/assets/javascripts/admin_minimal.js new file mode 100644 index 0000000000..d438957f34 --- /dev/null +++ b/app/assets/javascripts/admin_minimal.js @@ -0,0 +1,44 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// + +//= require jquery2 +//= require admin/spree/spree-select2 +//= require admin/spree/handlebar_extensions + +//= require i18n/translations +//= require darkswarm/i18n.translate.js +//= require moment/min/moment.min.js +//= require moment/locale/ar.js +//= require moment/locale/ca.js +//= require moment/locale/de.js +//= require moment/locale/en-gb.js +//= require moment/locale/es.js +//= require moment/locale/fil.js +//= require moment/locale/fr.js +//= require moment/locale/it.js +//= require moment/locale/nb.js +//= require moment/locale/nl-be.js +//= require moment/locale/pt-br.js +//= require moment/locale/pt.js +//= require moment/locale/ru.js +//= require moment/locale/sv.js +//= require moment/locale/tr.js +//= require moment/locale/pl.js + +//= require js-big-decimal/dist/web/js-big-decimal.min.js + +window.angular = { module: function(noop){ return { value: function(){} } } } + +document.addEventListener("ajax:beforeSend", (event) => { + window.Turbo.navigator.adapter.progressBar.setValue(0) + window.Turbo.navigator.adapter.progressBar.show() +}) + +document.addEventListener("ajax:complete", (event) => { + window.Turbo.navigator.adapter.progressBar.setValue(100) + window.Turbo.navigator.adapter.progressBar.hide() +}) \ No newline at end of file diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 33224c8957..5c55106a03 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -1,6 +1,8 @@ - content_for :page_title do = t('.listing_orders') +- content_for :minimal_js, true + - content_for :page_actions do %li = button_link_to t('.new_order'), spree.new_admin_order_url, icon: 'icon-plus', id: 'admin_new_order' @@ -42,7 +44,7 @@ %div.menu_item %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "cancel_orders" } = t('.cancel_orders') - + = render partial: 'admin/shared/angular_per_page_controls', locals: { position: "right", model: "orders" } %table#listing_orders.index.responsive{width: "100%", 'ng-init' => 'initialise()', 'ng-show' => "!RequestMonitor.loading && orders.length > 0" } diff --git a/app/views/spree/admin/shared/_head.html.haml b/app/views/spree/admin/shared/_head.html.haml index 238052154e..ec9ea94fb5 100644 --- a/app/views/spree/admin/shared/_head.html.haml +++ b/app/views/spree/admin/shared/_head.html.haml @@ -3,8 +3,6 @@ = csrf_meta_tags = action_cable_meta_tag -= action_cable_meta_tag - %title - if content_for? :html_title = yield :html_title @@ -16,7 +14,11 @@ = stylesheet_pack_tag 'admin-styles', media: "screen, print" = render "layouts/bugsnag_js" -= javascript_include_tag 'admin/all' + +- if content_for? :minimal_js + = javascript_include_tag 'admin_minimal' +- else + = javascript_include_tag 'admin/all' = render "spree/admin/shared/translations" = render "spree/admin/shared/routes" diff --git a/app/views/spree/admin/shared/_translations.html.erb b/app/views/spree/admin/shared/_translations.html.erb index 97eae43d00..96183fd864 100644 --- a/app/views/spree/admin/shared/_translations.html.erb +++ b/app/views/spree/admin/shared/_translations.html.erb @@ -1,4 +1,7 @@