aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/blog/shared/_post.html.erb
diff options
context:
space:
mode:
authordjones <dgjones@gmail.com>2010-09-21 17:20:08 +1200
committerdjones <dgjones@gmail.com>2010-09-21 17:20:08 +1200
commitf036f2a46f5c085505aff507f54518df8e283069 (patch)
tree5dd5bd48059066ceb0fef489d33e42d93e15c5df /app/views/blog/shared/_post.html.erb
parent18b2db513d5241738135cfd330e730c63abec277 (diff)
downloadrefinerycms-blog-f036f2a46f5c085505aff507f54518df8e283069.tar.gz
refinerycms-blog-f036f2a46f5c085505aff507f54518df8e283069.tar.bz2
refinerycms-blog-f036f2a46f5c085505aff507f54518df8e283069.zip
added publish date support. fixes bug where categories were showing posts that were technically supposed to be hidden from the end user
Diffstat (limited to 'app/views/blog/shared/_post.html.erb')
-rw-r--r--app/views/blog/shared/_post.html.erb44
1 files changed, 23 insertions, 21 deletions
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb
index 26f5fbf..46fc23b 100644
--- a/app/views/blog/shared/_post.html.erb
+++ b/app/views/blog/shared/_post.html.erb
@@ -1,22 +1,24 @@
-<li>
- <h2><%= link_to post.title, blog_post_url(post) %></h2>
- <p class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => post.created_at.strftime('%d %B %Y')) %>
- </p>
- <div clas='clearfix'>
- <%= truncate(post.body,
- :length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
- :preserve_html_tags => true) %>
- </div>
- <p>
- <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
+<% if post.live? %>
+ <li>
+ <h2><%= link_to post.title, blog_post_url(post) %></h2>
+ <p class='posted_at'>
+ <%= t('blog.shared.posts.created_at', :when => post.published_at.strftime('%d %B %Y')) %>
+ </p>
+ <div clas='clearfix'>
+ <%= truncate(post.body,
+ :length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
+ :preserve_html_tags => true) %>
+ </div>
+ <p>
+ <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
- <span class='comment_count'>
- <% if post.comments.any? %>
- (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
- <% else %>
- (<%= t('blog.shared.comments.none') %>)
- <% end %>
- </span>
- </p>
-</li> \ No newline at end of file
+ <span class='comment_count'>
+ <% if post.comments.any? %>
+ (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
+ <% else %>
+ (<%= t('blog.shared.comments.none') %>)
+ <% end %>
+ </span>
+ </p>
+ </li>
+<% end %> \ No newline at end of file