on a fresh copy of the site, hide the latest contribution section

This commit is contained in:
Matchu 2015-07-16 18:39:43 -04:00
parent 0d6caceb24
commit b639453f61
2 changed files with 6 additions and 5 deletions

View file

@ -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 : []

View file

@ -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?