forked from OpenNeo/impress
for large donations, show a banner instead of their placeholder outfits
This commit is contained in:
parent
51700a7386
commit
cf2550c7bc
3 changed files with 38 additions and 7 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -65,14 +65,20 @@
|
||||||
%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|
|
||||||
%li
|
- if outfit_image?(feature.outfit) || !large_donation?(donation.amount)
|
||||||
- if feature.outfit_id? && feature.outfit.image?
|
%li
|
||||||
= link_to image_tag(feature.outfit.image.small.url), feature.outfit
|
- if outfit_image?(feature.outfit)
|
||||||
- else
|
= link_to image_tag(feature.outfit.image.small.url), feature.outfit
|
||||||
= image_tag 'default_preview.png'
|
- else
|
||||||
|
= image_tag 'default_preview.png'
|
||||||
|
|
||||||
%header Thanks, #{donation.donor_name.presence || 'Anonymous'}!
|
%header Thanks, #{donation.donor_name.presence || 'Anonymous'}!
|
||||||
|
|
||||||
#fine-print
|
#fine-print
|
||||||
%h2 Some notes on featured outfits
|
%h2 Some notes on featured outfits
|
||||||
|
|
Loading…
Reference in a new issue