diff --git a/app/views/content_viewer/_uploaded_file.rhtml b/app/views/content_viewer/_uploaded_file.rhtml
index cd1cdb4..40979ef 100644
--- a/app/views/content_viewer/_uploaded_file.rhtml
+++ b/app/views/content_viewer/_uploaded_file.rhtml
@@ -1,5 +1,5 @@
<% if uploaded_file.image? %>
-
<%= link_to image_tag(uploaded_file.public_filename(:thumb)), uploaded_file.view_url %>
+ <%= link_to image_tag(uploaded_file.public_filename(:thumb), :title => uploaded_file.abstract), uploaded_file.view_url %>
<% else %>
<%= render :partial => 'article', :object => uploaded_file %>
<% end %>
diff --git a/app/views/content_viewer/image_gallery.rhtml b/app/views/content_viewer/image_gallery.rhtml
index 1068ee3..1aa1e01 100644
--- a/app/views/content_viewer/image_gallery.rhtml
+++ b/app/views/content_viewer/image_gallery.rhtml
@@ -2,14 +2,13 @@
<%= @page.body %>
-
<%= button(:slideshow, _('View slideshow'), @page.url.merge(:slideshow => true))%>
<% @images.each do |a| %>
-
<%= render :partial => partial_for_class(a.class), :object => a %>
- <%= a.abstract %>
+ <%= a.abstract && a.abstract.first(40) %>
<% end %>
diff --git a/public/stylesheets/folder.css b/public/stylesheets/folder.css
index 1306fbd..ae58e09 100644
--- a/public/stylesheets/folder.css
+++ b/public/stylesheets/folder.css
@@ -11,7 +11,7 @@
.image-gallery-item {
width: 142px;
- height: 154px;
+ height: 170px;
list-style: none;
margin: 5px;
float: left;
diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb
index 3d32356..a41be2c 100644
--- a/test/functional/content_viewer_controller_test.rb
+++ b/test/functional/content_viewer_controller_test.rb
@@ -835,4 +835,18 @@ class ContentViewerControllerTest < Test::Unit::TestCase
get :view_page, :profile => profile.identifier, :page => blog_post.explode_path
assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/}
end
+
+ should 'show only first 40 chars of abstract in image gallery' do
+ login_as(profile.identifier)
+ folder = Folder.create!(:name => 'gallery', :profile => profile, :view_as => 'image_gallery')
+ file = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
+
+ file.abstract = 'a long abstract bigger then 40 chars for testing'
+ file.save!
+
+ get :view_page, :profile => profile.identifier, :page => folder.explode_path
+
+ assert_tag :tag => 'li', :attributes => {:class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'a long abstract bigger then 40 chars for'}
+ end
+
end
--
libgit2 0.21.2