Commit ad2520f9902b6df850167b377a431b64199af32d
1 parent
0baf2a29
Exists in
master
and in
28 other branches
ActionItem348: display the image in category index
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1823 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
14 additions
and
0 deletions
Show diff stats
app/views/search/category_index.rhtml
1 | 1 | <div id="view-category"> |
2 | 2 | |
3 | + <div id="category-image"><%= image_tag(@category.image.public_filename(:thumb), :id => 'category-image') if @category.image %></div> | |
3 | 4 | <h1 id="category-name"><%= _('Category: %s') % @category.name %></h1> |
4 | 5 | |
5 | 6 | <%= render :partial => 'display_results' %> | ... | ... |
public/stylesheets/common.css
test/functional/search_controller_test.rb
... | ... | @@ -842,4 +842,13 @@ class SearchControllerTest < Test::Unit::TestCase |
842 | 842 | assert_no_match /Category:/, @response.body |
843 | 843 | end |
844 | 844 | |
845 | + should 'display category image while in directory' do | |
846 | + parent = Category.create!(:name => 'category1', :environment => Environment.default) | |
847 | + cat = Category.create!(:name => 'category2', :environment => Environment.default, :parent => parent, | |
848 | + :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')} | |
849 | + ) | |
850 | + get :category_index, :category_path => [ 'category1', 'category2' ], :query => 'teste' | |
851 | + assert_tag :tag => 'img', :attributes => { :src => /rails_thumb\.png/ } | |
852 | + end | |
853 | + | |
845 | 854 | end | ... | ... |