refactor items.index for hierarchy and twl

This commit is contained in:
Emi Matchu 2013-01-09 17:48:01 -06:00
parent 4bf73b4285
commit 0cbdc30a15
3 changed files with 84 additions and 68 deletions

View file

@ -2,8 +2,7 @@
- title t('.title_with_query', :query => @query) - title t('.title_with_query', :query => @query)
- if @items.empty? - if @items.empty?
%p= t '.no_results_html', :query_html => content_tag(:strong, @query) %p= t '.no_results_html', :query_html => content_tag(:strong, @query)
%p= t '.modeling_request_html', %p= twl '.modeling_request', :modeling_link_url => root_path
:modeling_link => link_to(t('.modeling_link_content'), root_path)
- else - else
= will_paginate @items = will_paginate @items
= render @items = render @items
@ -14,29 +13,28 @@
#search-help #search-help
%h2= t '.search_help_header' %h2= t '.search_help_header'
%dl %dl
%dt= t '.basic_example_query' %dt= t '.examples.basic.query'
%dd= t '.basic_example_description' %dd= t '.examples.basic.description'
%dt= t '.user_items_example_query' %dt= t '.examples.user_items.query'
%dd %dd
= t '.user_items_example_description_html', = twl '.examples.user_items.description',
:user_items_link => link_to(t('.user_items_example_link_content'), :user_items_link_url => your_items_path
your_items_path) %dt= t '.examples.nc.query'
%dt= t '.nc_example_query' %dd= t '.examples.nc.description'
%dd= t '.nc_example_description' %dt= t '.examples.pb.query'
%dt= t '.pb_example_query' %dd= t '.examples.pb.description'
%dd= t '.pb_example_description' %dt= t '.examples.species.query'
%dt= t '.species_example_query' %dd= t '.examples.species.description'
%dd= t '.species_example_description' %dt= t '.examples.type.query'
%dt= t '.type_example_query' %dd= t '.examples.type.description'
%dd= t '.type_example_description'
- localized_cache 'items#index newest_items' do - localized_cache 'items#index newest_items' do
#search-new-items #search-new-items
%h2= t '.newest_items_header' %h2= t '.newest_items.header'
= render @newest_items = render @newest_items
- localized_cache :action_suffix => 'species_search_links' do - localized_cache :action_suffix => 'species_search_links' do
#species-search-links #species-search-links
%h2= t '.species_search_header' %h2= t '.species_search.header'
= standard_species_search_links = standard_species_search_links

View file

@ -234,32 +234,41 @@ en-meep:
no_results_html: no_results_html:
We couldn't meep any wearables that meeped %{query_html}. We couldn't meep any wearables that meeped %{query_html}.
Meep! Meep!
modeling_request_html: modeling_request:
Are we meeping something? To meep an item to our database, just main_html:
%{modeling_link}, and we'll meep our database instantly. Meep! Are we meeping something? To meep an item to our database, just
modeling_link_content: meep us a pet who is meeping it %{modeling_link}, and we'll meep our database instantly. Meep!
modeling_link_content: meep us a pet who is meeping it
search_help_header: Find what you're meeping for search_help_header: Find what you're meeping for
basic_example_query: kreludor "altador cup" -background examples:
basic_example_description: basic:
returns any item with the meep "kreludor" and the meep "altador cup" query: kreludor "altador cup" -background
in it, but not the meep "background" description:
user_items_example_query: hat user:owns returns any item with the meep "kreludor" and the meep "altador
user_items_example_description_html: cup" in it, but not the meep "background"
returns %{user_items_link} with the meep "hat" user_items:
user_items_example_link_content: items that you meep query: hat user:owns
nc_example_query: blue is:nc description:
nc_example_description: main_html: returns %{user_items_link} with the meep "hat"
returns any NC Meep item with the meep "blue" in it user_items_link_content: items that you meep
pb_example_query: collar -is:pb nc:
pb_example_description: query: blue is:nc
returns any item with the meep "collar" in it that isn't from a paint description: returns any NC Meep item with the meep "blue" in it
brush pb:
species_example_query: species:shoyru query: collar -is:pb
species_example_description: returns any item a Shoyru can meep description:
type_example_query: type:hat returns any item with the meep "collar" in it that isn't from a
type_example_description: returns any item that fills a "hat" meep paint brush
newest_items_header: New Meeps species:
species_search_header: Can't decide? Meep by species query: species:shoyru
description: returns any item a Shoyru can meep
type:
query: type:hat
description: returns any item that fills a "hat" meep
newest_items:
header: New Meeps
species_search:
header: Can't decide? Meep by species
item: item:
nc: nc:

View file

@ -235,32 +235,41 @@ en:
no_results_html: no_results_html:
We couldn't find any wearables that matched %{query_html}. We couldn't find any wearables that matched %{query_html}.
Sorry! Sorry!
modeling_request_html: modeling_request:
Are we missing something? To add an item to our database, just main_html:
%{modeling_link}, and we'll update our database instantly. Thanks! Are we missing something? To add an item to our database, just
modeling_link_content: show us a pet who is wearing it %{modeling_link}, and we'll update our database instantly. Thanks!
modeling_link_content: show us a pet who is wearing it
search_help_header: Find what you're looking for search_help_header: Find what you're looking for
basic_example_query: kreludor "altador cup" -background examples:
basic_example_description: basic:
returns any item with the word "kreludor" and the phrase "altador cup" query: kreludor "altador cup" -background
in it, but not the word "background" description:
user_items_example_query: hat user:owns returns any item with the word "kreludor" and the phrase "altador
user_items_example_description_html: cup" in it, but not the word "background"
returns %{user_items_link} with the word "hat" user_items:
user_items_example_link_content: items that you own query: hat user:owns
nc_example_query: blue is:nc description:
nc_example_description: main_html: returns %{user_items_link} with the word "hat"
returns any NC Mall item with the word "blue" in it user_items_link_content: items you own
pb_example_query: collar -is:pb nc:
pb_example_description: query: blue is:nc
returns any item with the word "collar" in it that isn't from a paint description: returns any NC Mall item with the word "blue" in it
brush pb:
species_example_query: species:shoyru query: collar -is:pb
species_example_description: returns any item a Shoyru can wear description:
type_example_query: type:hat returns any item with the word "collar" in it that isn't from a
type_example_description: returns any item that fills a "hat" zone paint brush
newest_items_header: Newest items species:
species_search_header: Can't decide? Search by species query: species:shoyru
description: returns any item a Shoyru can wear
type:
query: type:hat
description: returns any item that fills a "hat" zone
newest_items:
header: Newest items
species_search:
header: Can't decide? Search by species
item: item:
nc: nc: