1
0
Fork 0
forked from OpenNeo/impress

for large donations, show a banner instead of their placeholder outfits

This commit is contained in:
Emi Matchu 2014-09-13 20:54:39 -05:00
parent 51700a7386
commit cf2550c7bc
3 changed files with 38 additions and 7 deletions

View file

@ -57,6 +57,7 @@ body.static-donate
#outfits #outfits
+outfits-list +outfits-list
text-align: center
> li > li
+outfit +outfit
@ -68,13 +69,30 @@ body.static-donate
header, footer header, footer
font-size: 85% font-size: 85%
padding: $outfit-banner-v-padding $outfit-banner-h-padding padding: $outfit-banner-v-padding $outfit-banner-h-padding
text-align: center
width: $outfit-banner-inner-width width: $outfit-banner-inner-width
img img
height: $outfit-inner-height height: $outfit-inner-height
width: $outfit-inner-width width: $outfit-inner-width
&.banner
background-image: url(http://images.neopets.com/themes/004_bir_a2e60/footer_bg.png)
background-position: 0 -60px
border: 2px solid #006
color: white
height: 100px
line-height: 100px
margin: 4px 0
text-shadow: #335 2px 2px 1px
width: $container-width - 4px
span
+inline-block
font-size: 32px
font-weight: bold
line-height: 1.5
vertical-align: middle
#fine-print #fine-print
font-size: 85% font-size: 85%
margin-top: 2em margin-top: 2em

View file

@ -1,2 +1,9 @@
module StaticHelper module StaticHelper
def large_donation?(amount)
amount > 100_00
end
def outfit_image?(outfit)
outfit.present? && outfit.image?
end
end end

View file

@ -65,9 +65,15 @@
%h2 Thanks to our lovely donors! %h2 Thanks to our lovely donors!
%ul#outfits %ul#outfits
- @donations.each do |donation| - @donations.each do |donation|
- if large_donation?(donation.amount)
%li.banner
%span
Thanks, #{donation.donor_name}, for donating
#{number_to_currency(donation.amount / 100.0)}!
- donation.features.each do |feature| - donation.features.each do |feature|
- if outfit_image?(feature.outfit) || !large_donation?(donation.amount)
%li %li
- if feature.outfit_id? && feature.outfit.image? - if outfit_image?(feature.outfit)
= link_to image_tag(feature.outfit.image.small.url), feature.outfit = link_to image_tag(feature.outfit.image.small.url), feature.outfit
- else - else
= image_tag 'default_preview.png' = image_tag 'default_preview.png'