diff --git a/app/helpers/comment_helper.rb b/app/helpers/comment_helper.rb index e6095a7..5156256 100644 --- a/app/helpers/comment_helper.rb +++ b/app/helpers/comment_helper.rb @@ -25,7 +25,10 @@ module CommentHelper def comment_actions(comment) url = url_for(:profile => profile.identifier, :controller => :comment, :action => :check_actions, :id => comment.id) links = links_for_comment_actions(comment) - content_tag(:li, link_to(content_tag(:span, _('Contents menu')), '#', :onclick => "toggleSubmenu(this,'',#{links.to_json}); return false", :class => 'menu-submenu-trigger comment-trigger', :url => url), :class=> 'vcard') unless links.empty? + links_submenu = links.select{|link| link[:action_bar].nil? || !link[:action_bar]} + links_action_bar = links - links_submenu + links_submenu = links_submenu.collect {|link| link.slice(:link)} + render :partial => 'comment/comment_actions', :locals => {:links_submenu => links_submenu, :links_action_bar => links_action_bar, :url => url, :comment => comment} end private diff --git a/app/views/comment/_comment.rhtml b/app/views/comment/_comment.rhtml index e7fb23b..1da1081 100644 --- a/app/views/comment/_comment.rhtml +++ b/app/views/comment/_comment.rhtml @@ -32,19 +32,7 @@
-
- <%= comment_actions(comment) %>
-
-
- <% unless comment.spam? %> - <%= link_to_function '', - "var f = add_comment_reply_form(this, %s); f.find('comment_title, textarea').val(''); return false" % comment.id, - :class => 'comment-footer comment-footer-link comment-footer-hide comment-actions-reply button', - :id => 'comment-reply-to-' + comment.id.to_s, - :title => _('Reply') - %> - <% end %> + <%= comment_actions(comment) %>+ <% if !links_submenu.empty? %> +
+ -
+ <%= link_to(content_tag(:span, _('Contents menu')), '#', :onclick => "toggleSubmenu(this,'',#{links_submenu.to_json}); return false", :class => 'menu-submenu-trigger comment-trigger', :url => url) %>
+
+
+ <% end %>
+
+