fixes #51: Post change search issue
This commit is contained in:
@@ -3,4 +3,8 @@ class PostVersionsController < ApplicationController
|
||||
@search = PostVersion.search(params[:search])
|
||||
@post_versions = @search.order("id desc").paginate(params[:page])
|
||||
end
|
||||
|
||||
def search
|
||||
@search = PostVersion.search(params[:search])
|
||||
end
|
||||
end
|
||||
|
||||
8
app/views/post_versions/_secondary_links.html.erb
Normal file
8
app/views/post_versions/_secondary_links.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Posts", posts_path %></li>
|
||||
<li><%= link_to "Upload", new_upload_path %></li>
|
||||
<li><%= link_to "Search", search_post_versions_path %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:title => "help:posts") %></li>
|
||||
</menu>
|
||||
<% end %>
|
||||
@@ -1,13 +1,5 @@
|
||||
<div id="c-post-versions">
|
||||
<div id="a-index">
|
||||
<div id="search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :updater_name_eq, :label => "User" %>
|
||||
<%= f.input :post_id_eq, :label => "Post" %>
|
||||
<%= f.button :submit, :value => "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @post_versions.empty? %>
|
||||
<%= render "post_sets/blank" %>
|
||||
<% else %>
|
||||
@@ -16,4 +8,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
<%= render "secondary_links" %>
|
||||
13
app/views/post_versions/search.html.erb
Normal file
13
app/views/post_versions/search.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div id="c-post-versions">
|
||||
<div id="a-search">
|
||||
<div id="search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :updater_name_eq, :label => "User", :required => false %>
|
||||
<%= f.input :post_id_eq, :label => "Post", :required => false %>
|
||||
<%= f.button :submit, :value => "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
@@ -94,8 +94,11 @@ Danbooru::Application.routes.draw do
|
||||
put :revert
|
||||
end
|
||||
end
|
||||
|
||||
resources :post_versions, :only => [:index]
|
||||
resources :post_versions, :only => [:index, :search] do
|
||||
collection do
|
||||
get :search
|
||||
end
|
||||
end
|
||||
resources :post_flags, :only => [:new, :index, :create]
|
||||
resources :post_appeals, :only => [:new, :index, :create]
|
||||
resource :session
|
||||
|
||||
Reference in New Issue
Block a user