diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 9b26b2e0..961dd770 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -1,7 +1,6 @@ class ItemsController < ApplicationController before_filter :set_query - caches_action :show, :layout => false - + def index if params.has_key?(:q) begin @@ -35,11 +34,11 @@ class ItemsController < ApplicationController end end end - + def show @item = Item.find params[:id] end - + def needed if params[:color] && params[:species] @pet_type = PetType.find_by_color_id_and_species_id( @@ -54,10 +53,11 @@ class ItemsController < ApplicationController @pet_name = params[:name] render :layout => 'application' end - + private - + def set_query @query = params[:q] end end + diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index b64f4c32..83c04220 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -2,42 +2,43 @@ - content_for :meta do %link{:rel => 'canonical', :href => url_for(@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}) - %a.button{:href => neoitems_url_for(@item)} NeoItems +- cache "items_show_#{@item.id}_main_content" do + %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}) + %a.button{:href => neoitems_url_for(@item)} NeoItems -%p= @item.description + %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 + #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 -#item-preview-header - %h3 Preview - %a#customize-more.button{:href => '/'} Customize more + #item-preview-header + %h3 Preview + %a#customize-more.button{:href => '/'} Customize more -#item-preview - #item-preview-species= standard_species_images_for(@item) - #item-preview-error - #item-preview-swf - Javascript and Flash are required to preview wearables. Sorry! + #item-preview + #item-preview-species= standard_species_images_for(@item) + #item-preview-error + #item-preview-swf + Javascript and Flash are required to preview wearables. Sorry! -:javascript - var CURRENT_ITEM_ZONES_RESTRICT = #{@item.zones_restrict.inspect}, - IMPRESS_HOST = #{RemoteImpressHost.inspect}; + :javascript + var CURRENT_ITEM_ZONES_RESTRICT = #{@item.zones_restrict.inspect}, + IMPRESS_HOST = #{RemoteImpressHost.inspect}; -= include_javascript_libraries :jquery, :swfobject -= javascript_include_tag 'items/show' + = include_javascript_libraries :jquery, :swfobject + = javascript_include_tag 'items/show' diff --git a/app/views/layouts/items.html.haml b/app/views/layouts/items.html.haml index 6e04e5c3..0f186779 100644 --- a/app/views/layouts/items.html.haml +++ b/app/views/layouts/items.html.haml @@ -9,3 +9,4 @@ = submit_tag 'Search', :name => nil = yield = render :file => 'layouts/application' +