diff --git a/app/views/search/category_index.rhtml b/app/views/search/category_index.rhtml index c8a83a8..8a201d8 100644 --- a/app/views/search/category_index.rhtml +++ b/app/views/search/category_index.rhtml @@ -1,5 +1,6 @@
+
<%= image_tag(@category.image.public_filename(:thumb), :id => 'category-image') if @category.image %>

<%= _('Category: %s') % @category.name %>

<%= render :partial => 'display_results' %> diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index 5fde6e1..6ea966e 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -173,6 +173,10 @@ div#notice { #view-category { /* none */ } +#category-image { + text-align: center; +} + #categiry-name { margin: 0px; position: relative; diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 3025c4b..dad45d0 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -842,4 +842,13 @@ class SearchControllerTest < Test::Unit::TestCase assert_no_match /Category:/, @response.body end + should 'display category image while in directory' do + parent = Category.create!(:name => 'category1', :environment => Environment.default) + cat = Category.create!(:name => 'category2', :environment => Environment.default, :parent => parent, + :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')} + ) + get :category_index, :category_path => [ 'category1', 'category2' ], :query => 'teste' + assert_tag :tag => 'img', :attributes => { :src => /rails_thumb\.png/ } + end + end -- libgit2 0.21.2