Commit 340ea82bba6107404bea5c9c3c11c02017218d0d

Authored by Rodrigo Souto
2 parents fb2ecc7f 65e255c9

Merge branch 'rails3' of gitlab.com:noosfero/noosfero into rails3

app/helpers/comment_helper.rb
@@ -56,9 +56,9 @@ module CommentHelper @@ -56,9 +56,9 @@ module CommentHelper
56 def link_for_spam(comment) 56 def link_for_spam(comment)
57 if comment.can_be_marked_as_spam_by?(user) 57 if comment.can_be_marked_as_spam_by?(user)
58 if comment.spam? 58 if comment.spam?
59 - {:link => link_to_function(_('Mark as NOT SPAM'), 'remove_comment(this, %s); return false;' % url_for(:profile => profile.identifier, :mark_comment_as_ham => comment.id).to_json, :class => 'comment-footer comment-footer-link comment-footer-hide')} 59 + {:link => link_to_function(_('Mark as NOT SPAM'), 'remove_comment(this, \'%s\'); return false;' % url_for(:profile => profile.identifier, :mark_comment_as_ham => comment.id), :class => 'comment-footer comment-footer-link comment-footer-hide')}
60 else 60 else
61 - {:link => link_to_function(_('Mark as SPAM'), 'remove_comment(this, %s, %s); return false;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :mark_as_spam, :id => comment.id).to_json, _('Are you sure you want to mark this comment as SPAM?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide')} 61 + {:link => link_to_function(_('Mark as SPAM'), 'remove_comment(this, \'%s\', \'%s\'); return false;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :mark_as_spam, :id => comment.id), _('Are you sure you want to mark this comment as SPAM?')], :class => 'comment-footer comment-footer-link comment-footer-hide')}
62 end 62 end
63 end 63 end
64 end 64 end
@@ -71,7 +71,7 @@ module CommentHelper @@ -71,7 +71,7 @@ module CommentHelper
71 71
72 def link_for_remove(comment) 72 def link_for_remove(comment)
73 if comment.can_be_destroyed_by?(user) 73 if comment.can_be_destroyed_by?(user)
74 - {:link => link_to_function(_('Remove'), 'remove_comment(this, %s, %s); return false ;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :destroy, :id => comment.id).to_json, _('Are you sure you want to remove this comment and all its replies?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide remove-children')} 74 + {:link => link_to_function(_('Remove'), 'remove_comment(this, \'%s\', \'%s\'); return false ;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :destroy, :id => comment.id), _('Are you sure you want to remove this comment and all its replies?')], :class => 'comment-footer comment-footer-link comment-footer-hide remove-children')}
75 end 75 end
76 end 76 end
77 77
app/views/comment/_comment_actions.html.erb
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <% if !links_submenu.empty? %> 2 <% if !links_submenu.empty? %>
3 <div class="comment-actions"> 3 <div class="comment-actions">
4 <li class="vcard"> 4 <li class="vcard">
5 - <%= link_to(content_tag(:span, _('Contents menu')), '#', :onclick => "toggleSubmenu(this,'',#{j links_submenu.to_json}); return false", :class => 'menu-submenu-trigger comment-trigger', :url => url) %> 5 + <%= link_to(content_tag(:span, _('Contents menu')), '#', :onclick => "toggleSubmenu(this,'',#{CGI::escapeHTML(links_submenu.to_json)}); return false", :class => 'menu-submenu-trigger comment-trigger', :url => url) %>
6 </li> 6 </li>
7 </div> 7 </div>
8 <% end %> 8 <% end %>