changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class PoolVersionsController < ApplicationController
|
||||
def index
|
||||
@search = PoolVersion.search(params[:search])
|
||||
@pool_versions = @search.paginate(:page => params[:page])
|
||||
@pool_versions = @search.paginate(params[:page])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class PostVersionsController < ApplicationController
|
||||
def index
|
||||
@search = PostVersion.search(params[:search]).paginate(params[:paginate])
|
||||
@search = PostVersion.search(params[:search])
|
||||
@post_versions = @search.order("id desc").paginate(params[:page])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,16 @@ protected
|
||||
|
||||
when "uploads"
|
||||
/^\/post/
|
||||
|
||||
when "post_versions"
|
||||
/^\/post/
|
||||
|
||||
when "pool_versions"
|
||||
/^\/pool/
|
||||
|
||||
when "note_versions"
|
||||
/^\/note/
|
||||
|
||||
else
|
||||
/^\/#{controller}/
|
||||
end
|
||||
|
||||
44
app/views/post_versions/_listing.html.erb
Normal file
44
app/views/post_versions/_listing.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="listing">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">Post</th>
|
||||
<th width="15%">Date</th>
|
||||
<th width="10%">User</th>
|
||||
<th width="5%">Rating</th>
|
||||
<th width="5%">Parent</th>
|
||||
<th width="10%">IP Address</th>
|
||||
<th width="50%">Tags</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% post_versions.each do |post_version| %>
|
||||
<tr id="post-version-<%= post_version.id %>">
|
||||
<td><%= link_to(post_version.post_id, post_path(post_version.post_id)) %></td>
|
||||
<td><%= post_version.updated_at.strftime("%Y-%m-%d %H:%M") %></td>
|
||||
<td><%= link_to(post_version.updater.name, user_path(post_version.updater_id)) %></td>
|
||||
<td><%= post_version.rating %></td>
|
||||
<td><%= post_version.parent_id %></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_admin? %>
|
||||
<%= post_version.updater_ip_addr %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% post_version.add_tag_array.each do |tag| %>
|
||||
<ins><%= tag %></ins>
|
||||
<% end %>
|
||||
|
||||
<% post_version.del_tag_array.each do |tag| %>
|
||||
<del><%= tag %></del>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="paginator">
|
||||
<%= sequential_paginator(post_versions) %>
|
||||
</div>
|
||||
@@ -2,56 +2,18 @@
|
||||
<div id="a-index">
|
||||
<div id="search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :updater_name_eq, "User" %>
|
||||
<%= f.input :updater_name_eq, :label => "User" %>
|
||||
<%= f.input :post_id_eq, :label => "Post" %>
|
||||
<%= f.button :submit %>
|
||||
<%= f.button :submit, :value => "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="listing">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">Post</th>
|
||||
<th width="15%">Date</th>
|
||||
<th width="10%">User</th>
|
||||
<th width="5%">Rating</th>
|
||||
<th width="5%">Parent</th>
|
||||
<th width="10%">IP Address</th>
|
||||
<th width="50%">Tags</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @post_versions.each do |post_version| %>
|
||||
<tr id="post-version-<%= post_version.id %>">
|
||||
<td><%= link_to(post_version.post_id, post_path(post_version.post_id)) %></td>
|
||||
<td><%= post_version.updated_at.strftime("%Y-%m-%d %H:%M") %></td>
|
||||
<td><%= link_to(post_version.updater.name, user_path(post_version.updater_id)) %></td>
|
||||
<td><%= post_version.rating %></td>
|
||||
<td><%= post_version.parent_id %></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_admin? %>
|
||||
<%= post_version.updater_ip_addr %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% post_version.add_tag_array.each do |tag| %>
|
||||
<ins><%= tag %></ins>
|
||||
<% end %>
|
||||
|
||||
<% post_version.del_tag_array.each do |tag| %>
|
||||
<del><%= tag %></del>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="paginator">
|
||||
<%= sequential_paginator(@post_versions) %>
|
||||
</div>
|
||||
<% if @post_versions.empty? %>
|
||||
<%= render "post_sets/blank" %>
|
||||
<% else %>
|
||||
<%= render :partial => "listing", :locals => {:post_versions => @post_versions} %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
Reference in New Issue
Block a user