fixes #75: History tags dont have a revert function

This commit is contained in:
albert
2011-09-15 18:57:50 -04:00
parent eddf35556a
commit ba4052e831
3 changed files with 10 additions and 4 deletions

View File

@@ -26,7 +26,9 @@ class PostsController < ApplicationController
@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) @post.revert_to!(@version)
respond_with(@post) respond_with(@post) do |format|
format.js
end
end end
private private

View File

@@ -1,5 +1,5 @@
<div class="listing"> <div class="listing">
<table> <table class="striped">
<thead> <thead>
<tr> <tr>
<th width="5%">Post</th> <th width="5%">Post</th>
@@ -8,7 +8,8 @@
<th width="5%">Rating</th> <th width="5%">Rating</th>
<th width="5%">Parent</th> <th width="5%">Parent</th>
<th width="10%">IP Address</th> <th width="10%">IP Address</th>
<th width="50%">Tags</th> <th width="45%">Tags</th>
<th width="5%"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -33,6 +34,9 @@
<del><%= tag %></del> <del><%= tag %></del>
<% end %> <% end %>
</td> </td>
<td>
<%= link_to "Revert", revert_post_path(post_version.post_id, :version_id => post_version.id), :method => :put, :remote => true %>
</td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@@ -17,7 +17,7 @@
<% end %> <% end %>
<p> <p>
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path %>. You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path(:search => {:uploader_id_eq => CurrentUser.id}) %>.
<% if CurrentUser.user.is_moderator? && @upload.is_pending? %> <% if CurrentUser.user.is_moderator? && @upload.is_pending? %>
<%= link_to "Force update", upload_path(@upload, :format => "js"), :remote => true, :method => :put %>. <%= link_to "Force update", upload_path(@upload, :format => "js"), :remote => true, :method => :put %>.
<% end %> <% end %>