wiki pages: remove /wiki_pages/search page.

This page is unnecessary since you can already search wiki pages from the /wiki_pages listing.
This commit is contained in:
evazion
2022-08-24 13:37:58 -05:00
parent bccd1bf8a3
commit d01b3c0637
6 changed files with 1 additions and 23 deletions

View File

@@ -24,11 +24,6 @@ class WikiPagesController < ApplicationController
end
end
def search
authorize WikiPage
render layout: "default"
end
def show
@wiki_page, found_by = WikiPage.find_by_id_or_title(params[:id])
raise PageRemovedError if request.format.html? && @wiki_page&.artist.present? && @wiki_page.artist.is_banned? && !policy(@wiki_page.artist).can_view_banned?

View File

@@ -102,7 +102,6 @@
<li><h2>Wiki</h2></li>
<li><%= link_to_wiki "Help", "help:wiki" %></li>
<li><%= link_to("Listing", wiki_pages_path) %></li>
<li><%= link_to("Search", search_wiki_pages_path) %></li>
<li><%= link_to("Changes", wiki_page_versions_path) %></li>
</ul>
<ul>

View File

@@ -1,7 +1,6 @@
<% content_for(:secondary_links) do %>
<%= quick_search_form_for(:title_normalize, wiki_pages_path, "wiki pages", autocomplete: "wiki-page", redirect: true) %>
<%= subnav_link_to "Listing", wiki_pages_path %>
<%= subnav_link_to "Search", search_wiki_pages_path %>
<%= subnav_link_to "Search", wiki_pages_path %>
<% if policy(WikiPage).new? %>
<%= subnav_link_to "New", new_wiki_page_path %>
<% end %>

View File

@@ -1,7 +0,0 @@
<div id="c-wiki-pages">
<div id="a-search">
<%= render "search" %>
</div>
</div>
<%= render "secondary_links" %>

View File

@@ -297,7 +297,6 @@ Rails.application.routes.draw do
end
resources :wiki_pages, id: /.+?(?=\.json|\.xml|\.html)|.+/ do
put :revert, on: :member
get :search, on: :collection
get :show_or_new, on: :collection
end
resources :wiki_page_versions, :only => [:index, :show, :diff] do

View File

@@ -66,13 +66,6 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
end
end
context "search action" do
should "work" do
get search_wiki_pages_path
assert_response :success
end
end
context "show action" do
setup do
@wiki_page = as(@user) { create(:wiki_page) }