aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/blog/shared/_post.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/blog/shared/_post.html.erb')
-rw-r--r--app/views/blog/shared/_post.html.erb23
1 files changed, 14 insertions, 9 deletions
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb
index 16483a5..716c1ad 100644
--- a/app/views/blog/shared/_post.html.erb
+++ b/app/views/blog/shared/_post.html.erb
@@ -5,13 +5,17 @@
<details>
<time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'>
<%= t('blog.shared.posts.created_at', :when => l(post.published_at.to_date, :format => :short)) %>.
- </time>
+ </time><%= " by #{post.author.username}" if post.author.present? %>
<% if (categories = post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'blog.posts.show') %>
- <% categories.each_with_index do |category, index| %>
- <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
- <% end %>
+ <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %>
+ </aside>
+ <% end %>
+ <% if (tags = post.tag_list).any? %>
+ <aside class='tagged'>
+ <%= t('tagged', :scope => 'blog.posts.show') %>
+ <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.parameterize) }.to_sentence %>
</aside>
<% end %>
</details>
@@ -24,15 +28,16 @@
<footer>
<p>
<%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
-
- <aside class='comment_count'>
+ </p>
+ <aside class='comment_count'>
+ <% if BlogPost.comments_allowed? %>
<% if post.comments.any? %>
(<%= pluralize(post.comments.approved.count, t('blog.shared.comments.singular')) %>)
<% else %>
- (<%= t('blog.shared.comments.none') %>)
+ (<%= t('blog.shared.comments.none') %>)
<% end %>
- </aside>
- </p>
+ <% end %>
+ </aside>
</footer>
</article>
<% end %>