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:
@@ -24,11 +24,6 @@ class WikiPagesController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
|
||||||
authorize WikiPage
|
|
||||||
render layout: "default"
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@wiki_page, found_by = WikiPage.find_by_id_or_title(params[:id])
|
@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?
|
raise PageRemovedError if request.format.html? && @wiki_page&.artist.present? && @wiki_page.artist.is_banned? && !policy(@wiki_page.artist).can_view_banned?
|
||||||
|
|||||||
@@ -102,7 +102,6 @@
|
|||||||
<li><h2>Wiki</h2></li>
|
<li><h2>Wiki</h2></li>
|
||||||
<li><%= link_to_wiki "Help", "help:wiki" %></li>
|
<li><%= link_to_wiki "Help", "help:wiki" %></li>
|
||||||
<li><%= link_to("Listing", wiki_pages_path) %></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>
|
<li><%= link_to("Changes", wiki_page_versions_path) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<%= quick_search_form_for(:title_normalize, wiki_pages_path, "wiki pages", autocomplete: "wiki-page", redirect: true) %>
|
<%= 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", wiki_pages_path %>
|
||||||
<%= subnav_link_to "Search", search_wiki_pages_path %>
|
|
||||||
<% if policy(WikiPage).new? %>
|
<% if policy(WikiPage).new? %>
|
||||||
<%= subnav_link_to "New", new_wiki_page_path %>
|
<%= subnav_link_to "New", new_wiki_page_path %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<div id="c-wiki-pages">
|
|
||||||
<div id="a-search">
|
|
||||||
<%= render "search" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render "secondary_links" %>
|
|
||||||
@@ -297,7 +297,6 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
resources :wiki_pages, id: /.+?(?=\.json|\.xml|\.html)|.+/ do
|
resources :wiki_pages, id: /.+?(?=\.json|\.xml|\.html)|.+/ do
|
||||||
put :revert, on: :member
|
put :revert, on: :member
|
||||||
get :search, on: :collection
|
|
||||||
get :show_or_new, on: :collection
|
get :show_or_new, on: :collection
|
||||||
end
|
end
|
||||||
resources :wiki_page_versions, :only => [:index, :show, :diff] do
|
resources :wiki_page_versions, :only => [:index, :show, :diff] do
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "search action" do
|
|
||||||
should "work" do
|
|
||||||
get search_wiki_pages_path
|
|
||||||
assert_response :success
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "show action" do
|
context "show action" do
|
||||||
setup do
|
setup do
|
||||||
@wiki_page = as(@user) { create(:wiki_page) }
|
@wiki_page = as(@user) { create(:wiki_page) }
|
||||||
|
|||||||
Reference in New Issue
Block a user