From c6f6dd118a70cd7e3ec374ca4a564682f6b71a9b Mon Sep 17 00:00:00 2001 From: Kieran Pilkington Date: Wed, 20 May 2009 11:36:16 +1200 Subject: [PATCH] bugfix: when upgrading and the limit was nil, errors would occur. The negative class also wasn't having much effect and the light grey number were hardly visible --- app/helpers/subscriptions_helper.rb | 2 +- public/stylesheets/money.css | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/helpers/subscriptions_helper.rb b/app/helpers/subscriptions_helper.rb index b6e987c..74af560 100644 --- a/app/helpers/subscriptions_helper.rb +++ b/app/helpers/subscriptions_helper.rb @@ -14,7 +14,7 @@ def balance_cell(container, options={}) classes << "negative" if balance < 0 classes << "current_balance" - if container.is_a?(Account) && container.credit_card? + if container.is_a?(Account) && container.credit_card? && !container.limit.blank? percentage_used = container.limit.abs.to_i == 0 ? 100 : ((container.balance.abs.to_f / container.limit.abs.to_f) * 100).to_i classes << if percentage_used >= Account::DEFAULT_LIMIT_VALUES[:critical]: "critical" diff --git a/public/stylesheets/money.css b/public/stylesheets/money.css index 8839b91..1583c10 100644 --- a/public/stylesheets/money.css +++ b/public/stylesheets/money.css @@ -266,10 +266,6 @@ td.number, th.number { white-space: nowrap; } -td.current_balance, th.current_balance { - color: #999; -} - span.real_balance { font-size: 80%; color: #999; @@ -281,7 +277,7 @@ span.check { } .negative { - color: red; + color: red !important; } .critical {