diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 773dfeef..f30b2a73 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,10 +14,16 @@ module ApplicationHelper end end - def campaign_progress(content=nil, &block) + def campaign_progress(&block) include_campaign_progress_requirements - content ||= capture(&block) + if block_given? + content = capture(&block) + else + content = link_to('We need your help to keep growing and stay online!', donate_path) + + link_to('Donate now!', 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') diff --git a/app/stylesheets/_items.sass b/app/stylesheets/_items.sass index c40a8993..31cb72ee 100644 --- a/app/stylesheets/_items.sass +++ b/app/stylesheets/_items.sass @@ -1,6 +1,10 @@ +@import "partials/campaign-progress" + body.items + +campaign-progress + text-align: center - + input[type=text] font-size: 125% width: 15em @@ -17,3 +21,4 @@ body.items text-decoration: underline &:hover span text-decoration: none + diff --git a/app/stylesheets/outfits/_show.sass b/app/stylesheets/outfits/_show.sass index fbe19a02..97e2ffd1 100644 --- a/app/stylesheets/outfits/_show.sass +++ b/app/stylesheets/outfits/_show.sass @@ -1,29 +1,34 @@ +@import "partials/campaign-progress" + body.outfits-show + +campaign-progress + #title float: left - + #outfit-wardrobe-link float: left font-size: 85% margin: left: 2em top: .75em - + #outfit-user float: right margin-top: 1em - + #preview-wrapper clear: both height: 400px margin: 0 auto 1em position: relative width: 400px - + #preview-swf left: 0 position: absolute top: 0 - + #outfit-items text-align: center + diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 134924e6..40300d78 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -18,6 +18,7 @@ %body{:class => body_class} = javascript_include_tag "analytics" #container + = yield :before_title - if content_for?(:title) && show_title_header? %h1#title= yield :title = render 'static/announcement.html' diff --git a/app/views/layouts/items.html.haml b/app/views/layouts/items.html.haml index 480df12c..d9591497 100644 --- a/app/views/layouts/items.html.haml +++ b/app/views/layouts/items.html.haml @@ -1,3 +1,4 @@ +- content_for :before_title, campaign_progress - content_for :title_category do Infinite Closet: Neopets customization clothing and wearables database - content_for :before_flashes do diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index f2cb84ec..a678108f 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -1,8 +1,6 @@ - hide_home_link -= campaign_progress do - = link_to 'We need your help to keep growing and stay online!', donate_path - = link_to 'Donate now!', donate_path, :class => 'button' += campaign_progress #outfit-forms - cache :action_suffix => 'outfit_forms_intro' do diff --git a/app/views/outfits/show.html.haml b/app/views/outfits/show.html.haml index 214c74d4..880925b4 100644 --- a/app/views/outfits/show.html.haml +++ b/app/views/outfits/show.html.haml @@ -1,4 +1,6 @@ - title(@outfit.name || "Shared outfit") +- content_for :before_title, campaign_progress + = link_to_edit_outfit(@outfit, :class => 'button', :id => 'outfit-wardrobe-link') do Edit - unless user_signed_in? && @outfit.user == current_user diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index 46813f3e..9a2d3fcd 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -591,34 +591,93 @@ body.contributions-index .contributions span.time-ago { font-size: 75%; } -/* line 1, ../../../app/stylesheets/_items.sass */ +/* line 3, ../../../app/stylesheets/_items.sass */ body.items { text-align: center; } -/* line 4, ../../../app/stylesheets/_items.sass */ +/* line 2, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-wrapper { + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + background: #aaaaaa; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #cccccc), color-stop(100%, #aaaaaa)); + background-image: -moz-linear-gradient(top, #cccccc 0%, #aaaaaa 100%); + background-image: linear-gradient(top, #cccccc 0%, #aaaaaa 100%); + border: 4px solid #006600; + clear: both; + margin-bottom: 1.5em; + position: relative; + visibility: hidden; +} +/* line 13, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-wrapper .button { + background: #ff5c00 url('/images/alert-overlay.png?1296599919') repeat-x; + font-size: 75%; + margin-left: 1em; + padding: 0.25em 0.75em; +} +/* line 34, ../../../app/stylesheets/partials/clean/_mixins.sass */ +body.items .campaign-progress-wrapper .button:hover { + background-color: #ee4b00; +} +/* line 19, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-wrapper .button:after { + content: none; +} +/* line 22, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress { + background: #006600; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #228822), color-stop(100%, #006600)); + background-image: -moz-linear-gradient(top, #228822 0%, #006600 100%); + background-image: linear-gradient(top, #228822 0%, #006600 100%); + border-right: 1px solid #006600; +} +/* line 27, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-wrapper, body.items .campaign-progress { + height: 2.5em; +} +/* line 30, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-label { + text-shadow: #777777 -1px -1px 0; + font-size: 150%; + left: 0; + position: absolute; + top: 0; + text-align: center; + width: 100%; +} +/* line 39, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items .campaign-progress-label, body.items .campaign-progress-label a { + color: white; +} +/* line 43, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.items.campaign-loaded .campaign-progress-wrapper { + visibility: visible; +} +/* line 8, ../../../app/stylesheets/_items.sass */ body.items input[type=text], body.items body.pets-bulk #bulk-pets-form textarea, body.pets-bulk #bulk-pets-form body.items textarea { font-size: 125%; width: 15em; } -/* line 8, ../../../app/stylesheets/_items.sass */ +/* line 12, ../../../app/stylesheets/_items.sass */ body.items h1 { margin-bottom: 1em; } -/* line 10, ../../../app/stylesheets/_items.sass */ +/* line 14, ../../../app/stylesheets/_items.sass */ body.items h1 img { height: 80px; margin-bottom: -0.5em; width: 80px; } -/* line 14, ../../../app/stylesheets/_items.sass */ +/* line 18, ../../../app/stylesheets/_items.sass */ body.items h1 a { text-decoration: none; } -/* line 16, ../../../app/stylesheets/_items.sass */ +/* line 20, ../../../app/stylesheets/_items.sass */ body.items h1 a span { text-decoration: underline; } -/* line 18, ../../../app/stylesheets/_items.sass */ +/* line 22, ../../../app/stylesheets/_items.sass */ body.items h1 a:hover span { text-decoration: none; } @@ -2435,23 +2494,82 @@ body.outfits-new #read-more { float: right; } -/* line 2, ../../../app/stylesheets/outfits/_show.sass */ +/* line 2, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-wrapper { + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + background: #aaaaaa; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #cccccc), color-stop(100%, #aaaaaa)); + background-image: -moz-linear-gradient(top, #cccccc 0%, #aaaaaa 100%); + background-image: linear-gradient(top, #cccccc 0%, #aaaaaa 100%); + border: 4px solid #006600; + clear: both; + margin-bottom: 1.5em; + position: relative; + visibility: hidden; +} +/* line 13, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-wrapper .button { + background: #ff5c00 url('/images/alert-overlay.png?1296599919') repeat-x; + font-size: 75%; + margin-left: 1em; + padding: 0.25em 0.75em; +} +/* line 34, ../../../app/stylesheets/partials/clean/_mixins.sass */ +body.outfits-show .campaign-progress-wrapper .button:hover { + background-color: #ee4b00; +} +/* line 19, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-wrapper .button:after { + content: none; +} +/* line 22, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress { + background: #006600; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #228822), color-stop(100%, #006600)); + background-image: -moz-linear-gradient(top, #228822 0%, #006600 100%); + background-image: linear-gradient(top, #228822 0%, #006600 100%); + border-right: 1px solid #006600; +} +/* line 27, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-wrapper, body.outfits-show .campaign-progress { + height: 2.5em; +} +/* line 30, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-label { + text-shadow: #777777 -1px -1px 0; + font-size: 150%; + left: 0; + position: absolute; + top: 0; + text-align: center; + width: 100%; +} +/* line 39, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show .campaign-progress-label, body.outfits-show .campaign-progress-label a { + color: white; +} +/* line 43, ../../../app/stylesheets/partials/_campaign-progress.sass */ +body.outfits-show.campaign-loaded .campaign-progress-wrapper { + visibility: visible; +} +/* line 6, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #title { float: left; } -/* line 5, ../../../app/stylesheets/outfits/_show.sass */ +/* line 9, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #outfit-wardrobe-link { float: left; font-size: 85%; margin-left: 2em; margin-top: 0.75em; } -/* line 12, ../../../app/stylesheets/outfits/_show.sass */ +/* line 16, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #outfit-user { float: right; margin-top: 1em; } -/* line 16, ../../../app/stylesheets/outfits/_show.sass */ +/* line 20, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #preview-wrapper { clear: both; height: 400px; @@ -2459,13 +2577,13 @@ body.outfits-show #preview-wrapper { position: relative; width: 400px; } -/* line 23, ../../../app/stylesheets/outfits/_show.sass */ +/* line 27, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #preview-wrapper #preview-swf { left: 0; position: absolute; top: 0; } -/* line 28, ../../../app/stylesheets/outfits/_show.sass */ +/* line 32, ../../../app/stylesheets/outfits/_show.sass */ body.outfits-show #outfit-items { text-align: center; }