This commit is contained in:
r888888888
2013-05-13 10:48:12 -07:00
parent 3ea4b8daaf
commit 050d231375
5 changed files with 5 additions and 23 deletions

View File

@@ -27,9 +27,4 @@ div#c-wiki-pages {
margin-left: 15em;
padding-left: 1em;
}
div.redirected-from {
font-size: 0.8em;
margin-bottom: 1em;
}
}

View File

@@ -67,12 +67,8 @@ class WikiPagesController < ApplicationController
def show_or_new
@wiki_page = WikiPage.find_by_title(params[:title])
tag_alias = TagAlias.where("status = 'active' and antecedent_name = ?", params[:title]).first
if tag_alias && params[:no_redirect].blank?
redirect_to show_or_new_wiki_pages_path(:title => tag_alias.consequent_name, :redirected_from => params[:title])
elsif @wiki_page
redirect_to wiki_page_path(@wiki_page, :redirected_from => params[:redirected_from])
if @wiki_page
redirect_to wiki_page_path(@wiki_page)
else
@wiki_page = WikiPage.new(:title => params[:title])
respond_with(@wiki_page)

View File

@@ -15,7 +15,7 @@ module WikiPagesHelper
if consequent_aliases.any?
html << "<p class='hint'>The following tags are aliased to this tag: "
html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name, :no_redirect => true))}.join(", "))
html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name))}.join(", "))
html << ".</p>"
end

View File

@@ -12,10 +12,6 @@
<% end %>
</h1>
<% if params[:redirected_from].present? %>
<div class="hint redirected-from">Redirected from <%= link_to params[:redirected_from], show_or_new_wiki_pages_path(:title => params[:redirected_from], :no_redirect => true) %>.</div>
<% end %>
<div id="wiki-page-body" class="prose">
<%= format_text(@wiki_page.body) %>

View File

@@ -4,13 +4,8 @@
<section id="content">
<h1 id="wiki-page-title"><%= params[:title] %></h1>
<% if params[:redirected_from].present? %>
<div class="hint redirected-from">Redirected from <%= link_to params[:redirected_from], show_or_new_wiki_pages_path(:title => params[:redirected_from], :no_redirect => true) %>.</div>
<% end %>
<div class="ui-corner-all ui-state-highlight notice">
This wiki page does not yet exist. <%= link_to "Create a new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.
<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>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>