From 27983b880fdb70336ed1fb0623b5cbb9654fb29d Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Mon, 14 Jul 2008 20:29:05 +0000 Subject: [PATCH] ActionItem498: oops! add view _subcategories.rhtml --- app/views/manage_products/_subcategories.rhtml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+), 0 deletions(-) create mode 100644 app/views/manage_products/_subcategories.rhtml diff --git a/app/views/manage_products/_subcategories.rhtml b/app/views/manage_products/_subcategories.rhtml new file mode 100644 index 0000000..c6f58ac --- /dev/null +++ b/app/views/manage_products/_subcategories.rhtml @@ -0,0 +1,34 @@ +<% if !@current_category.nil? and !@current_category.top_level? %> + +

<%= _('Current category:') %>

+ <%= hidden_field_tag 'product[product_category_id]', @current_category.id %> + <% + categories = [@current_category] + categories.push(@current_category) while @current_category = @current_category.parent + categories.last.name = _('Back') + %> + <% if categories.size > 1 %> + <%= categories.compact.reverse.map{|i| + link_to_remote(i.name, + :update => "subcategories", + :url => { :action => 'update_subcategories', :id => i, :loaded => visual_effect(:highlight, "subcategories") }, + :class => 'select-current-category-link')}.join(' → ') + %> + <% end %> + +<% end %> + +<% if @current_category %> +

<%= _('Select a category:') %>

+<% elsif !@categories.empty? %> +

<%= _('Select a subcategory:') %>

+<% end %> + +<% for category in @categories do %> + <%= link_to_remote category.name, { + :update => "subcategories", + :url => { :action => "update_subcategories", :id => category.id }, + :loaded => visual_effect(:highlight, "subcategories") }, + :class => 'select-subcategory-link' + %> +<% end %> -- libgit2 0.21.2