add prank messages to outfits#show

This commit is contained in:
Emi Matchu 2014-03-28 15:15:04 -05:00
parent 528fffce52
commit 32bab89ed4
5 changed files with 24 additions and 0 deletions

View file

@ -17,6 +17,9 @@ body.outfits-show
float: right float: right
margin-top: 1em margin-top: 1em
#prank-color-message
clear: both
#preview-wrapper #preview-wrapper
clear: both clear: both
height: 400px height: 400px

View file

@ -9,6 +9,8 @@ class Outfit < ActiveRecord::Base
validates :name, :presence => {:if => :user_id}, :uniqueness => {:scope => :user_id, :if => :user_id} validates :name, :presence => {:if => :user_id}, :uniqueness => {:scope => :user_id, :if => :user_id}
validates :pet_state, :presence => true validates :pet_state, :presence => true
delegate :color, to: :pet_state
attr_accessible :name, :pet_state_id, :starred, :worn_and_unworn_item_ids attr_accessible :name, :pet_state_id, :starred, :worn_and_unworn_item_ids
scope :wardrobe_order, order('starred DESC', :name) scope :wardrobe_order, order('starred DESC', :name)

View file

@ -10,6 +10,8 @@ class PetState < ActiveRecord::Base
belongs_to :pet_type belongs_to :pet_type
delegate :color, to: :pet_type
alias_method :swf_asset_ids_from_association, :swf_asset_ids alias_method :swf_asset_ids_from_association, :swf_asset_ids
attr_writer :parent_swf_asset_relationships_to_update attr_writer :parent_swf_asset_relationships_to_update

View file

@ -15,6 +15,14 @@
- if @outfit.user_id - if @outfit.user_id
#outfit-user #outfit-user
= outfit_creation_summary(@outfit) = outfit_creation_summary(@outfit)
- if @outfit.color.prank?
%p.warning#prank-color-message
- if Color.pranks_funny?
= t 'colors.prank_message.funny_html', color: @outfit.color.unfunny_human_name
- else
= t 'colors.prank_message.unfunny_html', color: @outfit.color.unfunny_human_name
#preview-wrapper #preview-wrapper
#preview-swf #preview-swf
#outfit-items= render @outfit.worn_items #outfit-items= render @outfit.worn_items

View file

@ -220,6 +220,15 @@ en:
colors: colors:
default_human_name: (a new color) default_human_name: (a new color)
prank_suffix: (fake) prank_suffix: (fake)
prank_message:
funny_html: This pet is painted %{color}, a totally real,
obviously not-made-up color. You should <em>totally</em> go spend all
your hard-earned Neopoints on a %{color} Paint Brush and fall for
%{color} pet trade scams, because %{color} is <em>totally</em> a real
thing. C'mon, would I lie to you? On today of all days?
unfunny_html: This pet is painted %{color}, a fake color added to the
site for April Fools 2014. Anyone who claims to have a <em>real</em>
Nebula pet is a big fat liar.
contributions: contributions:
contributed_description: contributed_description: