diff --git a/app/models/item_observer.rb b/app/models/item_observer.rb index 62bc5e39..fb259f84 100644 --- a/app/models/item_observer.rb +++ b/app/models/item_observer.rb @@ -22,6 +22,8 @@ class ItemObserver < ActionController::Caching::Sweeper def expire_cache_for(item) controller.expire_fragment("items/#{item.id}#item_link_partial") + controller.expire_fragment("items/#{item.id} header") + controller.expire_fragment("items/#{item.id} info") end def expire_newest_items diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index bd888e34..c65c18d0 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -1,19 +1,20 @@ - title @item.name - canonical_path @item -%header#item-header - = image_tag @item.thumbnail_url, :id => 'item-thumbnail' - %div - %h2#item-name= @item.name - = nc_icon_for(@item) - - unless @item.rarity.blank? - == Rarity: #{@item.rarity_index} (#{@item.rarity}) - = link_to 'NeoItems', neoitems_url_for(@item) - - unless @item.nc? - = link_to 'Shop Wizard', shop_wizard_url_for(@item) - = link_to 'Super Wizard', super_shop_wizard_url_for(@item) - = link_to 'Trades', trading_post_url_for(@item) - = link_to 'Auctions', auction_genie_url_for(@item) +- cache "items/#{@item.id} header" do + %header#item-header + = image_tag @item.thumbnail_url, :id => 'item-thumbnail' + %div + %h2#item-name= @item.name + = nc_icon_for(@item) + - unless @item.rarity.blank? + == Rarity: #{@item.rarity_index} (#{@item.rarity}) + = link_to 'NeoItems', neoitems_url_for(@item) + - unless @item.nc? + = link_to 'Shop Wizard', shop_wizard_url_for(@item) + = link_to 'Super Wizard', super_shop_wizard_url_for(@item) + = link_to 'Trades', trading_post_url_for(@item) + = link_to 'Auctions', auction_genie_url_for(@item) - if user_signed_in? #closet-hangers @@ -34,7 +35,7 @@ %li = number_field_tag "quantity[#{owned}]", - @current_user_quantities[owned], :min => 0 + @current_user_quantities[owned], :min => 0 - unless lists.empty? = label_tag "quantity[#{owned}]", :class => 'unlisted' do @@ -43,18 +44,20 @@ = label_tag "quantity[#{owned}]" do How many? = submit_tag 'Save to Your Items' -%p= @item.description -#item-zones - %p - %strong Occupies: - = list_zones @item.occupied_zones, :uncertain_label - %p - %strong Restricts: - - if @item.restricted_zones.empty? - None - - else - = list_zones @item.restricted_zones +- cache "items/#{@item.id} info" do + %p= @item.description + + #item-zones + %p + %strong Occupies: + = list_zones @item.occupied_zones, :uncertain_label + %p + %strong Restricts: + - if @item.restricted_zones.empty? + None + - else + = list_zones @item.restricted_zones #trade-hangers - [true, false].each do |owned| @@ -86,10 +89,10 @@ %span.more more %span.less less - -#item-preview-header - %h3 Preview - %a#customize-more.button{:href => '/'} Customize more +- cache 'items#show preview_header' do + #item-preview-header + %h3 Preview + %a#customize-more.button{:href => '/'} Customize more #item-preview #item-preview-species= standard_species_images_for(@item)