Commit 2ed3c1653db7d072da4e2ce2d55aab184cc5c53a

Authored by Daniela Feitosa
Committed by Antonio Terceiro
1 parent 39ad2a12

ActionItem1057: displaying smallers images on gallery

app/models/uploaded_file.rb
@@ -10,7 +10,7 @@ class UploadedFile < Article @@ -10,7 +10,7 @@ class UploadedFile < Article
10 # :min_size => 2.megabytes 10 # :min_size => 2.megabytes
11 # :max_size => 5.megabytes 11 # :max_size => 5.megabytes
12 has_attachment :storage => :file_system, 12 has_attachment :storage => :file_system,
13 - :thumbnails => { :icon => [24,24], :thumb => '130x130>' }, 13 + :thumbnails => { :icon => [24,24], :thumb => '130x130>', :display => [640,480] },
14 :thumbnail_class => Thumbnail, 14 :thumbnail_class => Thumbnail,
15 :max_size => 5.megabytes 15 :max_size => 5.megabytes
16 16
@@ -50,7 +50,7 @@ class UploadedFile < Article @@ -50,7 +50,7 @@ class UploadedFile < Article
50 include ActionView::Helpers::TagHelper 50 include ActionView::Helpers::TagHelper
51 51
52 def to_html(options = {}) 52 def to_html(options = {})
53 - tag('img', :src => public_filename, :class => css_class_name, :style => 'max-width: 100%') if image? 53 + tag('img', :src => public_filename(:display), :class => css_class_name, :style => 'max-width: 100%') if image?
54 end 54 end
55 55
56 def allow_children? 56 def allow_children?
app/views/content_viewer/slideshow.rhtml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <ul id='slideshow' > 2 <ul id='slideshow' >
3 <% @images.each do |img| -%> 3 <% @images.each do |img| -%>
4 <% if img.image? -%> 4 <% if img.image? -%>
5 - <li><%= image_tag(url_for(img.url), :title => (img.abstract.blank? ? img.name : img.abstract)) %></li> 5 + <li><%= image_tag(url_for(img.public_filename(:display)), :title => (img.abstract.blank? ? img.name : img.abstract)) %></li>
6 <% end -%> 6 <% end -%>
7 <% end unless @images.blank? -%> 7 <% end unless @images.blank? -%>
8 </ul> 8 </ul>