From b639453f619445498cb3631dbadbec9bf1a4fffc Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 16 Jul 2015 18:39:43 -0400 Subject: [PATCH] on a fresh copy of the site, hide the latest contribution section --- app/controllers/outfits_controller.rb | 2 +- app/views/outfits/new.html.haml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/outfits_controller.rb b/app/controllers/outfits_controller.rb index 4dd88ac7..22477f15 100644 --- a/app/controllers/outfits_controller.rb +++ b/app/controllers/outfits_controller.rb @@ -73,7 +73,7 @@ class OutfitsController < ApplicationController unless localized_fragment_exist?('outfits#new latest_contribution') @latest_contribution = Contribution.recent.first - Contribution.preload_contributeds_and_parents([@latest_contribution]) + Contribution.preload_contributeds_and_parents([@latest_contribution].compact) end @neopets_usernames = user_signed_in? ? current_user.neopets_usernames : [] diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index 67ee1908..911f86fc 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -93,10 +93,11 @@ = submit_tag t('.modeling_hub.load_pet.submit') - localized_cache 'outfits#new latest_contribution' do - #latest-contribution - = link_to t('.latest_contribution.header'), contributions_path, :id => 'recent-contributions-link' - = latest_contribution_description(@latest_contribution) - %abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601} + - if @latest_contribution # will be nil for a fresh copy of the site ;P + #latest-contribution + = link_to t('.latest_contribution.header'), contributions_path, :id => 'recent-contributions-link' + = latest_contribution_description(@latest_contribution) + %abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601} #whats-new -# TODO: cache this entire block? or just request newest items every time?