From 70cf262387de7834db84b6fba137677f16edc645 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 10 Oct 2011 22:06:46 -0500 Subject: [PATCH] remove campaign banner from most pages --- app/helpers/application_helper.rb | 25 ++++++++++++++----------- app/views/static/donate.html.haml | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b6c9cd38..d6bb8c3c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,19 +14,22 @@ module ApplicationHelper end end - def campaign_progress(&block) - include_campaign_progress_requirements + CAMPAIGN_ACTIVE = false + def campaign_progress(options={}, &block) + if CAMPAIGN_ACTIVE || options[:always] + include_campaign_progress_requirements - if block_given? - content = capture(&block) - else - content = link_to('We made it! Image Mode has been released.', donate_path) + - link_to('Read more', donate_path, :class => 'button') + if block_given? + content = capture(&block) + else + content = link_to('We made it! Image Mode has been released.', donate_path) + + link_to('Read more', donate_path, :class => 'button') + end + + html = content_tag(:div, nil, :class => 'campaign-progress') + + content_tag(:div, content, :class => 'campaign-progress-label') + content_tag(:div, html, :class => 'campaign-progress-wrapper') end - - html = content_tag(:div, nil, :class => 'campaign-progress') + - content_tag(:div, content, :class => 'campaign-progress-label') - content_tag(:div, html, :class => 'campaign-progress-wrapper') end def canonical_path(resource) diff --git a/app/views/static/donate.html.haml b/app/views/static/donate.html.haml index cf7062c2..ef6df1dc 100644 --- a/app/views/static/donate.html.haml +++ b/app/views/static/donate.html.haml @@ -1,7 +1,7 @@ - title "Support Dress to Impress" %h2 Thank you so much for all your help. We made it! -= campaign_progress do += campaign_progress(:always => true) do We've received = surround '$', ',' do %span.campaign-raised