Skip to content

Commit

Permalink
caching x-files
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscou committed Dec 3, 2013
1 parent caaa3c0 commit c1c7a55
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/mobile_views/categories/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% title "Catálogo" %>
<% cache [ I18n.locale, :mobile, new_arrivals_cache_key ] do %>
<h2>Categorías destacadas</h2>
<h2 data-generated-at="<%= Time.current.to_s(:db) %>">Categorías destacadas</h2>

<% if Product.new_arrivals.any? %>
<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">
Expand All @@ -22,7 +22,7 @@
<% end %>
<% cache [ I18n.locale, :mobile, all_categories_cache_key ] do %>
<h2>Todas las categorías</h2>
<h2 data-generated-at="<%= Time.current.to_s(:db) %>">Todas las categorías</h2>

<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">
<% @categories.each do |category| %>
Expand Down
6 changes: 3 additions & 3 deletions app/mobile_views/pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<h2>Productos destacados</h2>

<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-3">
<% cache [ I18n.locale, :mobile, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<% cache [ I18n.locale, :mobile, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-3" data-generated-at="<%= Time.current.to_s(:db) %>">
<% @products.each do |product| %>
<%= content_tag_for :li, product do %>
<h3><%= link_to product.name, category_products_path(product.category, anchor: product.to_param) %></h2>
Expand All @@ -16,7 +16,7 @@
<%= simple_format product.description %>
<% end %>
<% end%>
<% end%>
</ul>
<% end%>

<p><%= link_to "Ver más productos", categories_path, class: "button radius expand" %></p>
4 changes: 2 additions & 2 deletions app/views/categories/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<% cache [ I18n.locale, new_arrivals_cache_key ] do %>
<% if Product.new_arrivals.any? %>
<div class="title">
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span>Categorías destacadas</span></h2>
</div>

Expand All @@ -24,7 +24,7 @@
<% end %>
<% cache [ I18n.locale, all_categories_cache_key ] do %>
<div class="title">
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span>Todas las categorías</span></h2>
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/pages/home.en.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div id="two-columns">
<div id="column1">
<div id="box3" class="box-style">
<div class="title">
<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span>Highlighted products</span></h2>
</div>

<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<% @products.each do |product| %>
<%= div_for product, :class => "item-box hproduct" do %>
<h2 class="fn"><%= link_to product.name, category_products_path(product.category, :anchor => product.to_param) %></h2>
Expand All @@ -19,12 +19,12 @@
<p>In the <%= link_to product.category.name, category_products_path(product.category), :class => "category" %> category</p>
<%= simple_format product.description, :class => "description" %>
<% end %>
<% end%>
<% end%>

<div class="content">
<p><%= link_to "See more products", categories_path, :class => "link1 big" %></p>
</div>
<% end%>
</div>
</div>
<div id="column2">
Expand Down
6 changes: 3 additions & 3 deletions app/views/pages/home.es.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div id="two-columns">
<div id="column1">
<div id="box3" class="box-style">
<div class="title">
<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span>Productos destacados</span></h2>
</div>

<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<% @products.each do |product| %>
<%= div_for product, :class => "item-box hproduct" do %>
<h2 class="fn"><%= link_to product.name, category_products_path(product.category, :anchor => product.to_param) %></h2>
Expand All @@ -20,11 +20,11 @@
<%= simple_format product.description, :class => "description" %>
<% end %>
<% end%>
<% end %>

<div class="content">
<p><%= link_to "Ver más productos", categories_path, :class => "link1 big" %></p>
</div>
<% end %>
</div>
</div>
<div id="column2">
Expand Down
6 changes: 3 additions & 3 deletions app/views/pages/home.fr.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div id="two-columns">
<div id="column1">
<div id="box3" class="box-style">
<div class="title">
<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span>Productos destacados</span></h2>
</div>

<% cache [ I18n.locale, "home_featured_products" ], expires_in: 1.hour, race_condition_ttl: 10 do %>
<% @products.each do |product| %>
<%= div_for product, :class => "item-box hproduct" do %>
<h2 class="fn"><%= link_to product.name, category_products_path(product.category, :anchor => product.to_param) %></h2>
Expand All @@ -19,12 +19,12 @@
<p>En la categoría de <%= link_to product.category.name, category_products_path(product.category), :class => "category" %></p>
<%= simple_format product.description, :class => "description" %>
<% end %>
<% end%>
<% end%>

<div class="content">
<p><%= link_to "Ver más productos", categories_path, :class => "link1 big" %></p>
</div>
<% end%>
</div>
</div>
<div id="column2">
Expand Down
6 changes: 3 additions & 3 deletions app/views/shared/_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="sidebar">
<div id="box1" class="box-style">
<% cache [ I18n.locale, sidebar_highlighted_categories_cache_key ] do %>
<div class="title">
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span><%= t ".highlighted_categories" %></span></h2>
</div>
<div class="content">
Expand All @@ -17,7 +17,7 @@
</div>
<div id="box2" class="box-style">
<% cache [ I18n.locale, sidebar_all_categories_cache_key ] do %>
<div class="title">
<div class="title" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span><%= t ".all_categories" %></span></h2>
</div>
<div class="content">
Expand All @@ -29,7 +29,7 @@
</div>
<% end %>
<% cache [ I18n.locale, sidebar_decorations_cache_key ] do %>
<div class="title decorations">
<div class="title decorations" data-generated-at="<%= Time.current.to_s(:db) %>">
<h2><span><%= t ".decorations" %></span></h2>
</div>
<div class="content">
Expand Down

0 comments on commit c1c7a55

Please sign in to comment.