public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
revamp comment system

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1552 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Mon Aug 07 22:13:00 -0700 2006
commit  9a1562da864accd4e9560bc1b019ce5f7ef6e3a9
tree    98487d243e4903197a94e4b6bad55480db6f3c65
parent  94117847ae1e18c6e864cba3cec776d23ff85d6f
...
29
30
31
32
 
33
34
35
36
37
38
39
40
 
41
42
43
...
98
99
100
101
 
102
103
104
...
112
113
114
115
 
116
117
118
119
120
121
122
123
124
125
 
 
 
 
126
127
128
...
29
30
31
 
32
33
34
35
36
37
 
 
 
38
39
40
41
...
96
97
98
 
99
100
101
102
...
110
111
112
 
113
114
115
116
117
 
 
 
 
 
 
118
119
120
121
122
123
124
0
@@ -29,15 +29,13 @@ class Admin::ArticlesController < Admin::BaseController
0
   end
0
 
0
   def new
0
- @article = site.articles.build(:filters => current_user.filters, :parse_macros => current_user.parse_macros, :published_at => utc_to_local(Time.now.utc))
0
+ @article = site.articles.build(:comment_age => site.comment_age, :filters => current_user.filters, :parse_macros => current_user.parse_macros, :published_at => utc_to_local(Time.now.utc))
0
   end
0
 
0
   def edit
0
     @version = params[:version] ? @article.find_version(params[:version]) : @article
0
     @published = @version.published?
0
- [:published_at, :expire_comments_at].each do |attr|
0
- @version.send("#{attr}=", utc_to_local(@version.send(attr) || Time.now.utc))
0
- end
0
+ @version.published_at = utc_to_local(@version.published_at || Time.now.utc)
0
   end
0
 
0
   def create
0
@@ -98,7 +96,7 @@ class Admin::ArticlesController < Admin::BaseController
0
       @sections = site.sections.find :all, :order => 'name'
0
       home = @sections.find &:home?
0
       @sections.delete home
0
- @sections.unshift home
0
+ @sections.unshift home if home
0
     end
0
 
0
     def find_site_article
0
@@ -112,17 +110,15 @@ class Admin::ArticlesController < Admin::BaseController
0
     
0
     def check_for_new_draft
0
       params[:article] ||= {}
0
- [:published_at, :expire_comments_at].each { |k| params[:article][k] = nil } unless params[:draft].blank?
0
+ params[:article][:published_at] = nil unless params[:draft].blank?
0
     end
0
     
0
     def convert_times_to_utc
0
       with_site_timezone do
0
- [:published_at, :expire_comments_at].each do |attr|
0
- date = Time.parse_from_attributes(params[:article], attr, :local)
0
- next unless date
0
- params[:article].delete_if { |k, v| k.to_s =~ /^#{attr}/ }
0
- params[:article][attr] = date.utc
0
- end
0
+ date = Time.parse_from_attributes(params[:article], :published_at, :local)
0
+ next unless date
0
+ params[:article].delete_if { |k, v| k.to_s =~ /^#{:published_at}/ }
0
+ params[:article][:published_at] = date.utc
0
       end
0
     end
0
     
...
30
31
32
 
 
 
 
 
 
 
 
 
 
 
 
33
...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
0
@@ -30,4 +30,16 @@ module ApplicationHelper
0
   def gravatar_url_for(user, size = 80)
0
     "http://www.gravatar.com/avatar.php?size=#{size}&gravatar_id=#{Digest::MD5.hexdigest(user.email)}&default=http://#{request.host_with_port}/images/avatar.gif"
0
   end
0
+
0
+ def comment_expiration_options
0
+ [['Not allowed', -1],
0
+ ['Never', 0],
0
+ ['24 hours after publishing', 1],
0
+ ['1 week after publishing', 7],
0
+ ['2 weeks after publishing', 14],
0
+ ['1 month after publishing', 30],
0
+ ['3 months after publishing', 90],
0
+ ['6 months after publishing', 180],
0
+ ['1 year after publishing', 365]]
0
+ end
0
 end
...
3
4
5
6
 
7
8
9
...
92
93
94
95
 
96
97
98
...
110
111
112
113
114
 
 
115
116
117
...
141
142
143
144
145
146
147
148
149
 
150
151
152
...
3
4
5
 
6
7
8
9
...
92
93
94
 
95
96
97
98
...
110
111
112
 
 
113
114
115
116
117
...
141
142
143
 
 
 
 
 
 
144
145
146
147
0
@@ -3,7 +3,7 @@ class Article < Content
0
   validates_presence_of :title, :user_id, :site_id
0
 
0
   before_validation { |record| record.set_default_filters! }
0
- after_validation :set_comment_expiration
0
+ after_validation :convert_to_utc
0
   before_create :create_permalink
0
   after_save :save_assigned_sections
0
 
0
@@ -92,7 +92,7 @@ class Article < Content
0
   end
0
 
0
   def has_section?(section)
0
- (new_record? && section.name == 'home') || sections.include?(section)
0
+ (new_record? && section.home?) || sections.include?(section)
0
   end
0
 
0
   def section_ids=(new_sections)
0
@@ -110,8 +110,8 @@ class Article < Content
0
       :permalink => permalink }.merge(options)
0
   end
0
 
0
- def comments_allowed?
0
- status == :published && (expire_comments_at.nil? || expire_comments_at > Time.now.utc)
0
+ def accept_comments?
0
+ status == :published && (comment_age.to_i > -1) && (published_at + comment_age.to_i.days > Time.now.utc)
0
   end
0
 
0
   # leave out macro_filter, that is turned on/off with parse_macros?
0
@@ -141,12 +141,7 @@ class Article < Content
0
       self.permalink = title.to_s.gsub(/\W+/, ' ').strip.downcase.gsub(/\ +/, '-')
0
     end
0
 
0
- def set_comment_expiration
0
- if site.accept_comments?
0
- self.expire_comments_at = published_at + site.comment_age.days if site.comment_age.to_i > 0
0
- else
0
- self.expire_comments_at = published_at
0
- end unless !errors.empty? || published_at.nil? || expire_comments_at
0
+ def convert_to_utc
0
       self.published_at = published_at.utc if published_at
0
     end
0
     
...
27
28
29
30
 
31
32
33
...
27
28
29
 
30
31
32
33
0
@@ -27,7 +27,7 @@ class Comment < Content
0
 
0
   protected
0
     def check_comment_expiration
0
- raise Article::CommentNotAllowed unless article.comments_allowed?
0
+ raise Article::CommentNotAllowed unless article.accept_comments?
0
     end
0
 
0
     def update_counter_cache
...
25
26
27
 
 
 
 
28
29
30
...
47
48
49
50
51
52
53
...
25
26
27
28
29
30
31
32
33
34
...
51
52
53
 
54
55
56
0
@@ -25,6 +25,10 @@ class Site < ActiveRecord::Base
0
     comment.has_many :all_comments
0
   end
0
 
0
+ def accept_comments?
0
+ comment_age.to_i > -1
0
+ end
0
+
0
   def to_liquid
0
     Mephisto::Liquid::SiteDrop.new self
0
   end
0
@@ -47,7 +51,6 @@ class Site < ActiveRecord::Base
0
     end
0
 
0
     def set_default_comment_options
0
- self.accept_comments = true unless accept_comments == false
0
       self.approve_comments = false unless approve_comments?
0
       self.comment_age = 30 unless comment_age
0
       true
...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
...
64
65
66
67
68
69
70
71
72
73
74
75
...
19
20
21
 
 
 
 
22
23
24
 
 
25
 
 
 
26
27
 
28
29
30
...
54
55
56
 
 
 
 
 
 
57
58
59
0
@@ -19,22 +19,12 @@
0
   <dd><%= check_box_tag :draft, '1', !@article.new_record? && !@published, :id => 'article-draft' %> Yes, save this article as a draft.</dd>
0
   <dt id="publish-date-lbl"<%= %( style="display:none") unless @article.new_record? || @published -%>><%= label_tag 'article_created_at', 'Publish on this date:' %></dt>
0
   <dd id="publish-date"<%= %( style="display:none") unless @article.new_record? || @published -%>><%= form.datetime_select :published_at, :discard_year => true %></dd>
0
-<% if @article.expire_comments_at && site.accept_comments? && site.comment_age.to_i > 0 %>
0
- <dt><%= label_tag 'article_expire_comments_at', 'Expire Comments on this date:' %></dt>
0
- <dd><%= form.datetime_select :expire_comments_at %></dd>
0
-<% end -%>
0
 </dl>
0
 <!-- /end optional fields -->
0
 
0
-
0
-
0
 <% content_for :sidebar do %>
0
-
0
-
0
-
0
 <% if false %>
0
   <div class="sgroup" id="filetabs">
0
-
0
     <ul class="stabs">
0
       <li id="tab-latest"><a class="selected" href="#latest-files" title="Latest files uploaded">Latest files</a></li>
0
       <li id="tab-search"><a href="#search-files" title="Search for files">Search files</a></li>
0
@@ -64,11 +54,5 @@
0
     </div>
0
     
0
   </div>
0
-
0
-
0
- <div class="sgroup">
0
- <h3>Other options</h3>
0
- <p><%= check_box_tag 'allow_comments' %> Allow comments</p>
0
- </div>
0
   <% end %>
0
 <% end %>
0
\ No newline at end of file
...
10
11
12
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
10
11
12
 
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
0
@@ -10,4 +10,19 @@
0
     <% end %>
0
   </ul>
0
 </div>
0
-
0
+<div class="sgroup">
0
+ <h3>Optional settings</h3>
0
+ <dl class="sform">
0
+ <dt><label for="article_filters">Format with: </label></dt>
0
+ <dd>
0
+ <select name="article[filters][]" id="article_filters">
0
+ <%= options_for_select(filter_options, (@article.filters || []).first.to_s) %>
0
+ </select>
0
+ <p><%= form.check_box :parse_macros %><label>Use macro filters</label></p>
0
+ </dd>
0
+ <dt><label for="article_comment_age">Expire Comments</label></dt>
0
+ <dd><%= form.select :comment_age, comment_expiration_options %></dd>
0
+ <dt><label for="article_permalink">Permanent link:</label></dt>
0
+ <dd><%= form.text_field :permalink %></dd>
0
+ </dl>
0
+</div>
...
1
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
24
25
26
27
28
29
...
38
39
40
 
41
42
43
...
1
2
3
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
6
7
 
8
9
10
...
19
20
21
22
23
24
25
0
@@ -1,29 +1,10 @@
0
 <%= render :partial => "page_nav" %>
0
 
0
+<% fields_for :article, @version do |f| -%>
0
 <% content_for :sidebar do %>
0
- <%= render :partial => 'shared_options' %>
0
- <% fields_for :article, @version do |f| -%>
0
- <div class="sgroup">
0
- <h3>Optional settings</h3>
0
- <dl class="sform">
0
- <dt><label for="article_filters">Format with: </label></dt>
0
- <dd>
0
- <select name="article[filters][]" id="article_filters">
0
- <%= options_for_select(filter_options, (@version.filters || []).first.to_s) %>
0
- </select>
0
- <p style="margin-top: 3px;"><%= f.check_box :parse_macros %><label>Use macro filters</label></p>
0
- </dd>
0
- <dt><label for="article_expire_comments">Comments expire:</label></dt>
0
- <dd><%= f.date_select :expire_comments_at, { :discard_year => true } %></dd>
0
- <dt><label for="article_permalink">Permanent link:</label></dt>
0
- <dd><%= f.text_field :permalink %></dd>
0
- </dl>
0
- </div>
0
-<% end %>
0
-
0
+ <%= render :partial => 'shared_options', :locals => { :form => f } %>
0
   
0
   <div class="sgroup">
0
-
0
     <h3>Revisions<% if params[:version] -%> (<%= link_to 'current', :action => :edit, :id => @article, :version => nil %>)<% end -%></h3>
0
     <ul id="revisions">
0
     <% @article.versions.reverse.each do |version| -%>
0
@@ -38,6 +19,7 @@
0
   </div>
0
   
0
 <% end %>
0
+<% end %>
0
 
0
 <%= error_messages_for :article %>
0
 
...
2
3
4
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
23
24
25
...
2
3
4
5
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
8
9
10
11
0
@@ -2,24 +2,10 @@
0
   <div id="page-nav"></div>
0
 <% end %>
0
 
0
+<% fields_for :article do |f| -%>
0
 <% content_for :sidebar do %>
0
- <%= render :partial => 'shared_options' %>
0
- <div class="sgroup">
0
- <h3>Optional settings</h3>
0
- <dl class="sform">
0
- <% fields_for :article do |f| -%>
0
- <dt><label for="article_filters">Format with: </label></dt>
0
- <dd>
0
- <select name="article[filters][]" id="article_filters">
0
- <%= options_for_select(filter_options, (@article.filters || []).first.to_s) %>
0
- </select>
0
- <p><%= f.check_box :parse_macros %><label>Use macro filters</label></p>
0
- </dd>
0
- <dt><label for="article_permalink">Permanent link:</label></dt>
0
- <dd><%= f.text_field :permalink %></dd>
0
- <% end -%>
0
- </dl>
0
- </div>
0
+ <%= render :partial => 'shared_options', :locals => { :form => f } %>
0
+<% end %>
0
 <% end %>
0
 
0
 <% content_for :form do -%>
...
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
 
 
85
86
87
...
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
68
69
70
71
0
@@ -62,26 +62,10 @@
0
     <dd><%= f.text_field :akismet_key %></dd>
0
     <dt><label>Blog url</label></dt>
0
     <dd><%= f.text_field :akismet_url %></dd>
0
- <dt><label for="site_accept_comments">Allow comments?</label></dt>
0
- <dd><%= f.check_box 'accept_comments' %> Yes, I would like to accept comments.</dd>
0
- <dt id="approve-comments-lbl" <%= %( style="display:none") unless @site.accept_comments? %>>
0
- <label>Automatically approve comments?</label>
0
- </dt>
0
- <dd id="approve-comments" <%= %( style="display:none") unless @site.accept_comments? %>>
0
- <label><%= f.check_box 'approve_comments' %> Yes, approve and publish all comments automatically.</label>
0
- </dd>
0
- <dt id="comment-age-lbl" <%= %( style="display:none") unless @site.accept_comments? %>>
0
- <label>Close comments</label>
0
- </dt>
0
- <dd id="comment-age" <%= %( style="display:none") unless @site.accept_comments? %>>
0
- <%= f.select :comment_age, [['Never', 0],
0
- ['24 hours after publishing', 1],
0
- ['1 week after publishing', 7],
0
- ['2 weeks after publishing', 14],
0
- ['1 month after publishing', 30],
0
- ['3 months after publishing', 90],
0
- ['6 months after publishing', 180],
0
- ['1 year after publishing', 365]] %>
0
+ <dt><label for="site_comment_age">Expire Comments</label></dt>
0
+ <dd><%= f.select :comment_age, comment_expiration_options %></dd>
0
+ <dd>
0
+ <label><%= f.check_box 'approve_comments' %> approve and publish all comments automatically.</label>
0
     </dd>
0
   </dl>
0
 </div>
...
4
5
6
7
8
9
 
10
11
...
4
5
6
 
7
 
8
9
10
0
@@ -4,7 +4,6 @@ default:
0
   title: Mephisto
0
   subtitle: Publish With Impunity
0
   email: email@domain.com
0
- accept_comments: true
0
   approve_comments: true
0
- comment_age:
0
+ comment_age: 30
0
   timezone: UTC
0
\ No newline at end of file
...
2
3
4
5
 
6
7
8
...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
87
88
...
126
127
128
129
130
131
132
...
2
3
4
 
5
6
7
8
...
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
126
127
128
 
129
130
131
0
@@ -2,7 +2,7 @@
0
 # migrations feature of ActiveRecord to incrementally modify your database, and
0
 # then regenerate this schema definition.
0
 
0
-ActiveRecord::Schema.define(:version => 39) do
0
+ActiveRecord::Schema.define(:version => 40) do
0
 
0
   create_table "assigned_sections", :force => true do |t|
0
     t.column "article_id", :integer
0
@@ -31,58 +31,58 @@ ActiveRecord::Schema.define(:version => 39) do
0
   end
0
 
0
   create_table "content_versions", :force => true do |t|
0
- t.column "content_id", :integer
0
- t.column "version", :integer
0
- t.column "article_id", :integer
0
- t.column "user_id", :integer
0
- t.column "title", :string
0
- t.column "permalink", :string
0
- t.column "excerpt", :text
0
- t.column "body", :text
0
- t.column "excerpt_html", :text
0
- t.column "body_html", :text
0
- t.column "created_at", :datetime
0
- t.column "updated_at", :datetime
0
- t.column "published_at", :datetime
0
- t.column "author", :string, :limit => 100
0
- t.column "author_url", :string
0
- t.column "author_email", :string
0
- t.column "author_ip", :string, :limit => 100
0
- t.column "comments_count", :integer, :default => 0
0
- t.column "filters", :text
0
- t.column "updater_id", :integer
0
- t.column "versioned_type", :string, :limit => 20
0
- t.column "site_id", :integer
0
- t.column "approved", :boolean, :default => false
0
- t.column "expire_comments_at", :datetime
0
- t.column "parse_macros", :boolean
0
+ t.column "content_id", :integer
0
+ t.column "version", :integer
0
+ t.column "article_id", :integer
0
+ t.column "user_id", :integer
0
+ t.column "title", :string
0
+ t.column "permalink", :string
0
+ t.column "excerpt", :text
0
+ t.column "body", :text
0
+ t.column "excerpt_html", :text
0
+ t.column "body_html", :text
0
+ t.column "created_at", :datetime
0
+ t.column "updated_at", :datetime
0
+ t.column "published_at", :datetime
0
+ t.column "author", :string, :limit => 100
0
+ t.column "author_url", :string
0
+ t.column "author_email", :string
0
+ t.column "author_ip", :string, :limit => 100
0
+ t.column "comments_count", :integer, :default => 0
0
+ t.column "filters", :text
0
+ t.column "updater_id", :integer
0
+ t.column "versioned_type", :string, :limit => 20
0
+ t.column "site_id", :integer
0
+ t.column "approved", :boolean, :default => false
0
+ t.column "parse_macros", :boolean
0
+ t.column "comment_age", :integer, :default => 0
0
   end
0
 
0
   create_table "contents", :force => true do |t|
0
- t.column "article_id", :integer
0
- t.column "user_id", :integer
0
- t.column "title", :string
0
- t.column "permalink", :string
0
- t.column "excerpt", :text
0
- t.column "body", :text
0
- t.column "excerpt_html", :text
0
- t.column "body_html", :text
0
- t.column "created_at", :datetime
0
- t.column "updated_at", :datetime
0
- t.column "published_at", :datetime
0
- t.column "type", :string, :limit => 20
0
- t.column "author", :string, :limit => 100
0
- t.column "author_url", :string
0
- t.column "author_email", :string
0
- t.column "author_ip", :string, :limit => 100
0
- t.column "comments_count", :integer, :default => 0
0
- t.column "filters", :text
0
- t.column "version", :integer
0
- t.column "updater_id", :integer
0
- t.column "site_id", :integer
0
- t.column "approved", :boolean, :default => false
0
- t.column "expire_comments_at", :datetime
0
- t.column "parse_macros", :boolean
0
+ t.column "article_id", :integer
0
+ t.column "user_id", :integer
0
+ t.column "title", :string
0
+ t.column "permalink", :string
0
+ t.column "excerpt", :text
0
+ t.column "body", :text
0
+ t.column "excerpt_html", :text
0
+ t.column "body_html", :text
0
+ t.column "created_at", :datetime
0
+ t.column "updated_at", :datetime
0
+ t.column "published_at", :datetime
0
+ t.column "type", :string, :limit => 20
0
+ t.column "author", :string, :limit => 100
0
+ t.column "author_url", :string
0
+ t.column "author_email", :string
0
+ t.column "author_ip", :string, :limit => 100
0
+ t.column "comments_count", :integer, :default => 0
0
+ t.column "filters", :text
0
+ t.column "version", :integer
0
+ t.column "updater_id", :integer
0
+ t.column "site_id", :integer
0
+ t.column "approved", :boolean, :default => false
0
+ t.column "parse_macros", :boolean
0
+ t.column "comment_age", :integer, :default => 0
0
   end
0
 
0
   create_table "events", :force => true do |t|
0
@@ -126,7 +126,6 @@ ActiveRecord::Schema.define(:version => 39) do
0
     t.column "host", :string
0
     t.column "akismet_key", :string, :limit => 100
0
     t.column "akismet_url", :string
0
- t.column "accept_comments", :boolean
0
     t.column "approve_comments", :boolean
0
     t.column "comment_age", :integer
0
     t.column "timezone", :string
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@ module Mephisto
0
           'updated_at' => article.site.timezone.utc_to_local(article.updated_at),
0
           'comments_count' => article.comments_count,
0
           'author' => article.user.to_liquid,
0
- 'comments_allowed' => article.comments_allowed?
0
+ 'accept_comments' => article.accept_comments?
0
         }
0
       end
0
 
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@ module Mephisto
0
       include Reloadable
0
     
0
       def render(context)
0
- return '' unless article.comments_allowed?
0
+ return '' unless article.accept_comments?
0
         result = []
0
         context.stack do
0
           if context['message'].blank?
...
8
9
10
 
11
12
13
...
8
9
10
11
12
13
14
0
@@ -8,6 +8,7 @@ module Mephisto
0
       def initialize(site)
0
         @site = site
0
         @site_liquid = [:id, :host, :subtitle, :title].inject({}) { |h, k| h.merge k.to_s => site.send(k) }
0
+ @site_liquid['accept_comments'] = @site.accept_comments?
0
       end
0
 
0
       def before_method(method)
...
140
141
142
143
144
145
146
147
148
149
150
151
...
192
193
194
195
196
197
198
199
200
...
140
141
142
 
 
 
 
 
 
143
144
145
...
186
187
188
 
189
190
 
191
192
0
@@ -140,12 +140,6 @@ var ArticleForm = {
0
     var isDraft = $F(this);
0
     if(isDraft) Element.hide('publish-date-lbl', 'publish-date');
0
     else Element.show('publish-date-lbl', 'publish-date');
0
- },
0
-
0
- acceptComments: function() {
0
- var checked = $F(this);
0
- if(checked) Element.show('approve-comments-lbl', 'approve-comments', 'comment-age-lbl', 'comment-age');
0
- else Element.hide('approve-comments-lbl', 'approve-comments', 'comment-age-lbl', 'comment-age');
0
   }
0
 }
0
 
0
@@ -192,8 +186,6 @@ Event.observe(window, 'load', function() {
0
   // TODO: IE doesn't fire onchange for checkbox
0
   var commentsView = $('comments-view');
0
   var articleDraft = $('article-draft');
0
- var acceptComments = $('site_accept_comments');
0
   if(commentsView) Event.observe(commentsView, 'change', ArticleForm.viewComments.bind(commentsView));
0
   if(articleDraft) Event.observe(articleDraft, 'change', ArticleForm.saveDraft.bind(articleDraft));
0
- if(acceptComments) Event.observe(acceptComments, 'change', ArticleForm.acceptComments.bind(acceptComments));
0
 });
0
\ No newline at end of file
...
17
18
19
20
 
21
22
23
...
32
33
34
35
 
36
37
38
...
59
60
61
 
62
63
64
...
73
74
75
 
76
77
78
79
80
81
...
88
89
90
 
91
92
93
...
102
103
104
 
105
106
107
...
138
139
140
 
141
142
143
...
17
18
19
 
20
21
22
23
...
32
33
34
 
35
36
37
38
...
59
60
61
62
63
64
65
...
74
75
76
77
78
79
 
80
81
82
...
89
90
91
92
93
94
95
...
104
105
106
107
108
109
110
...
141
142
143
144
145
146
147
0
@@ -17,7 +17,7 @@ welcome:
0
   created_at: <%= 5.days.ago.to_s(:db) %>
0
   updated_at: <%= 5.days.ago.to_s(:db) %>
0
   published_at: <%= 3.days.ago.to_s(:db) %>
0
- expire_comments_at: <%= 25.days.from_now.to_s(:db) %>
0
+ comment_age: 30
0
   user_id: 1
0
   comments_count: 1
0
   type: Article
0
@@ -32,7 +32,7 @@ another:
0
   created_at: <%= 4.days.ago.to_s(:db) %>
0
   updated_at: <%= 4.days.ago.to_s(:db) %>
0
   published_at: <%= 4.days.ago.to_s(:db) %>
0
- expire_comments_at: <%= 3.days.ago.to_s(:db) %>
0
+ comment_age: 1
0
   user_id: 3
0
   type: Article
0
 welcome_comment:
0
@@ -59,6 +59,7 @@ future:
0
   created_at: <%= (4.days - 15.minutes).ago.to_s(:db) %>
0
   updated_at: <%= (4.days - 15.minutes).ago.to_s(:db) %>
0
   published_at: <%= (4.days - 15.minutes).from_now.to_s(:db) %>
0
+ comment_age: 30
0
   user_id: 1
0
   type: Article
0
 about:
0
@@ -73,9 +74,9 @@ about:
0
   created_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
   updated_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
   published_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
+ comment_age: 2
0
   user_id: 1
0
   type: Article
0
- expire_comments_at: <%= 3.days.ago.utc.to_s :db %>
0
 site_map:
0
   id: 7
0
   site_id: 1
0
@@ -88,6 +89,7 @@ site_map:
0
   created_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
   updated_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
   published_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
+ comment_age: -1
0
   user_id: 1
0
   type: Article
0
 cupcake_welcome:
0
@@ -102,6 +104,7 @@ cupcake_welcome:
0
   created_at: <%= 5.days.ago.to_s(:db) %>
0
   updated_at: <%= 5.days.ago.to_s(:db) %>
0
   published_at: <%= 3.days.ago.to_s(:db) %>
0
+ comment_age: 30
0
   user_id: 1
0
   comments_count: 1
0
   type: Article
0
@@ -138,5 +141,6 @@ draft:
0
   body_html: This is a test draft
0
   created_at: <%= 1.day.ago.to_s(:db) %>
0
   updated_at: <%= 1.day.ago.to_s(:db) %>
0
+ comment_age: 30
0
   user_id: 1
0
   type: Article
0
\ No newline at end of file