From 973bbbcb0acf53699bca7c0e3ea705289850feb3 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 24 Sep 2015 19:39:49 -0700 Subject: [PATCH] even better campaign copy: complete text + ceil to $5 for the finish-up pitch --- app/helpers/application_helper.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cac277c4..355d5fc5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -26,8 +26,8 @@ module ApplicationHelper end end - def cents_to_currency(cents) - number_to_currency(cents / 100.0) + def cents_to_currency(cents, options={}) + number_to_currency(cents / 100.0, options) end def campaign_progress(campaign, &block) @@ -35,8 +35,12 @@ module ApplicationHelper if block_given? content = capture(&block) else - if campaign.remaining < 200_00 - pitch = "We only need #{cents_to_currency(campaign.remaining)} more for #{campaign.name}!" + if campaign.complete? + 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" else pitch = "Help Dress to Impress stay online!"