Use improved NC trade value text in item page
This commit is contained in:
parent
10708de615
commit
a4dd680445
2 changed files with 4 additions and 3 deletions
|
|
@ -184,7 +184,7 @@ module ItemsHelper
|
||||||
# nicely for our use case.
|
# nicely for our use case.
|
||||||
def nc_trade_value_estimate_text(nc_trade_value)
|
def nc_trade_value_estimate_text(nc_trade_value)
|
||||||
match = nc_trade_value.value_text.match(NC_TRADE_VALUE_ESTIMATE_PATTERN)
|
match = nc_trade_value.value_text.match(NC_TRADE_VALUE_ESTIMATE_PATTERN)
|
||||||
return nc_trade_value if match.nil?
|
return nc_trade_value.value_text if match.nil?
|
||||||
|
|
||||||
match => {single:, low:, high:}
|
match => {single:, low:, high:}
|
||||||
if single.present?
|
if single.present?
|
||||||
|
|
@ -192,7 +192,7 @@ module ItemsHelper
|
||||||
elsif low.present? && high.present?
|
elsif low.present? && high.present?
|
||||||
"#{low}–#{high} capsules"
|
"#{low}–#{high} capsules"
|
||||||
else
|
else
|
||||||
nc_trade_value
|
nc_trade_value.value_text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@
|
||||||
%span{
|
%span{
|
||||||
title: nc_trade_value_updated_at_text(item.nc_trade_value)
|
title: nc_trade_value_updated_at_text(item.nc_trade_value)
|
||||||
}
|
}
|
||||||
= t('items.show.resources.lebron', value: item.nc_trade_value.value_text)
|
= t 'items.show.resources.lebron',
|
||||||
|
value: nc_trade_value_estimate_text(item.nc_trade_value)
|
||||||
- unless item.nc?
|
- unless item.nc?
|
||||||
= link_to t('items.show.resources.shop_wizard'), shop_wizard_url_for(item)
|
= link_to t('items.show.resources.shop_wizard'), shop_wizard_url_for(item)
|
||||||
= link_to t('items.show.resources.trading_post'), trading_post_url_for(item)
|
= link_to t('items.show.resources.trading_post'), trading_post_url_for(item)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue