From 6756ffcf423f44490ed6e23f1e99c3104644d43b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Fri, 2 Apr 2021 16:59:29 +0200 Subject: [PATCH] Add non-breaking space to avoid unwanted line breaks --- .../templates/shop_variant_with_unit_price.html.haml | 2 +- app/models/spree/line_item.rb | 2 +- app/views/shared/menu/_cart_sidebar.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/templates/shop_variant_with_unit_price.html.haml b/app/assets/javascripts/templates/shop_variant_with_unit_price.html.haml index db8bac4557..382839712d 100644 --- a/app/assets/javascripts/templates/shop_variant_with_unit_price.html.haml +++ b/app/assets/javascripts/templates/shop_variant_with_unit_price.html.haml @@ -14,7 +14,7 @@ "question-mark-with-tooltip-placement" => "top", "question-mark-with-tooltip-animation" => true, key: "'js.shopfront.unit_price_tooltip'"} - {{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }} + {{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }} .medium-2.large-2.columns.total-price %span{"ng-class" => "{filled: variant.line_item.total_price}"} diff --git a/app/models/spree/line_item.rb b/app/models/spree/line_item.rb index 2813bcfaf3..5e32be41f3 100644 --- a/app/models/spree/line_item.rb +++ b/app/models/spree/line_item.rb @@ -209,7 +209,7 @@ module Spree def unit_price_price_and_unit unit_price = UnitPrice.new(variant) Spree::Money.new(price_with_adjustments / unit_price.denominator).to_html + - " / " + unit_price.unit + " / ".html_safe + unit_price.unit end def scoper diff --git a/app/views/shared/menu/_cart_sidebar.html.haml b/app/views/shared/menu/_cart_sidebar.html.haml index 249419bd4d..b95936d45b 100644 --- a/app/views/shared/menu/_cart_sidebar.html.haml +++ b/app/views/shared/menu/_cart_sidebar.html.haml @@ -33,7 +33,7 @@ key: "'js.shopfront.unit_price_tooltip'", context: "'cart-sidebar'"} .options-text - {{ line_item.variant.unit_price_price | localizeCurrency }} / {{ line_item.variant.unit_price_unit }} + {{ line_item.variant.unit_price_price | localizeCurrency }} / {{ line_item.variant.unit_price_unit }} .cart-empty{"ng-show" => "Cart.line_items.length == 0"} %p