wiki pages: replace show_or_new page with redirects.
* Redirect the show_or_new action to either the show page or the new page. Don't use show_or_new to render nonexistent wikis; do that in the regular show action instead. * Make the show action return 404 for nonexistent wikis.
This commit is contained in:
@@ -19,7 +19,11 @@
|
||||
<p><%= wiki_page_other_names_list(@wiki_page) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= format_text(@wiki_page.body) %>
|
||||
<% if @wiki_page.new_record? %>
|
||||
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(wiki_page: { title: @wiki_page.title }) %>.</p>
|
||||
<% else %>
|
||||
<%= format_text(@wiki_page.body) %>
|
||||
<% end %>
|
||||
|
||||
<% if @wiki_page.artist %>
|
||||
<p><%= link_to "View artist", @wiki_page.artist %></p>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<%= render "sidebar" %>
|
||||
|
||||
<% content_for(:content) do %>
|
||||
<h1 id="wiki-page-title">
|
||||
<%= link_to @wiki_page.pretty_title, posts_path(:tags => @wiki_page.title), :class => "tag-type-#{@wiki_page.category_name}" %>
|
||||
</h1>
|
||||
<div id="wiki-page-body" class="prose">
|
||||
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.</p>
|
||||
</div>
|
||||
|
||||
<% if @wiki_page.artist.present? %>
|
||||
<p><%= link_to "View artist", @wiki_page.artist %></p>
|
||||
<% end %>
|
||||
|
||||
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
|
||||
|
||||
<%= wiki_page_post_previews(@wiki_page) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Wiki - <%= params[:title] %> - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user