refactor outfits.new for hierarchy

This commit is contained in:
Emi Matchu 2013-01-09 18:40:35 -06:00
parent e54e4c606c
commit e833179155
4 changed files with 94 additions and 71 deletions

View file

@ -6,7 +6,7 @@ module OutfitsHelper
def latest_contribution_description(contribution) def latest_contribution_description(contribution)
user = contribution.user user = contribution.user
contributed = contribution.contributed contributed = contribution.contributed
t 'outfits.new.latest_contribution_description_html', t 'outfits.new.latest_contribution.description_html',
:user_link => link_to(user.name, user_contributions_path(user)), :user_link => link_to(user.name, user_contributions_path(user)),
:contributed_description => contributed_description(contributed, false) :contributed_description => contributed_description(contributed, false)
end end

View file

@ -15,18 +15,18 @@
= origin_tag root_path = origin_tag root_path
= destination_tag 'wardrobe' = destination_tag 'wardrobe'
%fieldset %fieldset
%legend= t '.load_pet_legend' %legend= t '.load_pet.legend'
= pet_name_tag :id => 'main-pet-name' = pet_name_tag :id => 'main-pet-name'
%button{:type => "submit"} %button{:type => "submit"}
= t '.load_pet_submit' = t '.load_pet.submit'
= form_tag wardrobe_path, :method => 'get', :id => 'start-from-scratch' do = form_tag wardrobe_path, :method => 'get', :id => 'start-from-scratch' do
- localized_cache :action_suffix => 'start_from_scratch_form_content' do - localized_cache :action_suffix => 'start_from_scratch_form_content' do
%fieldset %fieldset
%legend= t '.start_from_scratch_legend' %legend= t '.start_from_scratch.legend'
= pet_attribute_select 'color', @colors, 8 = pet_attribute_select 'color', @colors, 8
= pet_attribute_select 'species', @species = pet_attribute_select 'species', @species
%input{:type => "submit", :value => t('.start_from_scratch_submit')} %input{:type => "submit", :value => t('.start_from_scratch.submit')}
%ul#sections %ul#sections
- localized_cache :action_suffix => 'your_items_module' do - localized_cache :action_suffix => 'your_items_module' do
@ -34,40 +34,40 @@
= link_to image_tag('your_items.png'), your_items_path = link_to image_tag('your_items.png'), your_items_path
%h3= link_to t('your_items'), your_items_path %h3= link_to t('your_items'), your_items_path
%div %div
%h4= t '.your_items_tagline' %h4= t '.your_items.tagline'
%p= t '.your_items_description' %p= t '.your_items.description'
= form_tag users_path, :method => 'get' do = form_tag users_path, :method => 'get' do
= text_field_tag 'name', '', :type => 'search', = text_field_tag 'name', '', :type => 'search',
:placeholder => t('.your_items_user_search_placeholder') :placeholder => t('.your_items.user_search.placeholder')
= submit_tag t('.your_items_user_search_submit') = submit_tag t('.your_items.user_search.submit')
- localized_cache :action_suffix => 'infinite_closet_module' do - localized_cache :action_suffix => 'infinite_closet_module' do
%li %li
= link_to image_tag('items.png'), items_path = link_to image_tag('items.png'), items_path
%h3= link_to t('infinite_closet'), items_path %h3= link_to t('infinite_closet'), items_path
%div %div
%h4= t '.infinite_closet_tagline' %h4= t '.infinite_closet.tagline'
%p= t '.infinite_closet_description' %p= t '.infinite_closet.description'
= form_tag items_path, :method => 'get' do = form_tag items_path, :method => 'get' do
= text_field_tag 'q', '', :type => 'search', = text_field_tag 'q', '', :type => 'search',
:placeholder => t('.infinite_closet_item_search_placeholder') :placeholder => t('.infinite_closet.item_search.placeholder')
= submit_tag t('.infinite_closet_item_search_submit') = submit_tag t('.infinite_closet.item_search.submit')
%li %li
= link_to bulk_pets_path do = link_to bulk_pets_path do
= image_tag 'http://images.neopets.com/items/mall_ac_garland_spotlight.gif' = image_tag 'http://images.neopets.com/items/mall_ac_garland_spotlight.gif'
%h3= link_to t('modeling_hub'), bulk_pets_path %h3= link_to t('modeling_hub'), bulk_pets_path
%div %div
%h4= t '.modeling_hub_tagline' %h4= t '.modeling_hub.tagline'
%p= t '.modeling_hub_description' %p= t '.modeling_hub.description'
= form_tag load_pet_path do = form_tag load_pet_path do
= origin_tag root_path = origin_tag root_path
= pet_name_tag :placeholder => t('.modeling_hub_load_pet_placeholder') = pet_name_tag :placeholder => t('.modeling_hub.load_pet.placeholder')
= 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 #latest-contribution
= link_to t('.latest_contribution_header'), contributions_path, :id => 'recent-contributions-link' = link_to t('.latest_contribution.header'), contributions_path, :id => 'recent-contributions-link'
= latest_contribution_description(@latest_contribution) = latest_contribution_description(@latest_contribution)
%abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601} %abbr#latest-contribution-created-at{:title => @latest_contribution.created_at.getutc.iso8601}
@ -78,11 +78,11 @@
%h2 %h2
%div %div
%a#blog-preview-linkback{:href => 'http://blog.openneo.net/'} %a#blog-preview-linkback{:href => 'http://blog.openneo.net/'}
= t '.blog_linkback' = t '.blog.link'
- localized_cache 'outfits#new newest_items' do - localized_cache 'outfits#new newest_items' do
#newest-items #newest-items
%h2= t '.newest_items_header' %h2= t '.newest_items.header'
%ul %ul
- @newest_items.each do |item| - @newest_items.each do |item|
= link_to image_tag(item.thumbnail_url), item = link_to image_tag(item.thumbnail_url), item

View file

@ -590,31 +590,43 @@ en-meep:
new: new:
tagline: Meeps made meepy! tagline: Meeps made meepy!
load_pet_legend: Enter your pet's meep load_pet:
load_pet_submit: Meep my outfit! legend: Enter your pet's meep
start_from_scratch_legend: Or meep from scratch submit: Meep my outfit!
start_from_scratch_submit: Meep start_from_scratch:
your_items_tagline: Meep and meep! legend: Or meep from scratch
your_items_description: submit: Meep
Meep lists of the items you own and want, and meep them with the world. your_items:
your_items_user_search_placeholder: meep a user… tagline: Meep and meep!
your_items_user_search_submit: meep description:
infinite_closet_tagline: Meeping for something? Meep lists of the items you own and want, and meep them with the
infinite_closet_description: Take a meep through our wearables meep! world.
infinite_closet_item_search_placeholder: meep an item… user_search:
infinite_closet_item_search_submit: meep placeholder: meep a user…
modeling_hub_tagline: Found somemeep? submit: meep
modeling_hub_description: infinite_closet:
Meep a pet's meep here and we'll meep a meep of what it's wearing. tagline: Meeping for something?
Thanks so meep! description: Take a meep through our wearables meep!
modeling_hub_load_pet_placeholder: meep a pet… item_search:
modeling_hub_load_pet_submit: meep placeholder: meep an item…
latest_contribution_header: Contribumeeps submit: meep
latest_contribution_description_html: modeling_hub:
"%{user_link} meeped us %{contributed_description}. tagline: Found somemeep?
Meep, %{user_link}!" description:
blog_linkback: OpenNeo Meep Meep a pet's meep here and we'll meep a meep of what it's wearing.
newest_items_header: New Meeps Thanks so meep!
load_pet:
placeholder: meep a pet…
submit: meep
latest_contribution:
header: Contribumeeps
description_html:
"%{user_link} meeped us %{contributed_description}.
Meep, %{user_link}!"
blog:
link: OpenNeo Meep
newest_items:
header: New Meeps
show: show:
default_outfit_name: Meeped outfit default_outfit_name: Meeped outfit

View file

@ -609,32 +609,43 @@ en:
new: new:
tagline: Neopets wearables made easy! tagline: Neopets wearables made easy!
load_pet_legend: Enter your pet's name load_pet:
load_pet_submit: Plan my outfit! legend: Enter your pet's name
start_from_scratch_legend: Or start from scratch submit: Plan my outfit!
start_from_scratch_submit: Go start_from_scratch:
your_items_tagline: Track and trade! legend: Or start from scratch
your_items_description: submit: Go
Make lists of the items you own and want, your_items:
and share them with the world. tagline: Track and trade!
your_items_user_search_placeholder: find a user… description:
your_items_user_search_submit: search Make lists of the items you own and want,
infinite_closet_tagline: Looking for something? and share them with the world.
infinite_closet_description: Take a look through our wearables database! user_search:
infinite_closet_item_search_placeholder: find an item… placeholder: find a user…
infinite_closet_item_search_submit: search submit: search
modeling_hub_tagline: Found something? infinite_closet:
modeling_hub_description: tagline: Looking for something?
Enter a pet's name here and we'll keep a copy of what it's wearing. description: Take a look through our wearables database!
Thanks so much! item_search:
modeling_hub_load_pet_placeholder: model a pet… placeholder: find an item…
modeling_hub_load_pet_submit: submit submit: search
latest_contribution_header: Contributions modeling_hub:
latest_contribution_description_html: tagline: Found something?
"%{user_link} showed us %{contributed_description}. description:
Thanks, %{user_link}!" Enter a pet's name here and we'll keep a copy of what it's wearing.
blog_linkback: OpenNeo Blog Thanks so much!
newest_items_header: New Items load_pet:
placeholder: model a pet…
submit: submit
latest_contribution:
header: Contributions
description_html:
"%{user_link} showed us %{contributed_description}.
Thanks, %{user_link}!"
blog:
link: OpenNeo Blog
newest_items:
header: New Items
show: show:
default_outfit_name: Shared outfit default_outfit_name: Shared outfit