fixes #311
This commit is contained in:
@@ -20,6 +20,10 @@ class UsersController < ApplicationController
|
|||||||
respond_with(@users)
|
respond_with(@users)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
@search = User.search(params[:search])
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
@presenter = UserPresenter.new(@user)
|
@presenter = UserPresenter.new(@user)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
<li><%= link_to "Listing", users_path %></li>
|
<li><%= link_to "Listing", users_path %></li>
|
||||||
|
<li><%= link_to "Search", search_users_path %></li>
|
||||||
<% if CurrentUser.is_anonymous? %>
|
<% if CurrentUser.is_anonymous? %>
|
||||||
<li><%= link_to "Sign up", new_user_path %></li>
|
<li><%= link_to "Sign up", new_user_path %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
14
app/views/users/search.html.erb
Normal file
14
app/views/users/search.html.erb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<div id="c-users">
|
||||||
|
<div id="a-search">
|
||||||
|
<%= simple_form_for(@search) do |f| %>
|
||||||
|
<%= f.input :name_matches, :required => false, :label => "Name" %>
|
||||||
|
<%= f.button :submit, "Search" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
|
|
||||||
|
<% content_for(:page_title) do %>
|
||||||
|
Search Users - <%= Danbooru.config.app_name %>
|
||||||
|
<% end %>
|
||||||
@@ -158,6 +158,7 @@ Danbooru::Application.routes.draw do
|
|||||||
resources :users do
|
resources :users do
|
||||||
collection do
|
collection do
|
||||||
get :upgrade_information
|
get :upgrade_information
|
||||||
|
get :search
|
||||||
end
|
end
|
||||||
|
|
||||||
member do
|
member do
|
||||||
|
|||||||
Reference in New Issue
Block a user