Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-06-05 09:04:38 -05:00
commit 27c878a537

View file

@ -229,9 +229,17 @@ class WikiController < ApplicationController
@page_name ||= 'HomePage' @page_name ||= 'HomePage'
@page ||= wiki.read_page(@web_name, @page_name) @page ||= wiki.read_page(@web_name, @page_name)
@link_mode ||= :publish @link_mode ||= :publish
render(:text => "Page '#{@page_name}' not found", :status => 404, :layout => 'error') and return unless @page if @page
@renderer = PageRenderer.new(@page.revisions.last) @renderer = PageRenderer.new(@page.revisions.last)
else
real_page = WikiReference.page_that_redirects_for(@web, @page_name)
if real_page
flash[:info] = "Redirected from \"#{@page_name}\"."
redirect_to :web => @web_name, :action => 'published', :id => real_page
else
render(:text => "Page '#{@page_name}' not found", :status => 404, :layout => 'error')
end
end
end end
def revision def revision
@ -311,7 +319,13 @@ class WikiController < ApplicationController
end end
else else
if not @page_name.nil? and @page_name.is_utf8? and not @page_name.empty? if not @page_name.nil? and @page_name.is_utf8? and not @page_name.empty?
real_page = WikiReference.page_that_redirects_for(@web, @page_name)
if real_page
flash[:info] = "Redirected from \"#{@page_name}\"."
redirect_to :web => @web_name, :action => 'show', :id => real_page
else
redirect_to :web => @web_name, :action => 'new', :id => @page_name redirect_to :web => @web_name, :action => 'new', :id => @page_name
end
else else
render :text => 'Page name is not specified', :status => 404, :layout => 'error' render :text => 'Page name is not specified', :status => 404, :layout => 'error'
end end