From b02b36b8e83dcbab8fe86bede4f38c447a3d471f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 11 Jan 2021 11:18:34 +0100 Subject: [PATCH] replace code by reusable component --- app/views/admin/customers/index.html.haml | 2 +- app/views/admin/enterprises/_enterprise_user_index.html.haml | 2 +- app/views/admin/order_cycles/_loading_flash.html.haml | 2 +- app/views/admin/subscriptions/_loading_flash.html.haml | 2 +- app/views/admin/variant_overrides/_loading_flash.html.haml | 2 +- app/views/registration/steps/_logo.html.haml | 2 +- app/views/registration/steps/_promo.html.haml | 2 +- app/views/shop/products/_form.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 2 +- app/views/spree/admin/orders/index.html.haml | 2 +- app/views/spree/admin/products/index/_indicators.html.haml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 2ee8bc16a3..456f439f6c 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -35,7 +35,7 @@ .row{ 'ng-if' => 'shop_id && RequestMonitor.loading' } .sixteen.columns.alpha#loading - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1 =t :loading_customers diff --git a/app/views/admin/enterprises/_enterprise_user_index.html.haml b/app/views/admin/enterprises/_enterprise_user_index.html.haml index eedfba8d34..a17baa3ba7 100644 --- a/app/views/admin/enterprises/_enterprise_user_index.html.haml +++ b/app/views/admin/enterprises/_enterprise_user_index.html.haml @@ -9,7 +9,7 @@ %columns-dropdown{ action: "#{controller_name}_#{action_name}" } .row{ 'ng-if' => '!loaded' } .sixteen.columns.alpha#loading - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1= t('.loading_enterprises') .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded && filteredEnterprises.length == 0'} %h1#no_results= t('.no_enterprises_found') diff --git a/app/views/admin/order_cycles/_loading_flash.html.haml b/app/views/admin/order_cycles/_loading_flash.html.haml index 05aff6b748..d7f1a5071a 100644 --- a/app/views/admin/order_cycles/_loading_flash.html.haml +++ b/app/views/admin/order_cycles/_loading_flash.html.haml @@ -1,5 +1,5 @@ %div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'RequestMonitor.loading' } } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1{ ng: { hide: 'orderCycles.length > 0' } } =t('.loading_order_cycles') %h1{ ng: { show: 'orderCycles.length > 0' } } diff --git a/app/views/admin/subscriptions/_loading_flash.html.haml b/app/views/admin/subscriptions/_loading_flash.html.haml index ab37f06a71..7d78d296dc 100644 --- a/app/views/admin/subscriptions/_loading_flash.html.haml +++ b/app/views/admin/subscriptions/_loading_flash.html.haml @@ -1,3 +1,3 @@ %div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'shop_id && RequestMonitor.loading' } } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1= t('.loading') diff --git a/app/views/admin/variant_overrides/_loading_flash.html.haml b/app/views/admin/variant_overrides/_loading_flash.html.haml index d9b2bf46bc..0e60423659 100644 --- a/app/views/admin/variant_overrides/_loading_flash.html.haml +++ b/app/views/admin/variant_overrides/_loading_flash.html.haml @@ -1,3 +1,3 @@ %div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'hub_id && products.length == 0 && RequestMonitor.loading' } } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1= t('.loading_inventory') diff --git a/app/views/registration/steps/_logo.html.haml b/app/views/registration/steps/_logo.html.haml index 4082defaec..4a01d5a0a4 100644 --- a/app/views/registration/steps/_logo.html.haml +++ b/app/views/registration/steps/_logo.html.haml @@ -41,6 +41,6 @@ .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } = t(".logo_placeholder") .loading{ ng: { hide: "!imageUploader.isUploading" } } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_promo.html.haml b/app/views/registration/steps/_promo.html.haml index efe29f6994..3934c12d48 100644 --- a/app/views/registration/steps/_promo.html.haml +++ b/app/views/registration/steps/_promo.html.haml @@ -39,6 +39,6 @@ .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } = t(".promo_image_placeholder") .loading{ ng: { hide: "!imageUploader.isUploading" } } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 9506cd4bcd..8b0ab92482 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -21,7 +21,7 @@ = t :products_loading .row.full .small-12.columns.text-center - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" .hide-for-medium-down.large-1.columns -# Space between products and filters diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 9949b4495c..06335b73ff 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -103,7 +103,7 @@ %columns-dropdown{ action: "#{controller_name}_#{action_name}" } %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1 = t("admin.orders.bulk_management.loading") diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index d2871fe540..a8c66a999d 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -93,7 +93,7 @@ .orders-loading{'ng-show' => 'RequestMonitor.loading'} .row .small-12.columns.fullwidth.text-center - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" .row .small-12.columns.fullwidth.text-center %span= t('.loading') diff --git a/app/views/spree/admin/products/index/_indicators.html.haml b/app/views/spree/admin/products/index/_indicators.html.haml index 9c002b1f1f..ad7e67bbe5 100644 --- a/app/views/spree/admin/products/index/_indicators.html.haml +++ b/app/views/spree/admin/products/index/_indicators.html.haml @@ -1,6 +1,6 @@ %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } %br - %img.spinner{ src: image_path("spinning-circles.svg") } + = render partial: "components/loading" %h1= t('.title') %div.sixteen.columns.alpha{ 'ng-show' => '!RequestMonitor.loading && products.length == 0 && q.query.length == 0' }