1
0
Fork 0
forked from OpenNeo/impress

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') unless localized_fragment_exist?('outfits#new latest_contribution')
@latest_contribution = Contribution.recent.first @latest_contribution = Contribution.recent.first
Contribution.preload_contributeds_and_parents([@latest_contribution]) Contribution.preload_contributeds_and_parents([@latest_contribution].compact)
end end
@neopets_usernames = user_signed_in? ? current_user.neopets_usernames : [] @neopets_usernames = user_signed_in? ? current_user.neopets_usernames : []

View file

@ -93,10 +93,11 @@
= submit_tag t('.modeling_hub.load_pet.submit') = submit_tag t('.modeling_hub.load_pet.submit')
- localized_cache 'outfits#new latest_contribution' do - localized_cache 'outfits#new latest_contribution' do
#latest-contribution - if @latest_contribution # will be nil for a fresh copy of the site ;P
= link_to t('.latest_contribution.header'), contributions_path, :id => 'recent-contributions-link' #latest-contribution
= latest_contribution_description(@latest_contribution) = link_to t('.latest_contribution.header'), contributions_path, :id => 'recent-contributions-link'
%abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601} = latest_contribution_description(@latest_contribution)
%abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601}
#whats-new #whats-new
-# TODO: cache this entire block? or just request newest items every time? -# TODO: cache this entire block? or just request newest items every time?