refactor items.show for hierarchy and twl

This commit is contained in:
Emi Matchu 2013-01-09 18:05:06 -06:00
parent 04679bfd00
commit abd327f08e
3 changed files with 78 additions and 66 deletions

View file

@ -9,17 +9,17 @@
= nc_icon_for(@item) = nc_icon_for(@item)
- unless @item.rarity.blank? - unless @item.rarity.blank?
== #{t '.rarity'}: #{@item.rarity_index} (#{@item.rarity}) == #{t '.rarity'}: #{@item.rarity_index} (#{@item.rarity})
= link_to t('.jn_items'), jn_items_url_for(@item) = link_to t('.resources.jn_items'), jn_items_url_for(@item)
- unless @item.nc? - unless @item.nc?
= link_to t('.shop_wizard'), shop_wizard_url_for(@item) = link_to t('.resources.shop_wizard'), shop_wizard_url_for(@item)
= link_to t('.super_shop_wizard'), super_shop_wizard_url_for(@item) = link_to t('.resources.super_shop_wizard'), super_shop_wizard_url_for(@item)
= link_to t('.trading_post'), trading_post_url_for(@item) = link_to t('.resources.trading_post'), trading_post_url_for(@item)
= link_to t('.auction_genie'), auction_genie_url_for(@item) = link_to t('.resources.auction_genie'), auction_genie_url_for(@item)
- if user_signed_in? - if user_signed_in?
#closet-hangers #closet-hangers
%h3 %h3
= t '.hangers_header_html', = t '.closet_hangers.header_html',
:user_items_link => link_to(t('your_items'), :user_items_link => link_to(t('your_items'),
user_closet_hangers_path(current_user)) user_closet_hangers_path(current_user))
= form_tag update_quantities_user_item_closet_hangers_path(:user_id => current_user, :item_id => @item), :method => :put do = form_tag update_quantities_user_item_closet_hangers_path(:user_id => current_user, :item_id => @item), :method => :put do
@ -43,20 +43,21 @@
t('closet_lists.unlisted_name'), t('closet_lists.unlisted_name'),
:class => 'unlisted' :class => 'unlisted'
- else - else
= label_tag "quantity[#{owned}]", t('.quantity_label') = label_tag "quantity[#{owned}]",
= submit_tag t('.submit_hangers') t('.closet_hangers.quantity_label')
= submit_tag t('.closet_hangers.submit')
- localized_cache "items/#{@item.id} info" do - localized_cache "items/#{@item.id} info" do
%p= @item.description %p= @item.description
#item-zones #item-zones
%p %p
%strong #{t '.occupied_zones_header'}: %strong #{t '.zones.occupied_header'}:
= list_zones @item.occupied_zones, :uncertain_label = list_zones @item.occupied_zones, :uncertain_label
%p %p
%strong #{t '.restricted_zones_header'}: %strong #{t '.zones.restricted_header'}:
- if @item.restricted_zones.empty? - if @item.restricted_zones.empty?
= t '.no_restricted_zones' = t '.zones.none'
- else - else
= list_zones @item.restricted_zones = list_zones @item.restricted_zones
@ -72,34 +73,33 @@
- localized_cache 'items#show preview_header' do - localized_cache 'items#show preview_header' do
#item-preview-header #item-preview-header
%h3= t '.preview_header' %h3= t '.preview.header'
= link_to t('.customize_more'), root_path, :id => 'customize-more', = link_to t('.preview.customize_more'), root_path, :id => 'customize-more',
:class => 'button' :class => 'button'
#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= t '.preview_requirements_not_met' #item-preview-swf= t '.preview.requirements_not_met'
- localized_cache "items/#{@item.id} contributors" do - localized_cache "items/#{@item.id} contributors" do
- unless @contributors_with_counts.empty? - unless @contributors_with_counts.empty?
#item-contributors #item-contributors
%header #{t '.contributors_header'}: %header #{t '.contributors.header'}:
%ul %ul
- @contributors_with_counts.each do |contributor, count| - @contributors_with_counts.each do |contributor, count|
%li= link_to(contributor.name, user_contributions_path(contributor)) + format_contribution_count(count) %li= link_to(contributor.name, user_contributions_path(contributor)) + format_contribution_count(count)
%footer= t '.contributors_footer' %footer= t '.contributors.footer'
: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};
%script#swf-assets-not-found-template{:type => 'text/x-jquery-tmpl'} %script#swf-assets-not-found-template{:type => 'text/x-jquery-tmpl'}
= t '.swf_assets_not_found_html', :item_name => h(@item.name), = twl '.preview.not_found', :item_name => h(@item.name),
:species_name => '${species_name}', :species_name => '${species_name}',
:color_name => '${color_name}', :color_name => '${color_name}',
:modeling_link => link_to(t('.swf_assets_not_found_modeling_link_content'), :modeling_link_url => root_path
root_path)
- content_for :javascripts do - content_for :javascripts do
= include_javascript_libraries :jquery, :swfobject, :jquery_tmpl = include_javascript_libraries :jquery, :swfobject, :jquery_tmpl

View file

@ -283,17 +283,20 @@ en-meep:
show: show:
rarity: Meepity rarity: Meepity
jn_items: JN Meepits resources:
shop_wizard: Meep Wizard jn_items: JN Meepits
super_shop_wizard: Meeper Wizard shop_wizard: Meep Wizard
trading_post: Treeps super_shop_wizard: Meeper Wizard
auction_genie: Aucteeps trading_post: Treeps
hangers_header_html: Meep this in %{user_items_link} auction_genie: Aucteeps
quantity_label: How meepy? closet_hangers:
submit_hangers: Save to Your Meeps header_html: Meep this in %{user_items_link}
occupied_zones_header: Occupeeps quantity_label: How meepy?
restricted_zones_header: Restreeps submit: Save to Your Meeps
no_restricted_zones: Meepless zones:
occupied_header: Occupeeps
restricted_header: Restreeps
none: Meepless
trading_closet_hangers: trading_closet_hangers:
header: header:
owned: owned:
@ -306,17 +309,20 @@ en-meep:
other: "%{count} users meep this item:" other: "%{count} users meep this item:"
show_more: meep more show_more: meep more
show_less: meep less show_less: meep less
preview_header: Meepview preview:
customize_more: Customize meep header: Meepview
preview_requirements_not_met: customize_more: Customize meep
Javascript and Flash are required to preview meepits. Meep! requirements_not_met:
contributors_header: Meeped to you by Javascript and Flash are required to preview meepits. Meep!
contributors_footer: Meep! not_found:
swf_assets_not_found_html: main_html:
We've never meeped the %{item_name} on the %{color_name} We've never meeped the %{item_name} on the %{color_name}
%{species_name} before. Have you? If so, please %{modeling_link} and %{species_name} before. Have you? If so, please %{modeling_link} and
we'll meep our datameep instantly. Meep! we'll meep our datameep instantly. Meep!
swf_assets_not_found_modeling_link_content: meep it for us modeling_link_content: meep it for us
contributors:
header: Meeped to you by
footer: Meep!
neopets_pages: neopets_pages:
create: create:

View file

@ -284,17 +284,20 @@ en:
show: show:
rarity: Rarity rarity: Rarity
jn_items: JN Items resources:
shop_wizard: Shop Wizard jn_items: JN Items
super_shop_wizard: Super Wizard shop_wizard: Shop Wizard
trading_post: Trades super_shop_wizard: Super Wizard
auction_genie: Auctions trading_post: Trades
hangers_header_html: Track this in %{user_items_link} auction_genie: Auctions
quantity_label: How many? closet_hangers:
submit_hangers: Save to Your Items header_html: Track this in %{user_items_link}
occupied_zones_header: Occupies quantity_label: How many?
restricted_zones_header: Restricts submit: Save to Your Items
no_restricted_zones: None zones:
occupied_header: Occupies
restricted_header: Restricts
none: None
trading_closet_hangers: trading_closet_hangers:
header: header:
owned: owned:
@ -307,17 +310,20 @@ en:
other: "%{count} users want this item:" other: "%{count} users want this item:"
show_more: more show_more: more
show_less: less show_less: less
preview_header: Preview preview:
customize_more: Customize more header: Preview
preview_requirements_not_met: customize_more: Customize more
Javascript and Flash are required to preview wearables. Sorry! requirements_not_met:
contributors_header: Brought to you by Javascript and Flash are required to preview wearables.
contributors_footer: Thanks! not_found:
swf_assets_not_found_html: main_html:
We've never seen the %{item_name} on the %{color_name} We've never seen the %{item_name} on the %{color_name}
%{species_name} before. Have you? If so, please %{modeling_link} and %{species_name} before. Have you? If so, please %{modeling_link} and
we'll update our database instantly. Thanks! we'll update our database instantly. Thanks!
swf_assets_not_found_modeling_link_content: model it for us modeling_link_content: model it for us
contributors:
header: Brought to you by
footer: Thanks!
neopets_pages: neopets_pages:
create: create: