<% 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(' → ')
+
<%= _('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
%>
- <% end %>
+ <% 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:') %>
+
<%= _('Select a category:') %>
<% elsif !@categories.empty? %>
-
<%= _('Select a subcategory:') %>
+
<%= _('Select a subcategory:') %>
<% end %>
<% for category in @categories do %>
@@ -32,3 +32,4 @@
:class => 'select-subcategory-link'
%>
<% end %>
+
diff --git a/db/schema.rb b/db/schema.rb
index 955bfc4..5c11da1 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -71,8 +71,8 @@ ActiveRecord::Schema.define(:version => 45) do
t.boolean "virtual", :default => false
end
- add_index "articles_categories", ["article_id"], :name => "index_articles_categories_on_article_id"
add_index "articles_categories", ["category_id"], :name => "index_articles_categories_on_category_id"
+ add_index "articles_categories", ["article_id"], :name => "index_articles_categories_on_article_id"
create_table "blocks", :force => true do |t|
t.string "title"
@@ -230,8 +230,8 @@ ActiveRecord::Schema.define(:version => 45) do
t.datetime "created_at"
end
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type"
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
create_table "tags", :force => true do |t|
t.string "name"
diff --git a/public/images/icons-cat/Produtos_Alimentação.png b/public/images/icons-cat/Produtos_Alimentação.png
new file mode 100644
index 0000000..fdf63bf
Binary files /dev/null and b/public/images/icons-cat/Produtos_Alimentação.png differ
diff --git a/public/images/icons-cat/Produtos_Software.png b/public/images/icons-cat/Produtos_Software.png
new file mode 100644
index 0000000..048da5b
Binary files /dev/null and b/public/images/icons-cat/Produtos_Software.png differ
diff --git a/public/images/icons-cat/Produtos_Software_Livre.png b/public/images/icons-cat/Produtos_Software_Livre.png
new file mode 100644
index 0000000..02e6608
Binary files /dev/null and b/public/images/icons-cat/Produtos_Software_Livre.png differ
diff --git a/public/images/icons-cat/undefined.png b/public/images/icons-cat/undefined.png
new file mode 100644
index 0000000..a8ac82a
Binary files /dev/null and b/public/images/icons-cat/undefined.png differ
diff --git a/public/stylesheets/blocks/profile-info-block.css b/public/stylesheets/blocks/profile-info-block.css
index ac7f972..d3f157a 100644
--- a/public/stylesheets/blocks/profile-info-block.css
+++ b/public/stylesheets/blocks/profile-info-block.css
@@ -71,10 +71,6 @@
display: none;
}
-.product-categories {
- clear: both;
-}
-
.profile-info-data {
width: 110px;
font-size: 10px;
diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css
index e61a0ec..a5e7bd6 100644
--- a/public/stylesheets/common.css
+++ b/public/stylesheets/common.css
@@ -224,12 +224,8 @@ table {
}
th, td {
font-size: 14px;
- border: 1px solid #999999;
- padding: 2px;
}
th {
- background: #f0f0f0;
- color: black;
font-weight: bold;
}
@@ -293,3 +289,57 @@ div.sitemap-item a:hover {
color: red;
}
+
+/* * * icons for product category on profile * * */
+
+#content .product-category-icons {
+ position: absolute;
+ top: 1px;
+ right: 1px;
+}
+#content .profile-list-block .product-category-icons,
+#content .search-results-innerbox .product-category-icons {
+ top: 3px;
+ right: 3px;
+}
+
+#content .product-category-icons .header,
+#content .product-cat-icon span {
+ display: none;
+}
+
+#content .product-cat-icon {
+ display: block;
+ width: 13px;
+ height: 13px;
+ margin-bottom: 1px;
+}
+
+
+/* * * category ajax selector * * */
+
+#category-ajax-selector {
+ border: 1px solid #AAA;
+ background: #EEE;
+ padding: 15px 0px 15px 20px;
+ margin: 30px 0px 0px 0px;
+ position: relative;
+}
+
+#category-ajax-selector h3 {
+ margin: 10px 0px;
+ font-size: 100%;
+}
+
+#category-ajax-selector .box-title {
+ position: absolute;
+ top: -30px;
+ left: 30px;
+ line-height: 19px;
+ padding: 0px 10px;
+ border: 1px solid #AAA;
+ border-bottom: none;
+ background: #EEE;
+ float: left;
+}
+
diff --git a/test/functional/manage_products_controller_test.rb b/test/functional/manage_products_controller_test.rb
index 12abc31..e5d2615 100644
--- a/test/functional/manage_products_controller_test.rb
+++ b/test/functional/manage_products_controller_test.rb
@@ -118,7 +118,7 @@ class ManageProductsControllerTest < Test::Unit::TestCase
category2 = ProductCategory.create!(:name => 'Category 2', :environment => environment, :parent => category1)
category3 = ProductCategory.create!(:name => 'Category 3', :environment => environment, :parent => category2)
get :new, :profile => @enterprise.identifier
- assert_tag :tag => 'p', :content => /Select a category:/, :sibling => { :tag => 'a', :content => /#{category2.name}/ }
+ assert_tag :tag => 'h3', :content => /Select a category:/, :sibling => { :tag => 'a', :content => /#{category2.name}/ }
end
should 'show current category' do
@@ -127,7 +127,7 @@ class ManageProductsControllerTest < Test::Unit::TestCase
category2 = ProductCategory.create!(:name => 'Category 2', :environment => environment, :parent => category1)
category3 = ProductCategory.create!(:name => 'Category 3', :environment => environment, :parent => category2)
get 'update_subcategories', :profile => @enterprise.identifier, :id => category2.id
- assert_tag :tag => 'p', :content => /Current category:/, :sibling => { :tag => 'a', :content => /#{category3.name}/ }
+ assert_tag :tag => 'h3', :content => /Current category:/, :sibling => { :tag => 'a', :content => /#{category3.name}/ }
end
should 'show subcategories list' do
@@ -137,7 +137,7 @@ class ManageProductsControllerTest < Test::Unit::TestCase
category3 = ProductCategory.create!(:name => 'Category 3', :environment => environment, :parent => category2)
get 'update_subcategories', :profile => @enterprise.identifier, :id => category2.id
assert !assigns(:categories).empty?
- assert_tag :tag => 'p', :content => /Select a subcategory:/, :sibling => { :tag => 'a', :attributes => { :href => '#' }, :content => /#{category2.name}/ }
+ assert_tag :tag => 'h3', :content => /Select a subcategory:/, :sibling => { :tag => 'a', :attributes => { :href => '#' }, :content => /#{category2.name}/ }
end
should 'update subcategories' do
--
libgit2 0.21.2