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-list
text-align: center
> li
+outfit
@ -68,13 +69,30 @@ body.static-donate
header, footer
font-size: 85%
padding: $outfit-banner-v-padding $outfit-banner-h-padding
text-align: center
width: $outfit-banner-inner-width
img
height: $outfit-inner-height
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
font-size: 85%
margin-top: 2em

View file

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

View file

@ -65,14 +65,20 @@
%h2 Thanks to our lovely donors!
%ul#outfits
- @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|
%li
- if feature.outfit_id? && feature.outfit.image?
= link_to image_tag(feature.outfit.image.small.url), feature.outfit
- else
= image_tag 'default_preview.png'
- if outfit_image?(feature.outfit) || !large_donation?(donation.amount)
%li
- if outfit_image?(feature.outfit)
= link_to image_tag(feature.outfit.image.small.url), feature.outfit
- else
= image_tag 'default_preview.png'
%header Thanks, #{donation.donor_name.presence || 'Anonymous'}!
%header Thanks, #{donation.donor_name.presence || 'Anonymous'}!
#fine-print
%h2 Some notes on featured outfits