Commit 2422aa404b8c20999696d6304a8f836b9fdef6a5

Authored by Antonio Terceiro
1 parent 9b89d389

ActionItem966: adding an ellipsis

That way the user knows that the abstract is clipped.
app/views/content_viewer/image_gallery.rhtml
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 <% @images.each do |a| %> 8 <% @images.each do |a| %>
9 <li class="image-gallery-item"> 9 <li class="image-gallery-item">
10 <%= render :partial => partial_for_class(a.class), :object => a %> 10 <%= render :partial => partial_for_class(a.class), :object => a %>
11 - <span><%= a.abstract && a.abstract.first(40) %></span> 11 + <span><%= a.abstract && (a.abstract.first(40) + (a.abstract.size > 40 ? '…' : ''))%></span>
12 </li> 12 </li>
13 <% end %> 13 <% end %>
14 </ul> 14 </ul>
test/functional/content_viewer_controller_test.rb
@@ -846,7 +846,7 @@ class ContentViewerControllerTest &lt; Test::Unit::TestCase @@ -846,7 +846,7 @@ class ContentViewerControllerTest &lt; Test::Unit::TestCase
846 846
847 get :view_page, :profile => profile.identifier, :page => folder.explode_path 847 get :view_page, :profile => profile.identifier, :page => folder.explode_path
848 848
849 - assert_tag :tag => 'li', :attributes => {:class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'a long abstract bigger then 40 chars for'} 849 + assert_tag :tag => 'li', :attributes => {:class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'a long abstract bigger then 40 chars for'}
850 end 850 end
851 851
852 end 852 end