The previous commit changed it so that `/pools?search[name_matches]` does a full-text search. So for example, `search[name_matches]=smiling` will now match pool names containing any of the words "smiling", "smile", "smiles", or "smiled". This commit adds a `/pools?search[name_contains]` param that does what `name_matches` did before, and switches to it in search forms. So for example, `search[name_contains]=smiling` will only match pool names containing the exact substring "smiling". This change is so that `<field>_matches` works consistently across the site, and so that it's possible to search pool names by either an exact substring match, or by a looser natural language match. This is a minor breaking API change. API users can replace `/pools?search[name_matches]` with `/pools?search[name_contains]` to get the same behavior as before. The same applies to /favorite_groups.
34 lines
1.5 KiB
Plaintext
34 lines
1.5 KiB
Plaintext
<% content_for(:secondary_links) do %>
|
|
<%= quick_search_form_for(:name_contains, pools_path, "pools", autocomplete: "pool", redirect: true) %>
|
|
<%= subnav_link_to "Gallery", gallery_pools_path %>
|
|
<%= subnav_link_to "Listing", pools_path %>
|
|
<% if policy(Pool).create? %>
|
|
<%= subnav_link_to "New", new_pool_path %>
|
|
<% end %>
|
|
<% if PoolVersion.enabled? %>
|
|
<%= subnav_link_to "Recent changes", pool_versions_path %>
|
|
<% end %>
|
|
<%= subnav_link_to "Help", wiki_page_path("help:pools") %>
|
|
<% if @pool && !@pool.new_record? %>
|
|
<li>|</li>
|
|
<%= subnav_link_to "Show", pool_path(@pool) %>
|
|
<%= subnav_link_to "Posts", posts_path(:tags => "pool:#{@pool.id}") %>
|
|
<% if policy(@pool).update? %>
|
|
<%= subnav_link_to "Edit", edit_pool_path(@pool), "data-shortcut": "e" %>
|
|
<% end %>
|
|
<% if current_page?(action: :edit) %>
|
|
<% if policy(@pool).undelete? %>
|
|
<%= subnav_link_to "Undelete", undelete_pool_path(@pool), :method => :post, :remote => true %>
|
|
<% elsif policy(@pool).destroy? %>
|
|
<%= subnav_link_to "Delete", pool_path(@pool), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this pool?", :remote => true %>
|
|
<% end %>
|
|
<% end %>
|
|
<% if PoolVersion.enabled? %>
|
|
<%= subnav_link_to "History", pool_versions_path(:search => {:pool_id => @pool.id}) %>
|
|
<% end %>
|
|
<% if policy(@pool).update? %>
|
|
<%= subnav_link_to "Order", edit_pool_order_path(@pool) %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|