diff --git a/app/helpers/outfits_helper.rb b/app/helpers/outfits_helper.rb index e05cac76..3933e357 100644 --- a/app/helpers/outfits_helper.rb +++ b/app/helpers/outfits_helper.rb @@ -125,5 +125,14 @@ module OutfitsHelper haml_concat javascript_tag("var ModelingI18n = #{modeling_i18n.to_json};") end end + + def prank_color_message(color) + if color.prank? + content_key_base = Color.pranks_funny? ? 'funny' : 'unfunny' + content = t("colors.prank_message.#{content_key_base}_html", + color: color.unfunny_human_name) + content_tag('p', content, id: 'prank-color-message', :class => 'warning') + end + end end diff --git a/app/views/outfits/show.html.haml b/app/views/outfits/show.html.haml index fa5e6754..ce1ee42c 100644 --- a/app/views/outfits/show.html.haml +++ b/app/views/outfits/show.html.haml @@ -16,12 +16,7 @@ #outfit-user = 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 += prank_color_message(@outfit.color) #preview-wrapper #preview-swf