Commit 02b24442a18fba45669f733ce9665534a190af4a

Authored by Evandro Jr
1 parent 74faf599
Exists in master

before refactor paragraph_id to comment_paragraph_paragraph_id

lib/comment_paragraph_plugin.rb
@@ -19,7 +19,7 @@ class CommentParagraphPlugin < Noosfero::Plugin @@ -19,7 +19,7 @@ class CommentParagraphPlugin < Noosfero::Plugin
19 arr = [] 19 arr = []
20 arr << hidden_field_tag('comment[id]', comment.id) 20 arr << hidden_field_tag('comment[id]', comment.id)
21 arr << hidden_field_tag('comment[paragraph_id]', paragraph_id) if paragraph_id 21 arr << hidden_field_tag('comment[paragraph_id]', paragraph_id) if paragraph_id
22 - arr << hidden_field_tag('comment[comment_paragraph_selected_area]', comment_paragraph_selected_area) if comment_paragraph_selected_area 22 + arr << hidden_field_tag('comment[comment_paragraph_selected_area]', comment.comment_paragraph_selected_area) if comment.comment_paragraph_selected_area
23 arr 23 arr
24 } 24 }
25 end 25 end
lib/ext/comment.rb
@@ -5,7 +5,7 @@ class Comment @@ -5,7 +5,7 @@ class Comment
5 scope :without_paragraph, :conditions => {:paragraph_id => nil } 5 scope :without_paragraph, :conditions => {:paragraph_id => nil }
6 6
7 settings_items :comment_paragraph_selected_area, :type => :string 7 settings_items :comment_paragraph_selected_area, :type => :string
8 - 8 +
9 scope :in_paragraph, proc { |paragraph_id| { 9 scope :in_paragraph, proc { |paragraph_id| {
10 :conditions => ['paragraph_id = ?', paragraph_id] 10 :conditions => ['paragraph_id = ?', paragraph_id]
11 } 11 }
public/comment_paragraph.js
@@ -3,9 +3,8 @@ function makeCommentable() { @@ -3,9 +3,8 @@ function makeCommentable() {
3 3
4 foundCommentableParagraph = false; 4 foundCommentableParagraph = false;
5 jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) { 5 jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) {
6 - paragraphsTxt+="<p>" + jQuery(this).html() + "</p>";  
7 - console.log(jQuery(this).html())  
8 - foundCommentableParagraph = true; 6 + paragraphsTxt+="<p>" + jQuery(this).html() + "</p>";
  7 + foundCommentableParagraph = true;
9 }); 8 });
10 9
11 if(foundCommentableParagraph === true){ 10 if(foundCommentableParagraph === true){