muck-comments 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -5,12 +5,11 @@ Add comments to any object. This gem is the muck version of acts_as_commentable
5
5
  == Setup
6
6
  Install the the awesome_nested_set gem (http://github.com/collectiveidea/awesome_nested_set/tree/master)
7
7
 
8
- gem sources -a http://gems.github.com
9
- sudo gem install collectiveidea-awesome_nested_set
8
+ sudo gem install awesome_nested_set
10
9
 
11
10
  Then add it to your environment.rb:
12
11
 
13
- config.gem "collectiveidea-awesome_nested_set", :lib => 'awesome_nested_set'
12
+ config.gem "awesome_nested_set"
14
13
 
15
14
  == Usage
16
15
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.15
1
+ 0.1.16
@@ -21,6 +21,20 @@ module MuckCommentsHelper
21
21
  :comment_button_class => comment_button_class}
22
22
  end
23
23
 
24
+ # Render a comment for using the tiny mce editor. Note that this method
25
+ # requires that muck-contents be installed and configured correctly and that the
26
+ # controller that calls the page where this method is called have 'uses_tiny_mce' defined ie:
27
+ # uses_tiny_mce(:options => GlobalConfig.simple_mce_options,
28
+ # :only => [:new, :create, :edit, :update])
29
+ # parent is the object to which the comments will be attached
30
+ # comment is the optional parent comment for the new comment.
31
+ def tiny_mce_comment_form(parent, comment = nil, render_new = false, comment_button_class = 'comment-submit')
32
+ render :partial => 'comments/tiny_mce_form', :locals => {:parent => parent,
33
+ :comment => comment,
34
+ :render_new => render_new,
35
+ :comment_button_class => comment_button_class}
36
+ end
37
+
24
38
  # make_muck_parent_params is defined in muck-engine and used by many of the engines.
25
39
  # This will generate a url suitable for a form to post a create to.
26
40
  def new_comment_path_with_parent(parent)
@@ -0,0 +1,20 @@
1
+ <%
2
+ form_id = "#{parent.dom_id}_comment_form"
3
+ mce_id = "#{parent.dom_id}_comment"
4
+ message_container_id = "#{@project.dom_id}_message_container"
5
+ message_id = "#{@project.dom_id}_message"
6
+ -%>
7
+ <div id="<%= message_container_id %>" class="help-box" style="display:none;">
8
+ <div id="flashMessage" class="message">
9
+ <div id="<%= message_id %>" class="notice message"></div>
10
+ </div>
11
+ </div>
12
+ <div id="<%= parent.dom_id %>_new_comment" class="comment-form-wrapper">
13
+ <% form_for(:comment, :url => new_comment_path_with_parent(parent), :html => { :id => form_id, :class => "comment-form"} ) do |f| -%>
14
+ <%= f.text_area :body, :class => 'mceEditor min', :id => mce_id %>
15
+ <%= hidden_field_tag :parent_comment_id, comment.id unless comment.blank? -%>
16
+ <%= hidden_field_tag :render_new, render_new -%>
17
+ <%= f.submit t('muck.comments.add_comment_button'), :class => "button #{comment_button_class}", :id => "comment_submit_#{parent.dom_id}" %>
18
+ <% end -%>
19
+ </div>
20
+ <%= tiny_mce_scripts(:form_id => form_id, :mce_id => mce_id, :message_container_id => message_container_id, :message_id => message_id) -%>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-comments}
8
- s.version = "0.1.15"
8
+ s.version = "0.1.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball", "Joel Duffin"]
12
- s.date = %q{2009-11-13}
12
+ s.date = %q{2009-12-02}
13
13
  s.description = %q{The comment engine for the muck system.}
14
14
  s.email = %q{justin@tatemae.com}
15
15
  s.extra_rdoc_files = [
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "app/views/comments/_comment_title.html.erb",
32
32
  "app/views/comments/_form.html.erb",
33
33
  "app/views/comments/_simple_comment.html.erb",
34
+ "app/views/comments/_tiny_mce_form.html.erb",
34
35
  "app/views/comments/index.html.erb",
35
36
  "app/views/comments/new.html.erb",
36
37
  "app/views/external/_disqus.html.erb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-comments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-13 00:00:00 -07:00
13
+ date: 2009-12-02 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ files:
57
57
  - app/views/comments/_comment_title.html.erb
58
58
  - app/views/comments/_form.html.erb
59
59
  - app/views/comments/_simple_comment.html.erb
60
+ - app/views/comments/_tiny_mce_form.html.erb
60
61
  - app/views/comments/index.html.erb
61
62
  - app/views/comments/new.html.erb
62
63
  - app/views/external/_disqus.html.erb