merge branch changeable-votes

This commit is contained in:
Toks
2013-06-29 15:12:38 -04:00
15 changed files with 124 additions and 18 deletions

View File

@@ -13,7 +13,7 @@
</li>
<li>Source: <%= post_source_tag(post) %></li>
<li>Rating: <%= post.pretty_rating %></li>
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_gold? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_gold? %>(<span id="vote-links-for-post-<%= post.id %>">vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %></span><%= link_to "unvote", unvote_post_path(post), :remote => true, :method => :put, :id => "unvote-link-for-post-#{post.id}", :class => "unvote-post-link" %>)<% end %></li>
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
<% if CurrentUser.is_gold? %>
<%= link_to "&raquo;".html_safe, "#", :id => "show-favlist-link" %>

View File

@@ -0,0 +1,8 @@
<% if @error %>
Danbooru.notice("<%= j @error.to_s %>");
<% else %>
Danbooru.notice("Unvoted successfully");
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
<% end %>
$("#vote-links-for-post-<%= @post.id %>").show();
$("#unvote-link-for-post-<%= @post.id %>").hide();