even better campaign copy: complete text + ceil to $5 for the finish-up pitch

This commit is contained in:
Matchu 2015-09-24 19:39:49 -07:00
parent 90ac52dc74
commit 973bbbcb0a

View file

@ -26,8 +26,8 @@ module ApplicationHelper
end end
end end
def cents_to_currency(cents) def cents_to_currency(cents, options={})
number_to_currency(cents / 100.0) number_to_currency(cents / 100.0, options)
end end
def campaign_progress(campaign, &block) def campaign_progress(campaign, &block)
@ -35,8 +35,12 @@ module ApplicationHelper
if block_given? if block_given?
content = capture(&block) content = capture(&block)
else else
if campaign.remaining < 200_00 if campaign.complete?
pitch = "We only need #{cents_to_currency(campaign.remaining)} more for #{campaign.name}!" pitch = "We've met this year's fundraising goal! Thanks, everybody!"
prompt = "Learn more"
elsif campaign.remaining < 200_00
estimate = (campaign.remaining.to_f / 5_00).ceil * 5_00
pitch = "We're less than #{cents_to_currency(estimate, precision: 0)} away from paying this year's hosting costs!"
prompt = "Donate now" prompt = "Donate now"
else else
pitch = "Help Dress to Impress stay online!" pitch = "Help Dress to Impress stay online!"