From add38bf550d46385c4f7657fc25875fa84818274 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 16 Jun 2020 18:24:03 +0200 Subject: [PATCH] Use #image_path helper correctly Paths should be relative. For example an image under `/app/assets/images/home/banner.jpg` should be: `image_path("home/banner.jpg")` --- app/views/admin/customers/index.html.haml | 2 +- .../admin/enterprises/_enterprise_user_index.html.haml | 2 +- app/views/admin/enterprises/form/_primary_details.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/groups/show.html.haml | 2 +- app/views/home/_tagline.html.haml | 2 +- app/views/layouts/registration.html.haml | 2 +- app/views/producers/_fat.html.haml | 2 +- app/views/registration/steps/_limit_reached.html.haml | 2 +- app/views/registration/steps/_logo.html.haml | 2 +- app/views/registration/steps/_promo.html.haml | 2 +- app/views/shared/_footer.html.haml | 2 +- app/views/shared/_ie_warning.html.haml | 6 +++--- app/views/shared/menu/_cart.html.haml | 2 +- app/views/shared/menu/_mobile_menu.html.haml | 2 +- app/views/shared/menu/_signed_in.html.haml | 2 +- app/views/shared/menu/_signed_out.html.haml | 2 +- app/views/shop/products/_form.html.haml | 2 +- app/views/shop/products/_searchbar.haml | 2 +- app/views/shops/_fat.html.haml | 2 +- app/views/shops/_hubs.html.haml | 2 +- app/views/spree/admin/orders/bulk_management.html.haml | 2 +- app/views/spree/admin/orders/index.html.haml | 4 ++-- app/views/spree/admin/products/index/_indicators.html.haml | 2 +- app/views/spree/admin/variants/_autocomplete.js.erb | 2 +- 27 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index 477e609cde..abf39f47d5 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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 0afa9317e9..eedfba8d34 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 30c582f8e2..a6a09106b3 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -59,7 +59,7 @@ .six.columns = f.text_field :permalink, { 'ng-model' => "Enterprise.permalink", placeholder: "eg. your-shop-name", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }" } .two.columns.omega - %img.spinner{ src: "/assets/spinning-circles.svg", width: "30px", ng: { show: "checking" } } + %img.spinner{ src: image_path("spinning-circles.svg"), width: "30px", ng: { show: "checking" } } %span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } } {{ availability }} %i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } } diff --git a/app/views/admin/order_cycles/_loading_flash.html.haml b/app/views/admin/order_cycles/_loading_flash.html.haml index ef810e03d1..05aff6b748 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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 59f0cb4e1f..ab37f06a71 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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 2baa04a473..d9b2bf46bc 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %h1= t('.loading_inventory') diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 3d5af8f08e..4701791daa 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -22,7 +22,7 @@ - if @group.logo.present? %img.group-logo{"src" => @group.logo} - else - %img.group-logo{"src" => '/assets/noimage/group.png'} + %img.group-logo{"src" => image_path('noimage/group.png') } %h2.group-name= @group.name %p= @group.description diff --git a/app/views/home/_tagline.html.haml b/app/views/home/_tagline.html.haml index 7685455b3f..5afa5fe21d 100644 --- a/app/views/home/_tagline.html.haml +++ b/app/views/home/_tagline.html.haml @@ -3,7 +3,7 @@ .small-12.text-center.columns %h1 / TODO: Rohan - logo asset & width is content manageable: - %img{src: "/assets/logo-white-notext.png", title: Spree::Config.site_name} + %img{src: image_path("logo-white-notext.png"), title: Spree::Config.site_name} %br/ %a.button.transparent{href: "/shops"} = t :home_shop diff --git a/app/views/layouts/registration.html.haml b/app/views/layouts/registration.html.haml index 2902f6683e..ebbcd9fd17 100644 --- a/app/views/layouts/registration.html.haml +++ b/app/views/layouts/registration.html.haml @@ -13,7 +13,7 @@ = stylesheet_link_tag "darkswarm/all" = csrf_meta_tags - %body.off-canvas{"ng-app" => "Darkswarm", style: 'background-image: url("/assets/tile-wide.png")' } + %body.off-canvas{"ng-app" => "Darkswarm", style: "background-image: url(#{image_path('tile-wide.png')})" } / [if lte IE 8] = render partial: "shared/ie_warning" = javascript_include_tag "iehack" diff --git a/app/views/producers/_fat.html.haml b/app/views/producers/_fat.html.haml index 1526f4f198..9b4e3b68b6 100644 --- a/app/views/producers/_fat.html.haml +++ b/app/views/producers/_fat.html.haml @@ -1,7 +1,7 @@ .row.active_table_row{"ng-if" => "open()", "ng-click" => "toggle($event)", "ng-class" => "{'open' : open()}"} .columns.small-12.fat.text-center{"ng-show" => "open() && shopfront_loading"} %p - %img.spinner.text-center{ src: "/assets/spinning-circles.svg" } + %img.spinner.text-center{ src: image_path("spinning-circles.svg") } .columns.small-12.medium-7.large-7.fat{"ng-show" => "open() && !shopfront_loading"} / Will add in long description available once clean up HTML formatting producer.long_description diff --git a/app/views/registration/steps/_limit_reached.html.haml b/app/views/registration/steps/_limit_reached.html.haml index c8fa25a43c..ba49d0dac3 100644 --- a/app/views/registration/steps/_limit_reached.html.haml +++ b/app/views/registration/steps/_limit_reached.html.haml @@ -6,7 +6,7 @@ %h4= t(".message") .row .small-12.medium-3.large-2.columns.text-right.hide-for-small-only - %img{:src => "/assets/potatoes.png"} + %img{:src => image_path("potatoes.png") } .small-12.medium-9.large-10.columns %p = t(".text") diff --git a/app/views/registration/steps/_logo.html.haml b/app/views/registration/steps/_logo.html.haml index 677653b4bb..4082defaec 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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 91a8bc9a78..efe29f6994 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %br/ = t("registration.steps.images.uploading") diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index e6374288a5..2ba6278bec 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -3,7 +3,7 @@ .row .small-12.columns.text-center .logo - %img{src: "/assets/logo-white-notext.png"} + %img{src: image_path("logo-white-notext.png") } .row .small-12.medium-8.medium-offset-2.columns.text-center .alert-box diff --git a/app/views/shared/_ie_warning.html.haml b/app/views/shared/_ie_warning.html.haml index 2239fa7450..87acc77b4c 100644 --- a/app/views/shared/_ie_warning.html.haml +++ b/app/views/shared/_ie_warning.html.haml @@ -10,17 +10,17 @@ .row .small-4.columns.browserbtn %a.browserlogo{href: "https://www.google.com/intl/en_au/chrome/browser/", target: "_blank"} - %img{src: "assets/browser-logos/chrome.png"} + %img{src: image_path("browser-logos/chrome.png") } %a{href: "https://www.google.com/intl/en_au/chrome/browser/", target: "_blank"} = t :ie_warning_chrome .small-4.columns.browserbtn %a.browserlogo{href: "http://www.mozilla.org/en-US/firefox/new/", target: "_blank"} - %img{src: "assets/browser-logos/firefox.png"} + %img{src: image_path("browser-logos/firefox.png") } %a{href: "http://www.mozilla.org/en-US/firefox/new/", target: "_blank"} = t :ie_warning_firefox .small-4.columns.browserbtn %a.browserlogo{href: "http://windows.microsoft.com/en-AU/internet-explorer/download-ie", target: "_blank"} - %img{src: "assets/browser-logos/internet-explorer.png"} + %img{src: image_path("browser-logos/internet-explorer.png") } %a{href: "http://windows.microsoft.com/en-AU/internet-explorer/download-ie", target: "_blank"} = t :ie_warning_ie .row.ie-msg diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml index be7d5bf5fe..d6408dc634 100644 --- a/app/views/shared/menu/_cart.html.haml +++ b/app/views/shared/menu/_cart.html.haml @@ -3,7 +3,7 @@ %span = t '.cart' %span.count - %img{ src: "/assets/menu/icn-cart.svg" } + %img{ src: image_path("menu/icn-cart.svg") } %span {{ Cart.total_item_count() }} diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index c501d7b365..8ef5ef7b5d 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -14,7 +14,7 @@ %span = t '.cart' %span.count - %img{ src: "/assets/menu/icn-cart.svg" } + %img{ src: image_path("menu/icn-cart.svg") } %span {{ Cart.total_item_count() }} diff --git a/app/views/shared/menu/_signed_in.html.haml b/app/views/shared/menu/_signed_in.html.haml index 269178ffaa..dceb81075a 100644 --- a/app/views/shared/menu/_signed_in.html.haml +++ b/app/views/shared/menu/_signed_in.html.haml @@ -7,7 +7,7 @@ %li.user-menu.has-dropdown.not-click %a{href: "#", class: "top-bar--menu-item-with-icon"} - %img{ src: "/assets/menu/icn-profile.svg" } + %img{ src: image_path("menu/icn-profile.svg") } %span = t '.profile' diff --git a/app/views/shared/menu/_signed_out.html.haml b/app/views/shared/menu/_signed_out.html.haml index fdb827031f..3a886a20e0 100644 --- a/app/views/shared/menu/_signed_out.html.haml +++ b/app/views/shared/menu/_signed_out.html.haml @@ -1,5 +1,5 @@ %li#login-link %a{"auth" => "login"} - %img{ src: "/assets/menu/icn-login.svg" } + %img{ src: image_path("menu/icn-login.svg") } %span = t 'label_login' diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index c4e6ea6908..7d2718c2d5 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 .small-12.columns.text-center - %img.spinner{ src: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } .hide-for-medium-down.large-2.columns %h5 diff --git a/app/views/shop/products/_searchbar.haml b/app/views/shop/products/_searchbar.haml index fa9fb962a4..f18d9b9382 100644 --- a/app/views/shop/products/_searchbar.haml +++ b/app/views/shop/products/_searchbar.haml @@ -8,7 +8,7 @@ "ng-debounce" => "200", "ofn-disable-enter" => true} %a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}, 'focus-search' => true} - %img{ src: "/assets/icn-close.png" } + = image_tag "icn-close.png" .hide-for-large-up %button{type: 'button', ng: {click: 'toggleFilterSidebar()'}} diff --git a/app/views/shops/_fat.html.haml b/app/views/shops/_fat.html.haml index da9c579454..56772bde40 100644 --- a/app/views/shops/_fat.html.haml +++ b/app/views/shops/_fat.html.haml @@ -1,7 +1,7 @@ .row.active_table_row{"ng-show" => "open()", "ng-click" => "toggle($event)", "ng-class" => "{'open' : open()}"} .columns.small-12.fat.text-center{"ng-show" => "open() && shopfront_loading"} %p - %img.spinner.text-center{ src: "/assets/spinning-circles.svg" } + %img.spinner.text-center{ src: image_path("spinning-circles.svg") } .columns.small-12.medium-6.large-5.fat{"ng-show" => "open() && !shopfront_loading"} %div{"ng-if" => "::hub.taxons"} diff --git a/app/views/shops/_hubs.html.haml b/app/views/shops/_hubs.html.haml index 6c05561da0..1d19839a03 100644 --- a/app/views/shops/_hubs.html.haml +++ b/app/views/shops/_hubs.html.haml @@ -26,7 +26,7 @@ %a{href: "", "ng-click" => "showDistanceMatches()"} = t :hubs_distance_filter, location: "{{ nameMatchesFiltered[0].name }}" .more-controls - %img.spinner.text-center{ng: {show: "closed_shops_loading"}, src: "/assets/spinning-circles.svg" } + %img.spinner.text-center{ng: {show: "closed_shops_loading"}, src: image_path("spinning-circles.svg") } %span{ng: {if: "!show_closed", cloak: true}} %a.button{href: "", ng: {click: "showClosedShops()"}} = t '.show_closed_shops' diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 4eb6a67aa0..1053235c67 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -102,7 +102,7 @@ %columns-dropdown{ action: "#{controller_name}_#{action_name}" } %div.sixteen.columns.alpha#loading{ 'ng-if' => 'RequestMonitor.loading' } - %img.spinner{ src: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %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 596cd884c9..d2871fe540 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -81,7 +81,7 @@ %span{'ng-bind-html' => 'order.display_total'} %td.actions %div.row-loading-icons - %img.spinner{src: "/assets/spinning-circles.svg", ng: {show: 'rowStatus[order.id] == "loading"'} } + %img.spinner{src: image_path("spinning-circles.svg"), ng: {show: 'rowStatus[order.id] == "loading"'} } %i.success.icon-ok-sign{ng: {show: 'rowStatus[order.id] == "success"'} } %i.error.icon-remove-sign.with-tip{ng: {show: 'rowStatus[order.id] == "error"'}, 'ofn-with-tip' => t('.order_not_updated')} %a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')} @@ -93,7 +93,7 @@ .orders-loading{'ng-show' => 'RequestMonitor.loading'} .row .small-12.columns.fullwidth.text-center - %img.spinner{ src: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } .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 4c39f9a5d9..930f4b4337 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: "/assets/spinning-circles.svg" } + %img.spinner{ src: image_path("spinning-circles.svg") } %h1= t('.title') %div.sixteen.columns.alpha{ 'ng-show' => '!RequestMonitor.loading && products.length == 0 && query.length==0' } diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index 5ef095925c..9e4c29a50a 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -4,7 +4,7 @@ {{#if variant.image }} {{ else }} - + {{/if}}