aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-08-30 11:14:46 +1200
committerPhilip Arndt <parndt@gmail.com>2010-08-30 11:14:46 +1200
commit4d1e364085c0de27d3ca58cc90eba9036744fc79 (patch)
tree2e0282206a95fc6fb91ec8aea38843543e886c85 /app/views
parent21dca99ddf7eadb929bc9fe40a6b3f9fd90b2f41 (diff)
downloadrefinerycms-blog-4d1e364085c0de27d3ca58cc90eba9036744fc79.tar.gz
refinerycms-blog-4d1e364085c0de27d3ca58cc90eba9036744fc79.tar.bz2
refinerycms-blog-4d1e364085c0de27d3ca58cc90eba9036744fc79.zip
Comments are now moderated automatically unless moderation is enabled and show up below posts.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/blog/comments/_comment.html.erb17
-rw-r--r--app/views/admin/blog/comments/_sortable_list.html.erb7
-rw-r--r--app/views/blog_posts/_categories.html.erb0
-rw-r--r--app/views/blog_posts/_comments.html.erb0
-rw-r--r--app/views/blog_posts/show.html.erb47
5 files changed, 48 insertions, 23 deletions
diff --git a/app/views/admin/blog/comments/_comment.html.erb b/app/views/admin/blog/comments/_comment.html.erb
new file mode 100644
index 0000000..e03605a
--- /dev/null
+++ b/app/views/admin/blog/comments/_comment.html.erb
@@ -0,0 +1,17 @@
+<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(comment) -%>">
+ <span class='title'>
+ <%=h comment.name %>
+ <span class="preview"> - <%= truncate(comment.message, :length => 75) %></span>
+ </span>
+ <span class='actions'>
+ <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(comment.post,
+ :anchor => "comment-#{comment.to_param}"),
+ :title => t('.view_live'),
+ :target => "_blank" %>
+ <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_comment_path(comment),
+ :title => t('.edit') %>
+ <%= link_to refinery_icon_tag("delete.png"), admin_blog_comment_path(comment),
+ :class => "cancel confirm-delete",
+ :title => t('.delete') %>
+ </span>
+</li>
diff --git a/app/views/admin/blog/comments/_sortable_list.html.erb b/app/views/admin/blog/comments/_sortable_list.html.erb
new file mode 100644
index 0000000..e141dee
--- /dev/null
+++ b/app/views/admin/blog/comments/_sortable_list.html.erb
@@ -0,0 +1,7 @@
+<ul id='sortable_list'>
+ <%= render :partial => 'comment', :collection => @blog_comments %>
+</ul>
+<%= render :partial => "/shared/admin/sortable_list",
+ :locals => {
+ :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
+ } %>
diff --git a/app/views/blog_posts/_categories.html.erb b/app/views/blog_posts/_categories.html.erb
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/views/blog_posts/_categories.html.erb
diff --git a/app/views/blog_posts/_comments.html.erb b/app/views/blog_posts/_comments.html.erb
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/views/blog_posts/_comments.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 %>
- <hr />
-
<% if (categories = @blog_post.categories).any? %>
+ <hr />
<div class='post_categories'>
<span class='filed_in'><%= t('.filed_in') %></span>
<ul>
@@ -18,9 +17,9 @@
</div>
<% end %>
- <hr />
<% if (comments = @blog_post.comments.approved).any? %>
- <h2><%= t('.comments') %></h2>
+ <hr />
+ <h2><%= t('.comments.title') %></h2>
<% comments.each do |comment| %>
<div class='blog_comment_message'>
<p>
@@ -28,29 +27,31 @@
</p>
</div>
<p class='blog_comment_author'>
- <%= 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)) %>
</p>
<% end %>
- <hr />
<% end %>
- <% form_for [:blog_post, @blog_comment] do |f| %>
- <div class='field'>
- <%= f.label :name %>
- <%= f.text_field :name %>
- </div>
- <div class='field'>
- <%= f.label :email %>
- <%= f.text_field :email %>
- </div>
- <div class='field message_field'>
- <%= f.label :message %>
- <%= f.text_area :message, :rows => 6 %>
- </div>
- <div class='field form-actions'>
- <%= f.submit t('.submit') %>
- </div>
+ <% if BlogPost.comments_allowed? %>
+ <hr />
+ <% form_for [:blog_post, @blog_comment] do |f| %>
+ <div class='field'>
+ <%= f.label :name %>
+ <%= f.text_field :name %>
+ </div>
+ <div class='field'>
+ <%= f.label :email %>
+ <%= f.text_field :email %>
+ </div>
+ <div class='field message_field'>
+ <%= f.label :message %>
+ <%= f.text_area :message, :rows => 6 %>
+ </div>
+ <div class='field form-actions'>
+ <%= f.submit t('.submit') %>
+ </div>
+ <% end %>
<% end %>
<% end %>