Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed 'unread' to 'unmoderated'

  • Loading branch information...
commit 24f1cb84a2d0c689f0dea061aaf066fbf2ca5f29 1 parent 8fb7e1c
Amanda Wagener awagener authored committed
5 app/controllers/admin/blogs_controller.rb
View
@@ -1,13 +1,8 @@
class Admin::BlogsController < Admin::BaseController
- before_filter :get_count, :only => 'index'
before_filter :group_blogs_by_date, :only => 'index'
crudify :blog, :title_attribute => :title, :order => "publishing_date DESC"
-
- def get_count
- @unread_comments_count = Comment.unread.count
- end
def group_blogs_by_date
@grouped_blogs = Blog.grouped_by_date
8 app/controllers/admin/comments_controller.rb
View
@@ -1,7 +1,7 @@
class Admin::CommentsController < Admin::BaseController
crudify :comment, :title_attribute => "name", :order => "created_at DESC"
- before_filter :find_comment, :only => [:show, :toggle_status, :unread, :destroy]
+ before_filter :find_comment, :only => [:show, :toggle_status, :unmoderated, :destroy]
before_filter :find_all_comments, :only => [:index]
def toggle_status
@@ -12,9 +12,9 @@ def toggle_status
redirect_to :action => 'index'
end
- def unread
+ def unmoderated
if @comment.update_attribute(:approved, nil)
- flash[:notice] = "You sent a comment from '#{@comment.name}' back to unread comments"
+ flash[:notice] = "You sent a comment from '#{@comment.name}' back to unmoderated comments"
end
redirect_to :action => 'index'
@@ -23,6 +23,6 @@ def unread
def find_all_comments
@comments_history = Comment.history.paginate :page => params[:page]
- @unread_comments = Comment.unread
+ @unmoderated_comments = Comment.unmoderated
end
end
2  app/models/comment.rb
View
@@ -1,7 +1,7 @@
class Comment < ActiveRecord::Base
belongs_to :blog
- named_scope :unread, :conditions => {:approved => nil}
+ named_scope :unmoderated, :conditions => { :approved => nil }
named_scope :history, :conditions => 'approved IS NOT NULL', :order => "created_at DESC"
named_scope :approved, :conditions => {:approved => true}
2  app/views/admin/blogs/_side_bar.html.erb
View
@@ -7,7 +7,7 @@
<%= link_to "Create new post", new_admin_blog_url, :class => "add_icon" %>
</li>
<li>
- <%= link_to "Moderate comments (#{Comment.unread.count} unread)", admin_comments_url, :class => "user_comment_icon" %>
+ <%= link_to "Moderate comments (#{Comment.unmoderated.count} unmoderated)", admin_comments_url, :class => "user_comment_icon" %>
</li>
<li>
<%= link_to "Edit settings", admin_blog_settings_url, :class => "edit_icon" %>
4 app/views/admin/comments/_comment.html.erb
View
@@ -6,8 +6,8 @@
:title => "Mark this comment as #{comment.is_approved? ? 'refused' : 'approved'}" %>
<%= link_to refinery_icon_tag("arrow_up.png"),
- unread_admin_comment_url(comment),
- :title => "Send back to unread comments" if BlogSetting.manual_moderation %>
+ unmoderated_admin_comment_url(comment),
+ :title => "Send back to unmoderated comments" if BlogSetting.manual_moderation %>
<%= link_to refinery_icon_tag('delete.png'),
admin_comment_url(comment),
8 app/views/admin/comments/index.html.erb
View
@@ -4,10 +4,10 @@
<h2>Search Results for "<%= params[:search] %>"</h2>
<%= render :partial => "comment", :collection => @comments %>
<% else %>
- <% if @unread_comments.present? and @unread_comments.any? -%>
- <h2>Unread Comments</h2>
+ <% if @unmoderated_comments.present? -%>
+ <h2>Unmoderated Comments</h2>
<ul>
- <%= render :partial => "comment", :collection => @unread_comments %>
+ <%= render :partial => "comment", :collection => @unmoderated_comments %>
</ul>
<% elsif RefinerySetting.find_or_set(:blog_comment_need_approval, false) -%>
<p>
@@ -16,7 +16,7 @@
</p>
<% end -%>
<h2>Comments History</h2>
- <% if @comments_history.present? and @comments_history.any? -%>
+ <% if @comments_history.present? -%>
<%= will_paginate @comments_history, :previous_label => '&laquo;', :next_label => '&raquo;' %>
<ul>
<%= render :partial => "comment", :collection => @comments_history %>
2  config/routes.rb
View
@@ -14,7 +14,7 @@
map.namespace(:admin, :path_prefix => (defined?(REFINERY_GEM_VERSION) ? "admin" : "refinery") ) do |admin|
admin.resources :blogs, :as => 'blog'
- admin.resources :comments, :member => {:toggle_status => :get, :unread => :get}
+ admin.resources :comments, :member => {:toggle_status => :get, :unmoderated => :get}
admin.connect 'blog_settings/toggle_setting/:id', :controller => "blog_settings", :action => "toggle_setting"
admin.resources :blog_settings
end
2  readme.md
View
@@ -23,7 +23,7 @@ Blog comments with
Administration panel
* write blogs
-* manage comments (unread/approved/refused)
+* manage comments (unmoderated/approved/refused)
* Change settings
## Dependencies
Please sign in to comment.
Something went wrong with that request. Please try again.