forked from OpenNeo/impress
stop caching items#show for now due to Your Items module
This commit is contained in:
parent
be5bdb1eec
commit
8bf9872fbe
1 changed files with 80 additions and 81 deletions
|
@ -1,93 +1,92 @@
|
||||||
- title @item.name
|
- title @item.name
|
||||||
- canonical_path @item
|
- canonical_path @item
|
||||||
|
|
||||||
- cache "items_show_#{@item.id}_main_content" do
|
%header#item-header
|
||||||
%header#item-header
|
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
|
||||||
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
|
%div
|
||||||
%div
|
%h2#item-name= @item.name
|
||||||
%h2#item-name= @item.name
|
= nc_icon_for(@item)
|
||||||
= nc_icon_for(@item)
|
- unless @item.rarity.blank?
|
||||||
- unless @item.rarity.blank?
|
== Rarity: #{@item.rarity_index} (#{@item.rarity})
|
||||||
== Rarity: #{@item.rarity_index} (#{@item.rarity})
|
= link_to 'NeoItems', neoitems_url_for(@item), :class => 'button'
|
||||||
= link_to 'NeoItems', neoitems_url_for(@item), :class => 'button'
|
|
||||||
|
|
||||||
- if @current_user_hangers
|
- if @current_user_hangers
|
||||||
#closet-hangers
|
#closet-hangers
|
||||||
%header
|
%header
|
||||||
Track this in
|
Track this in
|
||||||
= link_to 'Your Items', user_closet_hangers_path(current_user)
|
= link_to 'Your Items', user_closet_hangers_path(current_user)
|
||||||
- @current_user_hangers.each do |hanger|
|
- @current_user_hangers.each do |hanger|
|
||||||
= form_for(hanger, :url => user_item_closet_hanger_path(current_user, @item)) do |f|
|
= form_for(hanger, :url => user_item_closet_hanger_path(current_user, @item)) do |f|
|
||||||
- if hanger.new_record?
|
- if hanger.new_record?
|
||||||
= f.hidden_field :quantity
|
= f.hidden_field :quantity
|
||||||
= f.hidden_field :owned
|
= f.hidden_field :owned
|
||||||
= f.submit "I #{hanger.verb(:you)} this item!"
|
= f.submit "I #{hanger.verb(:you)} this item!"
|
||||||
- else
|
|
||||||
= f.hidden_field :owned
|
|
||||||
= f.label :quantity, "How many of these do you #{hanger.verb(:you)}?"
|
|
||||||
= f.number_field :quantity, :min => 0, :required => true
|
|
||||||
- lists = current_user.closet_lists.where(:hangers_owned => hanger.owned).all
|
|
||||||
- unless lists.empty?
|
|
||||||
= f.collection_select :list_id, lists, :id, :name, :include_blank => 'Not in a list'
|
|
||||||
= f.submit "Save"
|
|
||||||
%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|
|
|
||||||
%p
|
|
||||||
- unless @trading_closet_hangers_by_owned[owned].empty?
|
|
||||||
%strong
|
|
||||||
= pluralize @trading_closet_hangers_by_owned[owned].size, 'user'
|
|
||||||
- if owned
|
|
||||||
- if @trading_closet_hangers_by_owned[owned].size == 1
|
|
||||||
has
|
|
||||||
- else
|
|
||||||
have
|
|
||||||
this item up for trade:
|
|
||||||
- else
|
|
||||||
- if @trading_closet_hangers_by_owned[owned].size == 1
|
|
||||||
wants
|
|
||||||
- else
|
|
||||||
want
|
|
||||||
this item:
|
|
||||||
= render_trading_closet_hangers(owned)
|
|
||||||
- else
|
- else
|
||||||
%strong
|
= f.hidden_field :owned
|
||||||
We don't know anyone who
|
= f.label :quantity, "How many of these do you #{hanger.verb(:you)}?"
|
||||||
- if owned
|
= f.number_field :quantity, :min => 0, :required => true
|
||||||
has this item up for trade.
|
- lists = current_user.closet_lists.where(:hangers_owned => hanger.owned).all
|
||||||
|
- unless lists.empty?
|
||||||
|
= f.collection_select :list_id, lists, :id, :name, :include_blank => 'Not in a list'
|
||||||
|
= f.submit "Save"
|
||||||
|
%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|
|
||||||
|
%p
|
||||||
|
- unless @trading_closet_hangers_by_owned[owned].empty?
|
||||||
|
%strong
|
||||||
|
= pluralize @trading_closet_hangers_by_owned[owned].size, 'user'
|
||||||
|
- if owned
|
||||||
|
- if @trading_closet_hangers_by_owned[owned].size == 1
|
||||||
|
has
|
||||||
- else
|
- else
|
||||||
wants this item.
|
have
|
||||||
%span.toggle
|
this item up for trade:
|
||||||
%span.more more
|
- else
|
||||||
%span.less less
|
- if @trading_closet_hangers_by_owned[owned].size == 1
|
||||||
|
wants
|
||||||
|
- else
|
||||||
|
want
|
||||||
|
this item:
|
||||||
|
= render_trading_closet_hangers(owned)
|
||||||
|
- else
|
||||||
|
%strong
|
||||||
|
We don't know anyone who
|
||||||
|
- if owned
|
||||||
|
has this item up for trade.
|
||||||
|
- else
|
||||||
|
wants this item.
|
||||||
|
%span.toggle
|
||||||
|
%span.more more
|
||||||
|
%span.less less
|
||||||
|
|
||||||
|
|
||||||
#item-preview-header
|
#item-preview-header
|
||||||
%h3 Preview
|
%h3 Preview
|
||||||
%a#customize-more.button{:href => '/'} Customize more
|
%a#customize-more.button{:href => '/'} Customize more
|
||||||
|
|
||||||
#item-preview
|
#item-preview
|
||||||
#item-preview-species= standard_species_images_for(@item)
|
#item-preview-species= standard_species_images_for(@item)
|
||||||
#item-preview-error
|
#item-preview-error
|
||||||
#item-preview-swf
|
#item-preview-swf
|
||||||
Javascript and Flash are required to preview wearables. Sorry!
|
Javascript and Flash are required to preview wearables. Sorry!
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
var CURRENT_ITEM_ZONES_RESTRICT = #{@item.zones_restrict.inspect},
|
var CURRENT_ITEM_ZONES_RESTRICT = #{@item.zones_restrict.inspect},
|
||||||
IMPRESS_HOST = #{RemoteImpressHost.inspect};
|
IMPRESS_HOST = #{RemoteImpressHost.inspect};
|
||||||
|
|
||||||
= include_javascript_libraries :jquery, :swfobject
|
= include_javascript_libraries :jquery, :swfobject
|
||||||
= javascript_include_tag 'items/show'
|
= javascript_include_tag 'items/show'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue