public
Description: Vanilla in Ruby
Homepage: http://lazyatom.com
Clone URL: git://github.com/lazyatom/vanilla-rb.git
Adding new comments via the comments dyna should be disable-able.
lazyatom (author)
Thu Jul 17 07:54:20 -0700 2008
commit  dfca2f00f0b67df91b41ceab674c9c8005fa0e0d
tree    d7fc05c444aff4530ec08df4b5d621eb600cbc9c
parent  30d62eb941645b70bad63e2591ecb7a886f006a4
...
11
12
13
14
 
15
16
17
18
19
 
 
 
20
21
22
...
11
12
13
 
14
15
16
17
18
 
19
20
21
22
23
24
0
@@ -11,12 +11,14 @@ class Comments < Dynasnip
0
     with the number of comments.
0
   |
0
 
0
- def get(snip_name=nil?)
0
+ def get(snip_name=nil, disable_new_comments=false)
0
     snip_name = snip_name || app.request.params[:snip]
0
     return usage if self.class.snip_name == snip_name
0
     comments = Soup.sieve(:commenting_on => snip_name)
0
     comments_html = if app.request.snip_name == snip_name
0
- render_comments(comments) + comment_form.gsub('SNIP_NAME', snip_name)
0
+ rendered_comments = render_comments(comments)
0
+ rendered_comments += comment_form.gsub('SNIP_NAME', snip_name) unless disable_new_comments
0
+ rendered_comments
0
     else
0
      %{<a href="#{Vanilla::Routes.url_to(snip_name)}">#{comments.length} comments for #{snip_name}</a>}
0
     end

Comments

    No one has commented yet.