Skip to content
Browse files

Allow deleting a comment from the threaded view.

  • Loading branch information...
1 parent 606aa61 commit d23852b62699d9d8871eb2248fd8bfa470f632b0 @nud committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 app/views/comments/_comment.html.haml
View
7 app/views/comments/_comment.html.haml
@@ -25,8 +25,11 @@
= comment.user.try(:signature)
%footer.actions
= link_to "Répondre", "/nodes/#{comment.node_id}/comments/#{comment.id}/answer#new_comment", :class => 'action'
- - if current_account && current_account.can_update?(comment)
- = link_to "Modifier", "/nodes/#{comment.node_id}/comments/#{comment.id}/modifier", :class => 'action'
+ - if current_account
+ - if current_account.can_update?(comment)
+ = link_to "Modifier", "/nodes/#{comment.node_id}/comments/#{comment.id}/modifier", :class => 'action'
+ - if current_account.can_destroy?(comment)
+ = button_to "Supprimer", [comment.node, comment], :method => :delete, :confirm => "Êtes-vous sûr de vouloir supprimer ce commentaire ?", :class => 'action'
- if current_account && current_account.can_vote?(comment)
%div.vote
Ce commentaire est-il #{button_to "pertinent", "/nodes/#{comment.node_id}/comments/#{comment.id}/relevance/for", :remote => true, :disabled => comment.score >= 10, :class => "relevant"}

0 comments on commit d23852b

Please sign in to comment.
Something went wrong with that request. Please try again.