Fixes #19: Unable to delete my comments
This commit is contained in:
1
app/views/comments/destroy.js.erb
Normal file
1
app/views/comments/destroy.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
|
||||
@@ -11,8 +11,8 @@
|
||||
</div>
|
||||
<menu>
|
||||
<li><%= link_to "Reply", new_comment_path(:post_id => comment.post_id), :class => "reply-link", "data-comment-id" => comment.id %></li>
|
||||
<% if CurrentUser.user.is_janitor? || CurrentUser.user.id == comment.creator_id %>
|
||||
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete %></li>
|
||||
<% if comment.editable_by?(CurrentUser.user) %>
|
||||
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete, :remote => true %></li>
|
||||
<li><%= link_to "Edit", edit_comment_path(comment.id) %></li>
|
||||
<% end %>
|
||||
<li><%= link_to "Vote up", comment_votes_path(:comment_id => comment.id, :score => "up"), :method => :post, :remote => true %></li>
|
||||
|
||||
Reference in New Issue
Block a user