From d588253c4c398247b8f90d9daf1bb5528f71dd94 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 11 Sep 2014 18:09:00 -0500 Subject: [PATCH] campaign banner on homepage is pretty --- .../stylesheets/partials/_campaign-progress.sass | 15 ++++++++++----- app/controllers/outfits_controller.rb | 2 ++ app/helpers/application_helper.rb | 5 +++-- app/views/outfits/new.html.haml | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/partials/_campaign-progress.sass b/app/assets/stylesheets/partials/_campaign-progress.sass index 08c47a05..12f9427c 100644 --- a/app/assets/stylesheets/partials/_campaign-progress.sass +++ b/app/assets/stylesheets/partials/_campaign-progress.sass @@ -10,14 +10,12 @@ position: relative .button + +awesome-button +loud-awesome-button-color font-size: 75% margin-left: 1em padding: .25em .75em - &:after - content: none - .campaign-progress background: $module-border-color background-image: linear-gradient(color-stops($module-border-color + #222, $module-border-color)) @@ -28,6 +26,7 @@ .campaign-progress-label +text-shadow(#777, -1px, -1px, 0) + color: white font-size: 150% left: 0 position: absolute @@ -35,8 +34,14 @@ text-align: center width: 100% - &, a - color: white + a + color: inherit + display: block + text-decoration: none + + .button + position: relative + top: -2px /* lame hack to align well with text; sigh */ &.campaign-loaded .campaign-progress-wrapper diff --git a/app/controllers/outfits_controller.rb b/app/controllers/outfits_controller.rb index 684de6c7..72dbe141 100644 --- a/app/controllers/outfits_controller.rb +++ b/app/controllers/outfits_controller.rb @@ -77,6 +77,8 @@ class OutfitsController < ApplicationController end @neopets_usernames = user_signed_in? ? current_user.neopets_usernames : [] + + @campaign = Campaign.current end def show diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7c821320..71cb5d1a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,8 +25,9 @@ module ApplicationHelper if block_given? content = capture(&block) else - content = link_to('Help Dress to Impress stay online!', donate_path) + - link_to('Learn more', donate_path, :class => 'button') + content = link_to( + content_tag(:span, 'Help Dress to Impress stay online!') + + content_tag(:span, 'Learn more', :class => 'button'), donate_path) end meter = content_tag(:div, nil, :class => 'campaign-progress', diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index 9698f899..b6f45b8e 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -1,6 +1,6 @@ - hide_home_link -= campaign_progress += campaign_progress @campaign %p#pet-not-found.alert= t 'pets.load.not_found' %p#neopia-error.alert= t 'pets.load.neopia_error'