fixes #51: Post change search issue
This commit is contained in:
@@ -3,4 +3,8 @@ class PostVersionsController < ApplicationController
|
|||||||
@search = PostVersion.search(params[:search])
|
@search = PostVersion.search(params[:search])
|
||||||
@post_versions = @search.order("id desc").paginate(params[:page])
|
@post_versions = @search.order("id desc").paginate(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
@search = PostVersion.search(params[:search])
|
||||||
|
end
|
||||||
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="c-post-versions">
|
||||||
<div id="a-index">
|
<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? %>
|
<% if @post_versions.empty? %>
|
||||||
<%= render "post_sets/blank" %>
|
<%= render "post_sets/blank" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -16,4 +8,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</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
|
put :revert
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
resources :post_versions, :only => [:index, :search] do
|
||||||
resources :post_versions, :only => [:index]
|
collection do
|
||||||
|
get :search
|
||||||
|
end
|
||||||
|
end
|
||||||
resources :post_flags, :only => [:new, :index, :create]
|
resources :post_flags, :only => [:new, :index, :create]
|
||||||
resources :post_appeals, :only => [:new, :index, :create]
|
resources :post_appeals, :only => [:new, :index, :create]
|
||||||
resource :session
|
resource :session
|
||||||
|
|||||||
Reference in New Issue
Block a user