Commit aa5adc62242f91f3cf7316deaf04b4b8d8d1b959

Authored by JoenioCosta
1 parent 789e8e48

ActionItem266: add link to back to parent category

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1655 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/manage_products/_subcategories.rhtml
1 1 <p><%= _('Current category:') %></p>
2   -<%= hidden_field_tag 'product[product_category_id]', @current_category.id %>
  2 +<%= hidden_field_tag 'product[product_category_id]', @current_category ? @current_category.id : nil %>
3 3 <%
4 4 categories = [@current_category]
5 5 categories.push(@current_category) while @current_category and @current_category = @current_category.parent
6 6 %>
7   -<%= categories.compact.reverse.map{|i| link_to(i.name, {}, :class => 'select-current-category-link')}.join(' &rarr; ') %>
  7 +<%= categories.compact.reverse.map{|i|
  8 + link_to_remote(i.name,
  9 + :update => "subcategories",
  10 + :url => { :action => 'update_subcategories', :id => i, :loaded => visual_effect(:highlight, "subcategories") },
  11 + :class => 'select-current-category-link')}.join(' &rarr; ')
  12 +%>
8 13  
9 14 <% unless @categories.empty? %>
10 15 <p><%= _('Select a subcategory:') %></p>
... ...