<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/models/comment_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -62,6 +62,7 @@ class Admin::ArticlesController &lt; Admin::BaseController
 
   def destroy
     @article.destroy
+    flash[:notice] = &quot;The article: #{@article.title.inspect} was deleted.&quot;
     render :update do |page|
       page.redirect_to :action =&gt; 'index'
     end</diff>
      <filename>app/controllers/admin/articles_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,8 @@ class MephistoController &lt; ApplicationController
       show_article_with 'errors' =&gt; @comment.errors.full_messages, 'submitted' =&gt; params[:comment]
     rescue Article::CommentNotAllowed
       show_article_with 'errors' =&gt; [&quot;Commenting has been disabled on this article&quot;]
+    rescue Comment::Previewing
+      show_article_with 'errors' =&gt; [&quot;Previewing your comment&quot;], 'submitted' =&gt; params[:comment]
     end
     
     def dispatch_comment</diff>
      <filename>app/controllers/mephisto_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ class ArticleDrop &lt; BaseDrop
   end
 
   def comments
-    @comments ||= liquify(*@source.comments.reject(&amp;:new_record?))
+    @comments ||= liquify(*@source.comments) # .reject(&amp;:new_record?) &lt;-- show new comments as they're built as a preview
   end
   
   def sections</diff>
      <filename>app/drops/article_drop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ class CommentDrop &lt; BaseDrop
     @url ||= absolute_url(@source.site.permalink_for(@source))
   end
 
+  def new_record
+    @source.new_record?
+  end
+
   def author_link
     @source.author_url.blank? ? &quot;&lt;span&gt;#{@source.author}&lt;/span&gt;&quot; : %Q{&lt;a href=&quot;#{author_url}&quot;&gt;#{@source.author}&lt;/a&gt;}
   end</diff>
      <filename>app/drops/comment_drop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,8 +12,18 @@ class Comment &lt; Content
   before_destroy :decrement_counter_cache
   belongs_to :article
   has_one :event, :dependent =&gt; :destroy
-  attr_accessible :article, :article_id, :user_id, :user, :excerpt, :body, :author, :author_url, :author_email, :author_ip, :updater_id, :updater, :comment_age, :user_agent, :referrer
+  before_create  :check_if_previewing
 
+  attr_accessible :article, :article_id, :user_id, :user, :excerpt, :body, :author, :author_url, :author_email, :author_ip, :updater_id, :updater, :comment_age, :user_agent, :referrer, :preview
+  attr_accessor :preview
+  class Previewing &lt; StandardError; end
+
+  # If the view sends the &quot;preview&quot; accessor, we raise this
+  # error so the controller can simply rescue 
+  def check_if_previewing
+    raise Comment::Previewing if preview
+  end
+  
   def self.find_all_by_section(section, options = {})
     find :all, options.update(:conditions =&gt; ['contents.approved = ? and assigned_sections.section_id = ?', true, section.id], 
       :select =&gt; 'contents.*', :joins =&gt; 'INNER JOIN assigned_sections ON assigned_sections.article_id = contents.article_id', 
@@ -80,7 +90,7 @@ class Comment &lt; Content
     end
 
     def check_comment_expiration
-      raise Article::CommentNotAllowed unless article.accept_comments?
+      raise Article::CommentNotAllowed, &quot;#{article.status} does not allow comments&quot; unless article.accept_comments?
     end
 
     def update_counter_cache</diff>
      <filename>app/models/comment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,10 @@
             &lt;li&gt;&lt;%= link_to 'Sections', :controller =&gt; '/admin/sections' %&gt;&lt;/li&gt;
             &lt;li&gt;&lt;%= link_to 'Design',   :controller =&gt; '/admin/design' %&gt;&lt;/li&gt;
             &lt;li&gt;&lt;%= link_to &quot;Users&quot;,    :controller =&gt; &quot;users&quot; %&gt;&lt;/li&gt;
+					&lt;% if false -%&gt;
+						hidden because plugins are in for a change
             &lt;li&gt;&lt;%= link_to 'Plugins',  :controller =&gt; '/admin/plugins' %&gt;&lt;/li&gt;
+					&lt;% end -%&gt;
           &lt;% Mephisto::Plugin.admin_tabs.each do |tab| -%&gt;
             &lt;li&gt;&lt;%= link_to tab.first.to_s.tableize.humanize, tab.last %&gt;&lt;/li&gt;
           &lt;% end -%&gt;</diff>
      <filename>app/views/layouts/application.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,8 @@ module Mephisto
         Thread.current[:comment_form_article] = value
       end
     
+      # Provides the required input, error, and form fields
+      # TODO: make this more accessible to users (let them mess it up, rather than forcing a structure on them)
       def render(context)
         return '' unless self.class.article.accept_comments?
         result = []</diff>
      <filename>lib/mephisto/liquid/comment_form.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module Mephisto
       map.purge    'admin/articles/comments/purge', :controller =&gt; 'admin/comments', :action =&gt; 'destroy'
 
       map.resources :articles, :path_prefix =&gt; 'admin', :controller =&gt; 'admin/articles' do |r|
-        r.resources :comments, :controller =&gt; 'admin/comments', :member =&gt; { :unapprove =&gt; :post, :approve =&gt; :post, :edit =&gt; :get }
+        r.resources :comments, :controller =&gt; 'admin/comments', :member =&gt; { :unapprove =&gt; :post, :approve =&gt; :post, :edit =&gt; :get, :preview =&gt; :post }
       end
 
       map.overview 'admin/overview.xml', :controller =&gt; 'admin/overview', :action =&gt; 'feed'</diff>
      <filename>lib/mephisto/routing.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>963b29301a8e3c6b62557848575422dbad4a9245</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </author>
  <url>http://github.com/technoweenie/mephisto/commit/b0fadcd7955634ef0fc82c18a8b769c7d9cb89d4</url>
  <id>b0fadcd7955634ef0fc82c18a8b769c7d9cb89d4</id>
  <committed-date>2008-02-04T09:21:51-08:00</committed-date>
  <authored-date>2008-02-04T09:21:51-08:00</authored-date>
  <message>host of fixes and added support for comment preview</message>
  <tree>12a89c5278097f788f6b742fb22a91e21f3bb9cc</tree>
  <committer>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </committer>
</commit>
