vanilla 1.9.14.1 → 1.9.14.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -25,7 +25,7 @@ if Object.const_defined?(:Gem)
25
25
 
26
26
  # Change these as appropriate
27
27
  s.name = "vanilla"
28
- s.version = "1.9.14.1"
28
+ s.version = "1.9.14.3"
29
29
  s.summary = "A bliki-type web content thing."
30
30
  s.author = "James Adam"
31
31
  s.email = "james@lazyatom.com.com"
@@ -6,23 +6,22 @@ class Comments < Dynasnip
6
6
  usage %|
7
7
  Embed comments within snips!
8
8
 
9
- {comments <snip-name>}
9
+ {comments <false>}
10
10
 
11
11
  This will embed a list of comments, and a comment form, in a snip
12
12
  If the snip is being rendered within another snip, it will show a link to the snip,
13
- with the number of comments.
13
+ with the number of comments. Add a parameter to disable new comments.
14
14
  |
15
15
 
16
- def get(snip_name=nil, disable_new_comments=false)
17
- snip_name = snip_name || app.request.params[:snip]
18
- return usage if self.class.snip_name == snip_name
19
- comments = app.soup.sieve(:commenting_on => snip_name)
20
- comments_html = if app.request.snip_name == snip_name
16
+ def get(disable_new_comments=false)
17
+ return usage if self.class.snip_name == app.request.snip_name
18
+ comments = app.soup.sieve(:commenting_on => enclosing_snip.name)
19
+ comments_html = if app.request.snip_name == enclosing_snip.name
21
20
  rendered_comments = render_comments(comments)
22
- rendered_comments += comment_form.gsub('SNIP_NAME', snip_name) unless disable_new_comments
21
+ rendered_comments += comment_form.gsub('SNIP_NAME', enclosing_snip.name) unless disable_new_comments
23
22
  rendered_comments
24
23
  else
25
- %{<a href="#{url_to(snip_name)}">#{comments.length} comments for #{snip_name}</a>}
24
+ %{<a href="#{url_to(enclosing_snip.name)}">#{comments.length} comments for #{enclosing_snip.name}</a>}
26
25
  end
27
26
  return comments_html
28
27
  end
@@ -52,7 +51,7 @@ class Comments < Dynasnip
52
51
  def render_comments(comments)
53
52
  "<h2>Comments</h2><ol class='comments'>" + comments.map do |comment|
54
53
  rendered_comment = comment_template.gsub('COMMENT_CONTENT', app.render(comment)).
55
- gsub('COMMENT_DATE', comment.created_at)
54
+ gsub('COMMENT_DATE', comment.created_at.to_s)
56
55
  author = comment.author
57
56
  author = "Anonymous" unless author && author != ""
58
57
  if comment.website && comment.website != ""
@@ -1,5 +1,5 @@
1
1
  CurrentSnip--- # Soup attributes
2
- :updated_at: 2009-11-23 22:39:21.358609 +00:00
2
+ :updated_at: 2009-11-24 10:47:54.395720 +00:00
3
3
  :name: current_snip
4
4
  :render_as: Ruby
5
5
  :usage: |-
@@ -12,4 +12,4 @@ CurrentSnip--- # Soup attributes
12
12
  &#123;current_snip name&#125;
13
13
 
14
14
  will output the name of the current snip, or the name of the snip currently being edited.
15
- :created_at: 2009-11-23 22:39:21.358607 +00:00
15
+ :created_at: 2009-11-24 10:47:54.395718 +00:00
@@ -1,5 +1,5 @@
1
1
  --- # Soup attributes
2
- :updated_at: 2009-11-23 22:39:21.359623 +00:00
2
+ :updated_at: 2009-11-24 10:47:54.396490 +00:00
3
3
  :name: system
4
4
  :main_template: "{current_snip}"
5
- :created_at: 2009-11-23 22:39:21.359619 +00:00
5
+ :created_at: 2009-11-24 10:47:54.396487 +00:00
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.14.1
4
+ version: 1.9.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Adam
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-23 00:00:00 +00:00
12
+ date: 2009-11-24 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency