This commit is contained in:
albert
2013-03-02 19:21:39 -05:00
parent 5ece9fe99a
commit b9b92b6264
2 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
<% if @comment_vote.errors.any? %>
Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>");
<% elsif @comment_vote.is_negative? %>
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
<% else %>
<% if @comment_vote.is_negative? %>
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
<% end %>
$("#comment-vote-up-link-for-<%= @comment.id %>").remove();
$("#comment-vote-down-link-for-<%= @comment.id %>").remove();
<% end %>

View File

@@ -16,8 +16,8 @@
<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>
<li><%= link_to "Vote down", comment_votes_path(:comment_id => comment.id, :score => "down"), :method => :post, :remote => true %></li>
<li id="comment-vote-up-link-for-<%= comment.id %>"><%= link_to "Vote up", comment_votes_path(:comment_id => comment.id, :score => "up"), :method => :post, :remote => true %></li>
<li id="comment-vote-down-link-for-<%= comment.id %>"><%= link_to "Vote down", comment_votes_path(:comment_id => comment.id, :score => "down"), :method => :post, :remote => true %></li>
<% end %>
</menu>
</div>