Commit 2422aa404b8c20999696d6304a8f836b9fdef6a5
1 parent
9b89d389
Exists in
master
and in
29 other branches
ActionItem966: adding an ellipsis
That way the user knows that the abstract is clipped.
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/views/content_viewer/image_gallery.rhtml
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | <% @images.each do |a| %> |
9 | 9 | <li class="image-gallery-item"> |
10 | 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 | 12 | </li> |
13 | 13 | <% end %> |
14 | 14 | </ul> | ... | ... |
test/functional/content_viewer_controller_test.rb
... | ... | @@ -846,7 +846,7 @@ class ContentViewerControllerTest < Test::Unit::TestCase |
846 | 846 | |
847 | 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 | 850 | end |
851 | 851 | |
852 | 852 | end | ... | ... |