Commit 6dbc93fdcaee3ab13521929d0033386387d26511

Authored by Rodrigo Souto
1 parent 4d9daa44
Exists in staging

Revert "search: use first image of article if present"

This reverts commit 8f98bc64446aa44d5a3a75be24bb69fbb7c88495.
Showing 1 changed file with 1 additions and 3 deletions   Show diff stats
app/views/search/_image.html.erb
... ... @@ -26,7 +26,7 @@
26 26 <% end %>
27 27 <% elsif image.is_a? Gallery %>
28 28 <div class="search-gallery-items">
29   - <% r = image.children.latest.images.limit(3) %>
  29 + <% r = image.children.order(:updated_at).where('type = ?', 'UploadedFile').last(3) %>
30 30 <% if r.length > 0 %>
31 31 <% r.each_index do |i| img = r[i] %>
32 32 <%= link_to '', img.view_url, :class => "search-image-pic pic-num#{i+1}",
... ... @@ -47,8 +47,6 @@
47 47 <% else %>
48 48 <div class="search-no-image"><span><%= _('No image') %></span></div>
49 49 <% end %>
50   - <% elsif image.first_image.present? %>
51   - <img src="<%= image.first_image %>" class="automatic-abstract-thumb search-image-pic">
52 50 <% else %>
53 51 <div class="search-content-type-icon icon-content-<%=image.class.to_s.underscore.dasherize%>"></div>
54 52 <% end %>
... ...