From 4d1e364085c0de27d3ca58cc90eba9036744fc79 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Mon, 30 Aug 2010 11:14:46 +1200 Subject: Comments are now moderated automatically unless moderation is enabled and show up below posts. --- app/views/blog_posts/show.html.erb | 47 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'app/views/blog_posts/show.html.erb') diff --git a/app/views/blog_posts/show.html.erb b/app/views/blog_posts/show.html.erb index cf51e0c..6fea210 100644 --- a/app/views/blog_posts/show.html.erb +++ b/app/views/blog_posts/show.html.erb @@ -3,9 +3,8 @@ <% content_for :body_content_left do %> <%= @blog_post.body %> -
- <% if (categories = @blog_post.categories).any? %> +
<%= t('.filed_in') %>
<% end %> -
<% if (comments = @blog_post.comments.approved).any? %> -

<%= t('.comments') %>

+
+

<%= t('.comments.title') %>

<% comments.each do |comment| %>

@@ -28,29 +27,31 @@

- <%= t('.comment_by', :who => comment.name) %> - <%= ", #{time_ago_in_words(comment.created_at)}".html_safe %> + <%= t('.comments.by', :who => comment.name) %> + <%= t('.comments.time_ago', :time => time_ago_in_words(comment.created_at)) %>

<% end %> -
<% end %> - <% form_for [:blog_post, @blog_comment] do |f| %> -
- <%= f.label :name %> - <%= f.text_field :name %> -
-
- <%= f.label :email %> - <%= f.text_field :email %> -
-
- <%= f.label :message %> - <%= f.text_area :message, :rows => 6 %> -
-
- <%= f.submit t('.submit') %> -
+ <% if BlogPost.comments_allowed? %> +
+ <% form_for [:blog_post, @blog_comment] do |f| %> +
+ <%= f.label :name %> + <%= f.text_field :name %> +
+
+ <%= f.label :email %> + <%= f.text_field :email %> +
+
+ <%= f.label :message %> + <%= f.text_area :message, :rows => 6 %> +
+
+ <%= f.submit t('.submit') %> +
+ <% end %> <% end %> <% end %> -- cgit v1.2.3