fixes #866
This commit is contained in:
@@ -16,7 +16,11 @@ class PostVersionsController < ApplicationController
|
|||||||
|
|
||||||
def undo
|
def undo
|
||||||
@post_version = PostVersion.find(params[:id])
|
@post_version = PostVersion.find(params[:id])
|
||||||
@post_version.undo!
|
|
||||||
|
if Danbooru.config.can_user_see_post?(CurrentUser.user, @post_version.post)
|
||||||
|
@post_version.undo!
|
||||||
|
end
|
||||||
|
|
||||||
respond_with(@post_version) do |format|
|
respond_with(@post_version) do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ class PostsController < ApplicationController
|
|||||||
def revert
|
def revert
|
||||||
@post = Post.find(params[:id])
|
@post = Post.find(params[:id])
|
||||||
@version = PostVersion.find(params[:version_id])
|
@version = PostVersion.find(params[:version_id])
|
||||||
@post.revert_to!(@version)
|
|
||||||
|
if Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
|
||||||
|
@post.revert_to!(@version)
|
||||||
|
end
|
||||||
|
|
||||||
respond_with(@post) do |format|
|
respond_with(@post) do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,10 +36,12 @@
|
|||||||
<td><%= post_version_diff(post_version) %></td>
|
<td><%= post_version_diff(post_version) %></td>
|
||||||
<% if CurrentUser.is_member? %>
|
<% if CurrentUser.is_member? %>
|
||||||
<td>
|
<td>
|
||||||
<% if post_version.id != post_version.post.versions.first.id %>
|
<% if Danbooru.config.can_user_see_post?(CurrentUser.user, post_version.post) %>
|
||||||
<%= link_to "Undo", undo_post_version_path(post_version), :method => :put, :remote => true %> |
|
<% if post_version.id != post_version.post.versions.first.id %>
|
||||||
|
<%= link_to "Undo", undo_post_version_path(post_version), :method => :put, :remote => true %> |
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "Revert to", revert_post_path(post_version.post_id, :version_id => post_version.id), :method => :put, :remote => true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to "Revert to", revert_post_path(post_version.post_id, :version_id => post_version.id), :method => :put, :remote => true %>
|
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -24,9 +24,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<h1>History</h1>
|
<h1>History</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<% if Danbooru.config.can_user_see_post?(CurrentUser.user, @post) %>
|
<li><%= fast_link_to "Tags", post_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||||
<li><%= fast_link_to "Tags", post_versions_path(:search => {:post_id => @post.id}) %></li>
|
|
||||||
<% end %>
|
|
||||||
<li><%= fast_link_to "Notes", note_versions_path(:search => {:post_id => @post.id}) %></li>
|
<li><%= fast_link_to "Notes", note_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||||
<li><%= fast_link_to "Flags", post_flags_path(:search => {:post_id => @post.id}) %></li>
|
<li><%= fast_link_to "Flags", post_flags_path(:search => {:post_id => @post.id}) %></li>
|
||||||
<li><%= fast_link_to "Appeals", post_appeals_path(:search => {:post_id => @post.id}) %></li>
|
<li><%= fast_link_to "Appeals", post_appeals_path(:search => {:post_id => @post.id}) %></li>
|
||||||
|
|||||||
Reference in New Issue
Block a user