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 56 def link_for_spam(comment)
57 57 if comment.can_be_marked_as_spam_by?(user)
58 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 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 62 end
63 63 end
64 64 end
... ... @@ -71,7 +71,7 @@ module CommentHelper
71 71  
72 72 def link_for_remove(comment)
73 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 75 end
76 76 end
77 77  
... ...
app/views/comment/_comment_actions.html.erb
... ... @@ -2,7 +2,7 @@
2 2 <% if !links_submenu.empty? %>
3 3 <div class="comment-actions">
4 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 6 </li>
7 7 </div>
8 8 <% end %>
... ...