Commit 34496635bedb7eff88a46f809375258de18b9b91
Exists in
master
and in
28 other branches
Merge branch 'full-blog-posts' into stable
Showing
2 changed files
with
9 additions
and
5 deletions
Show diff stats
app/models/blog.rb
app/views/search/_full_blog.html.erb
... | ... | @@ -7,12 +7,12 @@ |
7 | 7 | <tr class="search-blog-items"> |
8 | 8 | <td class="search-field-label"><%= _("Last posts") %></td> |
9 | 9 | |
10 | - <% r = blog.children.find(:all, :order => :updated_at, :conditions => ['type != ?', 'RssFeed']).last(3) %> | |
11 | - <td class="<%= "search-field-none" if r.empty? %>"> | |
12 | - <% r.each do |a| %> | |
13 | - <%= link_to a.title, a.view_url, :class => 'search-blog-sample-item '+icon_for_article(a) %> | |
10 | + <% last_posts = blog.last_posts %> | |
11 | + <td class="<%= "search-field-none" if last_posts.empty? %>"> | |
12 | + <% last_posts.each do |post| %> | |
13 | + <%= link_to post.title, post.view_url, :class => 'search-blog-sample-item '+icon_for_article(post) %> | |
14 | 14 | <% end %> |
15 | - <%= _('None') if r.empty? %> | |
15 | + <%= _('None') if last_posts.empty? %> | |
16 | 16 | </td> |
17 | 17 | </tr> |
18 | 18 | ... | ... |